Geant4-11
Public Member Functions | Protected Attributes | Friends
G4ErrorTrajState Class Referenceabstract

#include <G4ErrorTrajState.hh>

Inheritance diagram for G4ErrorTrajState:
G4ErrorFreeTrajState G4ErrorSurfaceTrajState

Public Member Functions

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

Protected Attributes

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

Friends

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

Detailed Description

Definition at line 52 of file G4ErrorTrajState.hh.

Constructor & Destructor Documentation

◆ G4ErrorTrajState() [1/4]

G4ErrorTrajState::G4ErrorTrajState ( )
inline

Definition at line 55 of file G4ErrorTrajState.hh.

56 : fCharge(0.)
57 , theG4Track(0)
58 , iverbose(0)
59 {}

◆ 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.

43 : fParticleType(partType)
44 , fPosition(pos)
45 , fMomentum(mom)
46 , fError(errmat)
48{
50}
static const G4double pos
@ G4eTS_FREE
G4ErrorTrajErr fError

References iverbose, and G4ErrorPropagatorData::verbose().

◆ G4ErrorTrajState() [3/4]

G4ErrorTrajState::G4ErrorTrajState ( const G4ErrorTrajState ts)

◆ G4ErrorTrajState() [4/4]

G4ErrorTrajState::G4ErrorTrajState ( G4ErrorTrajState &&  ts)

Definition at line 56 of file G4ErrorTrajState.cc.

57 : fParticleType(ts.fParticleType)
58 , fPosition(ts.fPosition)
59 , fMomentum(ts.fMomentum)
60 , fCharge(ts.fCharge)
61 , fError(ts.fError)
62 , theTSType(ts.theTSType)
63 , theG4Track(ts.theG4Track)
64 , iverbose(ts.iverbose)
65{
66 // Release data from source object
67 ts.theG4Track = nullptr;
68}

References geant4_check_module_cycles::ts.

◆ ~G4ErrorTrajState()

virtual G4ErrorTrajState::~G4ErrorTrajState ( )
inlinevirtual

Definition at line 70 of file G4ErrorTrajState.hh.

70{}

Member Function Documentation

◆ BuildCharge()

void G4ErrorTrajState::BuildCharge ( )

Definition at line 138 of file G4ErrorTrajState.cc.

139{
141 G4ParticleDefinition* particle = particleTable->FindParticle(fParticleType);
142 if(particle == nullptr)
143 {
144 std::ostringstream message;
145 message << "Particle type not defined: " << fParticleType;
146 G4Exception("G4ErrorTrajState::BuildCharge()", "GEANT4e-error",
147 FatalException, message);
148 }
149 else
150 {
151 fCharge = particle->GetPDGCharge();
152 }
153}
@ 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()

References FatalException, fCharge, G4ParticleTable::FindParticle(), fParticleType, G4Exception(), G4ParticleTable::GetParticleTable(), and G4ParticleDefinition::GetPDGCharge().

Referenced by G4ErrorFreeTrajState::Init(), G4ErrorSurfaceTrajState::Init(), and 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 156 of file G4ErrorTrajState.cc.

157{
158 out << *this;
159}

◆ GetCharge()

G4double G4ErrorTrajState::GetCharge ( ) const
inline

Definition at line 117 of file G4ErrorTrajState.hh.

117{ return fCharge; }

References fCharge.

◆ GetError()

G4ErrorTrajErr G4ErrorTrajState::GetError ( ) const
inline

Definition at line 111 of file G4ErrorTrajState.hh.

111{ return fError; }

References fError.

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

◆ GetG4Track()

G4Track * G4ErrorTrajState::GetG4Track ( ) const
inline

Definition at line 114 of file G4ErrorTrajState.hh.

114{ return theG4Track; }

References theG4Track.

◆ GetMomentum()

G4Vector3D G4ErrorTrajState::GetMomentum ( ) const
inline

◆ GetParticleType()

const G4String & G4ErrorTrajState::GetParticleType ( ) const
inline

◆ GetPosition()

G4Point3D G4ErrorTrajState::GetPosition ( ) const
inline

Definition at line 105 of file G4ErrorTrajState.hh.

105{ return fPosition; }

References 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 {
75 fParticleType = ts.fParticleType;
76 fPosition = ts.fPosition;
77 fMomentum = ts.fMomentum;
78 fCharge = ts.fCharge;
79 fError = ts.fError;
80 theTSType = ts.theTSType;
81 iverbose = ts.iverbose;
82 delete theG4Track;
83 theG4Track = new G4Track(*ts.theG4Track);
84 }
85 return *this;
86}

References fCharge, fError, fMomentum, fParticleType, fPosition, iverbose, theG4Track, theTSType, and geant4_check_module_cycles::ts.

◆ operator=() [2/2]

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

Definition at line 89 of file G4ErrorTrajState.cc.

90{
91 if(this != &ts)
92 {
93 fParticleType = ts.fParticleType;
94 fPosition = ts.fPosition;
95 fMomentum = ts.fMomentum;
96 fCharge = ts.fCharge;
97 fError = ts.fError;
98 theTSType = ts.theTSType;
99 iverbose = ts.iverbose;
100 delete theG4Track;
101 theG4Track = ts.theG4Track;
102
103 // Release data from source object
104 ts.theG4Track = nullptr;
105 }
106 return *this;
107}

References fCharge, fError, fMomentum, fParticleType, fPosition, iverbose, theG4Track, theTSType, and geant4_check_module_cycles::ts.

◆ PropagateError()

G4int G4ErrorTrajState::PropagateError ( const G4Track )
virtual

Reimplemented in G4ErrorFreeTrajState.

Definition at line 110 of file G4ErrorTrajState.cc.

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

References FatalException, G4endl, G4Exception(), and GetTSType().

◆ SetCharge()

void G4ErrorTrajState::SetCharge ( G4double  ch)
inline

Definition at line 118 of file G4ErrorTrajState.hh.

118{ fCharge = ch; }

References fCharge.

◆ SetData()

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

Definition at line 128 of file G4ErrorTrajState.cc.

130{
131 fParticleType = partType;
132 BuildCharge();
133 fPosition = pos;
134 fMomentum = mom;
135}

References BuildCharge(), fMomentum, fParticleType, fPosition, and pos.

◆ SetError()

virtual void G4ErrorTrajState::SetError ( G4ErrorTrajErr  em)
inlinevirtual

Definition at line 112 of file G4ErrorTrajState.hh.

112{ fError = em; }

References fError.

◆ SetG4Track()

void G4ErrorTrajState::SetG4Track ( G4Track trk)
inline

Definition at line 115 of file G4ErrorTrajState.hh.

115{ theG4Track = trk; }

References theG4Track.

Referenced by G4ErrorPropagator::InitG4Track().

◆ SetMomentum()

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

Reimplemented in G4ErrorFreeTrajState, and G4ErrorSurfaceTrajState.

Definition at line 109 of file G4ErrorTrajState.hh.

109{ fMomentum = mom; }

References fMomentum.

◆ SetParticleType()

void G4ErrorTrajState::SetParticleType ( const G4String partType)
inline

Definition at line 103 of file G4ErrorTrajState.hh.

103{ fParticleType = partType; }

References fParticleType.

◆ SetPosition()

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

Reimplemented in G4ErrorFreeTrajState, and G4ErrorSurfaceTrajState.

Definition at line 106 of file G4ErrorTrajState.hh.

106{ fPosition = pos; }

References fPosition, and pos.

◆ Update()

virtual G4int G4ErrorTrajState::Update ( const G4Track )
inlinevirtual

Reimplemented in G4ErrorFreeTrajState.

Definition at line 88 of file G4ErrorTrajState.hh.

88{ return -1; }

◆ UpdatePosMom()

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

Definition at line 121 of file G4ErrorTrajState.cc.

122{
123 fPosition = pos;
124 fMomentum = mom;
125}

References fMomentum, fPosition, and pos.

Referenced by G4ErrorFreeTrajState::Update().

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 162 of file G4ErrorTrajState.cc.

163{
164 // long mode = out.setf(std::ios::fixed,std::ios::floatfield);
165 out << " G4ErrorTrajState of type " << ts.theTSType
166 << " : partycle: " << ts.fParticleType << " position: " << std::setw(6)
167 << ts.fPosition << " momentum: " << ts.fMomentum
168 << " error matrix ";
169 G4cout << ts.fError << G4endl;
170
171 return out;
172}
G4GLOB_DLL std::ostream G4cout

Field Documentation

◆ fCharge

G4double G4ErrorTrajState::fCharge = 0.
protected

◆ fError

G4ErrorTrajErr G4ErrorTrajState::fError
protected

◆ fMomentum

G4Vector3D G4ErrorTrajState::fMomentum
protected

◆ fParticleType

G4String G4ErrorTrajState::fParticleType
protected

◆ fPosition

G4Point3D G4ErrorTrajState::fPosition
protected

◆ iverbose

G4int G4ErrorTrajState::iverbose = 0
protected

◆ theG4Track

G4Track* G4ErrorTrajState::theG4Track = nullptr
protected

Definition at line 131 of file G4ErrorTrajState.hh.

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

◆ theTSType

G4eTSType G4ErrorTrajState::theTSType
protected

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