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

#include <G4ErrorTrajState.hh>

+ Inheritance diagram for G4ErrorTrajState:

Public Member Functions

 G4ErrorTrajState ()
 
 G4ErrorTrajState (const G4String &partType, const G4Point3D &pos, const G4Vector3D &mom, const G4ErrorTrajErr &errmat=G4ErrorTrajErr(5, 0))
 
 G4ErrorTrajState (const G4ErrorTrajState &)
 
 G4ErrorTrajState (G4ErrorTrajState &&)
 
virtual ~G4ErrorTrajState ()
 
G4ErrorTrajStateoperator= (const G4ErrorTrajState &)
 
G4ErrorTrajStateoperator= (G4ErrorTrajState &&)
 
void SetData (const G4String &partType, const G4Point3D &pos, const G4Vector3D &mom)
 
void BuildCharge ()
 
virtual G4int PropagateError (const G4Track *)
 
virtual G4int Update (const G4Track *)
 
void UpdatePosMom (const G4Point3D &pos, const G4Vector3D &mom)
 
void DumpPosMomError (std::ostream &out=G4cout) const
 
virtual void Dump (std::ostream &out=G4cout) const =0
 
const G4StringGetParticleType () const
 
void SetParticleType (const G4String &partType)
 
G4Point3D GetPosition () const
 
virtual void SetPosition (const G4Point3D pos)
 
G4Vector3D GetMomentum () const
 
virtual void SetMomentum (const G4Vector3D &mom)
 
G4ErrorTrajErr GetError () const
 
virtual void SetError (G4ErrorTrajErr em)
 
G4TrackGetG4Track () const
 
void SetG4Track (G4Track *trk)
 
G4double GetCharge () const
 
void SetCharge (G4double ch)
 
virtual G4eTSType GetTSType () const
 

Protected Attributes

G4String fParticleType
 
G4Point3D fPosition
 
G4Vector3D fMomentum
 
G4double fCharge = 0.
 
G4ErrorTrajErr fError
 
G4eTSType theTSType
 
G4TracktheG4Track = nullptr
 
G4int iverbose = 0
 

Friends

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

Detailed Description

Definition at line 48 of file G4ErrorTrajState.hh.

Constructor & Destructor Documentation

◆ G4ErrorTrajState() [1/4]

G4ErrorTrajState::G4ErrorTrajState ( )
inline

Definition at line 52 of file G4ErrorTrajState.hh.

◆ G4ErrorTrajState() [2/4]

G4ErrorTrajState::G4ErrorTrajState ( const G4String partType,
const G4Point3D pos,
const G4Vector3D mom,
const G4ErrorTrajErr errmat = G4ErrorTrajErr(5,0) 
)

Definition at line 40 of file G4ErrorTrajState.cc.

44 : fParticleType(partType), fPosition(pos), fMomentum(mom),
46{
48}
@ G4eTS_FREE
G4ErrorTrajErr fError

◆ G4ErrorTrajState() [3/4]

G4ErrorTrajState::G4ErrorTrajState ( const G4ErrorTrajState ts)

Definition at line 52 of file G4ErrorTrajState.cc.

53{
54 *this = ts;
55}

◆ G4ErrorTrajState() [4/4]

G4ErrorTrajState::G4ErrorTrajState ( G4ErrorTrajState &&  ts)

Definition at line 59 of file G4ErrorTrajState.cc.

64{
65 // Release data from source object
66 ts.theG4Track = nullptr;
67}

◆ ~G4ErrorTrajState()

virtual G4ErrorTrajState::~G4ErrorTrajState ( )
inlinevirtual

Definition at line 63 of file G4ErrorTrajState.hh.

63{}

Member Function Documentation

◆ BuildCharge()

void G4ErrorTrajState::BuildCharge ( )

Definition at line 144 of file G4ErrorTrajState.cc.

145{
147 G4ParticleDefinition* particle = particleTable->FindParticle(fParticleType);
148 if( particle == nullptr )
149 {
150 std::ostringstream message;
151 message << "Particle type not defined: " << fParticleType;
152 G4Exception( "G4ErrorTrajState::BuildCharge()", "GEANT4e-error",
153 FatalException, message);
154 }
155 else
156 {
157 fCharge = particle->GetPDGCharge();
158 }
159}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
G4double GetPDGCharge() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()

Referenced by SetData().

◆ Dump()

virtual void G4ErrorTrajState::Dump ( std::ostream &  out = G4cout) const
pure virtual

◆ DumpPosMomError()

void G4ErrorTrajState::DumpPosMomError ( std::ostream &  out = G4cout) const

Definition at line 163 of file G4ErrorTrajState.cc.

164{
165 out << *this;
166}

◆ GetCharge()

G4double G4ErrorTrajState::GetCharge ( ) const
inline

Definition at line 121 of file G4ErrorTrajState.hh.

122 { return fCharge; }

◆ GetError()

G4ErrorTrajErr G4ErrorTrajState::GetError ( ) const
inline

◆ GetG4Track()

G4Track * G4ErrorTrajState::GetG4Track ( ) const
inline

Definition at line 116 of file G4ErrorTrajState.hh.

117 { return theG4Track; }

◆ GetMomentum()

G4Vector3D G4ErrorTrajState::GetMomentum ( ) const
inline

◆ GetParticleType()

const G4String & G4ErrorTrajState::GetParticleType ( ) const
inline

◆ GetPosition()

G4Point3D G4ErrorTrajState::GetPosition ( ) const
inline

Definition at line 101 of file G4ErrorTrajState.hh.

102 { return fPosition; }

Referenced by G4ErrorPropagator::GetFinalTrajState(), and G4ErrorPropagator::InitG4Track().

◆ GetTSType()

virtual G4eTSType G4ErrorTrajState::GetTSType ( ) const
inlinevirtual

◆ operator=() [1/2]

G4ErrorTrajState & G4ErrorTrajState::operator= ( const G4ErrorTrajState ts)

Definition at line 71 of file G4ErrorTrajState.cc.

72{
73 if(this != &ts)
74 {
78 fCharge = ts.fCharge;
79 fError = ts.fError;
81 iverbose = ts.iverbose;
82 delete theG4Track;
83 theG4Track = new G4Track(*ts.theG4Track);
84 }
85 return *this;
86}

◆ operator=() [2/2]

G4ErrorTrajState & G4ErrorTrajState::operator= ( G4ErrorTrajState &&  ts)

Definition at line 90 of file G4ErrorTrajState.cc.

91{
92 if(this != &ts)
93 {
97 fCharge = ts.fCharge;
98 fError = ts.fError;
100 iverbose = ts.iverbose;
101 delete theG4Track;
103
104 // Release data from source object
105 ts.theG4Track = nullptr;
106 }
107 return *this;
108}

◆ PropagateError()

G4int G4ErrorTrajState::PropagateError ( const G4Track )
virtual

Reimplemented in G4ErrorFreeTrajState.

Definition at line 112 of file G4ErrorTrajState.cc.

113{
114 std::ostringstream message;
115 message << "Wrong trajectory state type !" << G4endl
116 << "Called for trajectory state type: " << G4int(GetTSType());
117 G4Exception("G4ErrorTrajState::PropagateError()", "GEANT4e-Error",
118 FatalException, message);
119 return -1;
120}
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
virtual G4eTSType GetTSType() const

◆ SetCharge()

void G4ErrorTrajState::SetCharge ( G4double  ch)
inline

Definition at line 123 of file G4ErrorTrajState.hh.

124 { fCharge = ch; }

◆ SetData()

void G4ErrorTrajState::SetData ( const G4String partType,
const G4Point3D pos,
const G4Vector3D mom 
)

Definition at line 133 of file G4ErrorTrajState.cc.

135{
136 fParticleType = partType;
137 BuildCharge();
138 fPosition = pos;
139 fMomentum = mom;
140}

◆ SetError()

virtual void G4ErrorTrajState::SetError ( G4ErrorTrajErr  em)
inlinevirtual

Definition at line 113 of file G4ErrorTrajState.hh.

114 { fError = em; }

◆ SetG4Track()

void G4ErrorTrajState::SetG4Track ( G4Track trk)
inline

Definition at line 118 of file G4ErrorTrajState.hh.

119 { theG4Track = trk; }

Referenced by G4ErrorPropagator::InitG4Track().

◆ SetMomentum()

virtual void G4ErrorTrajState::SetMomentum ( const G4Vector3D mom)
inlinevirtual

Reimplemented in G4ErrorFreeTrajState, and G4ErrorSurfaceTrajState.

Definition at line 108 of file G4ErrorTrajState.hh.

109 { fMomentum = mom; }

◆ SetParticleType()

void G4ErrorTrajState::SetParticleType ( const G4String partType)
inline

Definition at line 98 of file G4ErrorTrajState.hh.

99 { fParticleType = partType;}

◆ SetPosition()

virtual void G4ErrorTrajState::SetPosition ( const G4Point3D  pos)
inlinevirtual

Reimplemented in G4ErrorFreeTrajState, and G4ErrorSurfaceTrajState.

Definition at line 103 of file G4ErrorTrajState.hh.

104 { fPosition = pos; }

◆ Update()

virtual G4int G4ErrorTrajState::Update ( const G4Track )
inlinevirtual

Reimplemented in G4ErrorFreeTrajState.

Definition at line 82 of file G4ErrorTrajState.hh.

82{ return -1; }

◆ UpdatePosMom()

void G4ErrorTrajState::UpdatePosMom ( const G4Point3D pos,
const G4Vector3D mom 
)

Definition at line 124 of file G4ErrorTrajState.cc.

126{
127 fPosition = pos;
128 fMomentum = mom;
129}

Referenced by G4ErrorFreeTrajState::Update().

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 170 of file G4ErrorTrajState.cc.

171{
172 // long mode = out.setf(std::ios::fixed,std::ios::floatfield);
173 out
174 << " G4ErrorTrajState of type " << ts.theTSType << " : partycle: "
175 << ts.fParticleType << " position: " << std::setw(6) << ts.fPosition
176 << " momentum: " << ts.fMomentum
177 << " error matrix ";
178 G4cout << ts.fError << G4endl;
179
180 return out;
181}
G4GLOB_DLL std::ostream G4cout

Member Data Documentation

◆ fCharge

◆ fError

◆ fMomentum

◆ fParticleType

G4String G4ErrorTrajState::fParticleType
protected

◆ fPosition

◆ iverbose

◆ theG4Track

G4Track* G4ErrorTrajState::theG4Track = nullptr
protected

Definition at line 139 of file G4ErrorTrajState.hh.

Referenced by GetG4Track(), operator=(), and SetG4Track().

◆ theTSType

G4eTSType G4ErrorTrajState::theTSType
protected

Definition at line 137 of file G4ErrorTrajState.hh.

Referenced by GetTSType(), and operator=().


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