Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ErrorSurfaceTrajParam Class Reference

#include <G4ErrorSurfaceTrajParam.hh>

Public Member Functions

 G4ErrorSurfaceTrajParam ()
 
 G4ErrorSurfaceTrajParam (const G4Point3D &pos, const G4Vector3D &mom, const G4Vector3D &vecV, const G4Vector3D &vecW)
 
 G4ErrorSurfaceTrajParam (const G4Point3D &pos, const G4Vector3D &mom, const G4Plane3D &plane)
 
 G4ErrorSurfaceTrajParam (const G4ErrorSurfaceTrajParam &)=default
 
 G4ErrorSurfaceTrajParam (G4ErrorSurfaceTrajParam &&)=default
 
virtual ~G4ErrorSurfaceTrajParam ()
 
G4ErrorSurfaceTrajParamoperator= (const G4ErrorSurfaceTrajParam &)=default
 
G4ErrorSurfaceTrajParamoperator= (G4ErrorSurfaceTrajParam &&)=default
 
void SetParameters (const G4Point3D &pos, const G4Vector3D &mom, const G4Vector3D &vecV, const G4Vector3D &vecW)
 
void SetParameters (const G4Point3D &pos, const G4Vector3D &mom, const G4Plane3D &plane)
 
G4Vector3D GetDirection () const
 
G4Vector3D GetPlaneNormal () const
 
G4Vector3D GetVectorV () const
 
G4Vector3D GetVectorW () const
 
G4double GetPV () const
 
G4double GetPW () const
 
G4double GetV () const
 
G4double GetW () const
 
G4double GetInvP () const
 

Friends

std::ostream & operator<< (std::ostream &, const G4ErrorSurfaceTrajParam &ts)
 

Detailed Description

Definition at line 51 of file G4ErrorSurfaceTrajParam.hh.

Constructor & Destructor Documentation

◆ G4ErrorSurfaceTrajParam() [1/5]

G4ErrorSurfaceTrajParam::G4ErrorSurfaceTrajParam ( )
inline

Definition at line 55 of file G4ErrorSurfaceTrajParam.hh.

56 : fInvP(0.), fPV(0.), fPW(0.), fV(0.), fW(0.) {}

◆ G4ErrorSurfaceTrajParam() [2/5]

G4ErrorSurfaceTrajParam::G4ErrorSurfaceTrajParam ( const G4Point3D pos,
const G4Vector3D mom,
const G4Vector3D vecV,
const G4Vector3D vecW 
)

Definition at line 39 of file G4ErrorSurfaceTrajParam.cc.

42{
43 SetParameters( pos, mom, vecV, vecW );
44}
void SetParameters(const G4Point3D &pos, const G4Vector3D &mom, const G4Vector3D &vecV, const G4Vector3D &vecW)

◆ G4ErrorSurfaceTrajParam() [3/5]

G4ErrorSurfaceTrajParam::G4ErrorSurfaceTrajParam ( const G4Point3D pos,
const G4Vector3D mom,
const G4Plane3D plane 
)

Definition at line 48 of file G4ErrorSurfaceTrajParam.cc.

51{
52 SetParameters( pos, mom, plane );
53}

◆ G4ErrorSurfaceTrajParam() [4/5]

G4ErrorSurfaceTrajParam::G4ErrorSurfaceTrajParam ( const G4ErrorSurfaceTrajParam )
default

◆ G4ErrorSurfaceTrajParam() [5/5]

G4ErrorSurfaceTrajParam::G4ErrorSurfaceTrajParam ( G4ErrorSurfaceTrajParam &&  )
default

◆ ~G4ErrorSurfaceTrajParam()

virtual G4ErrorSurfaceTrajParam::~G4ErrorSurfaceTrajParam ( )
inlinevirtual

Definition at line 66 of file G4ErrorSurfaceTrajParam.hh.

66{}

Member Function Documentation

◆ GetDirection()

G4Vector3D G4ErrorSurfaceTrajParam::GetDirection ( ) const
inline

Definition at line 82 of file G4ErrorSurfaceTrajParam.hh.

82{ return fDir; }

◆ GetInvP()

G4double G4ErrorSurfaceTrajParam::GetInvP ( ) const
inline

Definition at line 90 of file G4ErrorSurfaceTrajParam.hh.

90{ return fInvP; }

◆ GetPlaneNormal()

G4Vector3D G4ErrorSurfaceTrajParam::GetPlaneNormal ( ) const
inline

Definition at line 83 of file G4ErrorSurfaceTrajParam.hh.

83{ return fVectorV.cross(fVectorW); }
BasicVector3D< T > cross(const BasicVector3D< T > &v) const

◆ GetPV()

G4double G4ErrorSurfaceTrajParam::GetPV ( ) const
inline

Definition at line 86 of file G4ErrorSurfaceTrajParam.hh.

86{ return fPV; }

Referenced by G4ErrorFreeTrajState::G4ErrorFreeTrajState().

◆ GetPW()

G4double G4ErrorSurfaceTrajParam::GetPW ( ) const
inline

Definition at line 87 of file G4ErrorSurfaceTrajParam.hh.

87{ return fPW; }

Referenced by G4ErrorFreeTrajState::G4ErrorFreeTrajState().

◆ GetV()

G4double G4ErrorSurfaceTrajParam::GetV ( ) const
inline

Definition at line 88 of file G4ErrorSurfaceTrajParam.hh.

88{ return fV; }

◆ GetVectorV()

G4Vector3D G4ErrorSurfaceTrajParam::GetVectorV ( ) const
inline

Definition at line 84 of file G4ErrorSurfaceTrajParam.hh.

84{ return fVectorV; }

Referenced by G4ErrorFreeTrajState::G4ErrorFreeTrajState(), and G4ErrorSurfaceTrajState::GetVectorV().

◆ GetVectorW()

G4Vector3D G4ErrorSurfaceTrajParam::GetVectorW ( ) const
inline

Definition at line 85 of file G4ErrorSurfaceTrajParam.hh.

85{ return fVectorW; }

Referenced by G4ErrorFreeTrajState::G4ErrorFreeTrajState(), and G4ErrorSurfaceTrajState::GetVectorW().

◆ GetW()

G4double G4ErrorSurfaceTrajParam::GetW ( ) const
inline

Definition at line 89 of file G4ErrorSurfaceTrajParam.hh.

89{ return fW; }

◆ operator=() [1/2]

G4ErrorSurfaceTrajParam & G4ErrorSurfaceTrajParam::operator= ( const G4ErrorSurfaceTrajParam )
default

◆ operator=() [2/2]

G4ErrorSurfaceTrajParam & G4ErrorSurfaceTrajParam::operator= ( G4ErrorSurfaceTrajParam &&  )
default

◆ SetParameters() [1/2]

void G4ErrorSurfaceTrajParam::SetParameters ( const G4Point3D pos,
const G4Vector3D mom,
const G4Plane3D plane 
)

Definition at line 56 of file G4ErrorSurfaceTrajParam.cc.

59{
60 //--- Get two perpendicular vectors: first parallel X
61 // (unless normal is parallel to X, then take Y)
62
65
66 G4ThreeVector Xvec(1.,0.,0.);
67 G4Vector3D vecV = -Xvec.cross(plane.normal());
68 if( vecV.mag() < kCarTolerance )
69 {
70 G4ThreeVector Zvec(0.,0.,1.);
71 vecV = Zvec.cross(plane.normal());
72 }
73
74 G4Vector3D vecW = plane.normal().cross( vecV );
75
76 SetParameters( pos, mom, vecV, vecW );
77}
const G4double kCarTolerance
double G4double
Definition: G4Types.hh:83
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
Normal3D< T > normal() const
Definition: Plane3D.h:97

◆ SetParameters() [2/2]

void G4ErrorSurfaceTrajParam::SetParameters ( const G4Point3D pos,
const G4Vector3D mom,
const G4Vector3D vecV,
const G4Vector3D vecW 
)

Definition at line 81 of file G4ErrorSurfaceTrajParam.cc.

84{
85 if( mom.mag() > 0. ) {
86 fDir = mom;
87 fDir /= mom.mag();
88 } else {
89 fDir = G4Vector3D(0.,0.,0.);
90 }
91 fVectorV = vecV / vecV.mag();
92 fVectorW = vecW / vecW.mag();
93 fInvP = 1./mom.mag();
94 G4ThreeVector momv(mom);
95 //check 3 vectors are ortogonal and right handed
96
97 // now all 4 scalar memeber variables retain the signs
98 // fPV = momv.project( vecV ).mag();
99 // fPW = momv.project( vecW ).mag();
100 fPV = momv.dot( vecV );
101 fPW = momv.dot( vecW );
102
103
104 G4ThreeVector posv(pos);
105 // fV = posv.project( vecV ).mag();
106 // fW = posv.project( vecW ).mag();
107 fV = posv.dot( vecV );
108 fW = posv.dot( vecW );
109}
HepGeom::Vector3D< G4double > G4Vector3D
Definition: G4Vector3D.hh:34

Referenced by G4ErrorSurfaceTrajParam(), SetParameters(), and G4ErrorSurfaceTrajState::SetParameters().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const G4ErrorSurfaceTrajParam ts 
)
friend

Definition at line 113 of file G4ErrorSurfaceTrajParam.cc.

114{
115 // long mode = out.setf(std::ios::fixed,std::ios::floatfield);
116
117 // out << tp.theType;
118 // out << std::setprecision(5) << std::setw(10);
119 out << " InvP= " << tp.fInvP << " PV= " << tp.fPV
120 << " PW= " << tp.fPW << " V= " << tp.fV << " W= " << tp.fW << G4endl;
121 out << " vectorV direction= " << tp.fVectorV
122 << " vectorW direction= " << tp.fVectorW << G4endl;
123
124 return out;
125}
#define G4endl
Definition: G4ios.hh:57

The documentation for this class was generated from the following files: