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

#include <G4ParticleChangeForTransport.hh>

+ Inheritance diagram for G4ParticleChangeForTransport:

Public Member Functions

 G4ParticleChangeForTransport ()
 
virtual ~G4ParticleChangeForTransport ()
 
virtual G4StepUpdateStepForAlongStep (G4Step *Step)
 
virtual G4StepUpdateStepForAtRest (G4Step *Step)
 
virtual G4StepUpdateStepForPostStep (G4Step *Step)
 
virtual void Initialize (const G4Track &)
 
const G4TouchableHandleGetTouchableHandle () const
 
void SetTouchableHandle (const G4TouchableHandle &fTouchable)
 
G4MaterialGetMaterialInTouchable () const
 
void SetMaterialInTouchable (G4Material *fMaterial)
 
const G4MaterialCutsCoupleGetMaterialCutsCoupleInTouchable () const
 
void SetMaterialCutsCoupleInTouchable (const G4MaterialCutsCouple *fMaterialCutsCouple)
 
G4VSensitiveDetectorGetSensitiveDetectorInTouchable () const
 
void SetSensitiveDetectorInTouchable (G4VSensitiveDetector *fSensitiveDetector)
 
G4bool GetMomentumChanged () const
 
void SetMomentumChanged (G4bool b)
 
void SetPointerToVectorOfAuxiliaryPoints (std::vector< G4ThreeVector > *vec)
 
std::vector< G4ThreeVector > * GetPointerToVectorOfAuxiliaryPoints () const
 
virtual void DumpInfo () const
 
- Public Member Functions inherited from G4ParticleChange
 G4ParticleChange ()
 
virtual ~G4ParticleChange ()
 
G4bool operator== (const G4ParticleChange &right) const
 
G4bool operator!= (const G4ParticleChange &right) const
 
virtual G4StepUpdateStepForAlongStep (G4Step *Step)
 
virtual G4StepUpdateStepForAtRest (G4Step *Step)
 
virtual G4StepUpdateStepForPostStep (G4Step *Step)
 
virtual void Initialize (const G4Track &)
 
const G4ThreeVectorGetMomentumDirection () const
 
void ProposeMomentumDirection (G4double Px, G4double Py, G4double Pz)
 
void ProposeMomentumDirection (const G4ThreeVector &Pfinal)
 
const G4ThreeVectorGetPolarization () const
 
void ProposePolarization (G4double Px, G4double Py, G4double Pz)
 
void ProposePolarization (const G4ThreeVector &finalPoralization)
 
G4double GetEnergy () const
 
void ProposeEnergy (G4double finalEnergy)
 
G4double GetVelocity () const
 
void ProposeVelocity (G4double finalVelocity)
 
G4double GetProperTime () const
 
void ProposeProperTime (G4double finalProperTime)
 
const G4ThreeVectorGetPosition () const
 
void ProposePosition (G4double x, G4double y, G4double z)
 
void ProposePosition (const G4ThreeVector &finalPosition)
 
void ProposeGlobalTime (G4double t)
 
void ProposeLocalTime (G4double t)
 
G4double GetGlobalTime (G4double timeDelay=0.0) const
 
G4double GetLocalTime (G4double timeDelay=0.0) const
 
G4double GetMass () const
 
void ProposeMass (G4double finalMass)
 
G4double GetCharge () const
 
void ProposeCharge (G4double finalCharge)
 
G4double GetMagneticMoment () const
 
void ProposeMagneticMoment (G4double finalMagneticMoment)
 
G4ThreeVector GetGlobalPosition (const G4ThreeVector &displacement) const
 
G4ThreeVector CalcMomentum (G4double energy, G4ThreeVector direction, G4double mass) const
 
void AddSecondary (G4Track *aSecondary)
 
void AddSecondary (G4DynamicParticle *aSecondary, G4bool IsGoodForTracking=false)
 
void AddSecondary (G4DynamicParticle *aSecondary, G4ThreeVector position, G4bool IsGoodForTracking=false)
 
void AddSecondary (G4DynamicParticle *aSecondary, G4double time, G4bool IsGoodForTracking=false)
 
virtual void DumpInfo () const
 
virtual G4bool CheckIt (const G4Track &)
 
- Public Member Functions inherited from G4VParticleChange
 G4VParticleChange ()
 
virtual ~G4VParticleChange ()
 
G4bool operator== (const G4VParticleChange &right) const
 
G4bool operator!= (const G4VParticleChange &right) const
 
virtual G4StepUpdateStepForAtRest (G4Step *Step)
 
virtual G4StepUpdateStepForAlongStep (G4Step *Step)
 
virtual G4StepUpdateStepForPostStep (G4Step *Step)
 
virtual void Initialize (const G4Track &)
 
G4double GetTrueStepLength () const
 
void ProposeTrueStepLength (G4double truePathLength)
 
G4double GetLocalEnergyDeposit () const
 
void ProposeLocalEnergyDeposit (G4double anEnergyPart)
 
G4double GetNonIonizingEnergyDeposit () const
 
void ProposeNonIonizingEnergyDeposit (G4double anEnergyPart)
 
G4TrackStatus GetTrackStatus () const
 
void ProposeTrackStatus (G4TrackStatus status)
 
G4SteppingControl GetSteppingControl () const
 
void ProposeSteppingControl (G4SteppingControl StepControlFlag)
 
G4bool GetFirstStepInVolume () const
 
G4bool GetLastStepInVolume () const
 
void ProposeFirstStepInVolume (G4bool flag)
 
void ProposeLastStepInVolume (G4bool flag)
 
void Clear ()
 
void SetNumberOfSecondaries (G4int totSecondaries)
 
G4int GetNumberOfSecondaries () const
 
G4TrackGetSecondary (G4int anIndex) const
 
void AddSecondary (G4Track *aSecondary)
 
G4double GetWeight () const
 
G4double GetParentWeight () const
 
void ProposeWeight (G4double finalWeight)
 
void ProposeParentWeight (G4double finalWeight)
 
void SetSecondaryWeightByProcess (G4bool)
 
G4bool IsSecondaryWeightSetByProcess () const
 
void SetParentWeightByProcess (G4bool)
 
G4bool IsParentWeightSetByProcess () const
 
virtual void DumpInfo () const
 
void SetVerboseLevel (G4int vLevel)
 
G4int GetVerboseLevel () const
 
virtual G4bool CheckIt (const G4Track &)
 
void ClearDebugFlag ()
 
void SetDebugFlag ()
 
G4bool GetDebugFlag () const
 

Protected Member Functions

 G4ParticleChangeForTransport (const G4ParticleChangeForTransport &right)
 
G4ParticleChangeForTransportoperator= (const G4ParticleChangeForTransport &right)
 
- Protected Member Functions inherited from G4ParticleChange
 G4ParticleChange (const G4ParticleChange &right)
 
G4ParticleChangeoperator= (const G4ParticleChange &right)
 
G4StepUpdateStepInfo (G4Step *Step)
 
- Protected Member Functions inherited from G4VParticleChange
 G4VParticleChange (const G4VParticleChange &right)
 
G4VParticleChangeoperator= (const G4VParticleChange &right)
 
G4StepUpdateStepInfo (G4Step *Step)
 
void InitializeTrueStepLength (const G4Track &)
 
void InitializeLocalEnergyDeposit (const G4Track &)
 
void InitializeSteppingControl (const G4Track &)
 
void InitializeParentWeight (const G4Track &)
 
void InitializeParentGlobalTime (const G4Track &)
 
void InitializeStatusChange (const G4Track &)
 
void InitializeSecondaries (const G4Track &)
 
void InitializeStepInVolumeFlags (const G4Track &)
 
G4bool CheckSecondary (G4Track &)
 
G4double GetAccuracyForWarning () const
 
G4double GetAccuracyForException () const
 

Protected Attributes

G4TouchableHandle theTouchableHandle
 
- Protected Attributes inherited from G4ParticleChange
G4ThreeVector theMomentumDirectionChange
 
G4ThreeVector thePolarizationChange
 
G4double theEnergyChange = 0.0
 
G4double theVelocityChange = 0.0
 
G4bool isVelocityChanged = false
 
G4ThreeVector thePositionChange
 
G4double theGlobalTime0 = 0.0
 
G4double theLocalTime0 = 0.0
 
G4double theTimeChange = 0.0
 
G4double theProperTimeChange = 0.0
 
G4double theMassChange = 0.0
 
G4double theChargeChange = 0.0
 
G4double theMagneticMomentChange = 0.0
 
const G4TracktheCurrentTrack = nullptr
 
- Protected Attributes inherited from G4VParticleChange
G4TrackFastVectortheListOfSecondaries = nullptr
 
G4TrackStatus theStatusChange = fAlive
 
G4SteppingControl theSteppingControlFlag = NormalCondition
 
G4double theLocalEnergyDeposit = 0.0
 
G4double theNonIonizingEnergyDeposit = 0.0
 
G4double theTrueStepLength = 0.0
 
G4double theParentWeight = 1.0
 
G4double theParentGlobalTime = 0.0
 
G4int theNumberOfSecondaries = 0
 
G4int theSizeOftheListOfSecondaries = 0
 
G4int verboseLevel = 1
 
G4bool theFirstStepInVolume = false
 
G4bool theLastStepInVolume = false
 
G4bool isParentWeightProposed = false
 
G4bool fSetSecondaryWeightByProcess = false
 
G4bool debugFlag = false
 

Additional Inherited Members

- Static Protected Attributes inherited from G4VParticleChange
static const G4double accuracyForWarning = 1.0e-9
 
static const G4double accuracyForException = 0.001
 

Detailed Description

Definition at line 45 of file G4ParticleChangeForTransport.hh.

Constructor & Destructor Documentation

◆ G4ParticleChangeForTransport() [1/2]

G4ParticleChangeForTransport::G4ParticleChangeForTransport ( )

Definition at line 39 of file G4ParticleChangeForTransport.cc.

41{
42}

◆ ~G4ParticleChangeForTransport()

G4ParticleChangeForTransport::~G4ParticleChangeForTransport ( )
virtual

Definition at line 45 of file G4ParticleChangeForTransport.cc.

46{
47}

◆ G4ParticleChangeForTransport() [2/2]

G4ParticleChangeForTransport::G4ParticleChangeForTransport ( const G4ParticleChangeForTransport right)
protected

Definition at line 50 of file G4ParticleChangeForTransport.cc.

53{
54 theTouchableHandle = r.theTouchableHandle;
55 isMomentumChanged = r.isMomentumChanged;
56 theMaterialChange = r.theMaterialChange;
57 theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange;
58 theSensitiveDetectorChange = r.theSensitiveDetectorChange;
59}

Member Function Documentation

◆ DumpInfo()

void G4ParticleChangeForTransport::DumpInfo ( ) const
virtual

Reimplemented from G4ParticleChange.

Definition at line 222 of file G4ParticleChangeForTransport.cc.

223{
224 // use base-class DumpInfo
226
227 G4int oldprc = G4cout.precision(3);
228 G4cout << " Touchable (pointer) : " << std::setw(20)
230 G4cout.precision(oldprc);
231}
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
virtual void DumpInfo() const

◆ GetMaterialCutsCoupleInTouchable()

const G4MaterialCutsCouple * G4ParticleChangeForTransport::GetMaterialCutsCoupleInTouchable ( ) const

◆ GetMaterialInTouchable()

G4Material * G4ParticleChangeForTransport::GetMaterialInTouchable ( ) const

◆ GetMomentumChanged()

G4bool G4ParticleChangeForTransport::GetMomentumChanged ( ) const

◆ GetPointerToVectorOfAuxiliaryPoints()

std::vector< G4ThreeVector > * G4ParticleChangeForTransport::GetPointerToVectorOfAuxiliaryPoints ( ) const
inline

◆ GetSensitiveDetectorInTouchable()

G4VSensitiveDetector * G4ParticleChangeForTransport::GetSensitiveDetectorInTouchable ( ) const

◆ GetTouchableHandle()

const G4TouchableHandle & G4ParticleChangeForTransport::GetTouchableHandle ( ) const

◆ Initialize()

virtual void G4ParticleChangeForTransport::Initialize ( const G4Track )
virtual

◆ operator=()

G4ParticleChangeForTransport & G4ParticleChangeForTransport::operator= ( const G4ParticleChangeForTransport right)
protected

Definition at line 63 of file G4ParticleChangeForTransport.cc.

64{
65 if(this != &r)
66 {
67 theListOfSecondaries = r.theListOfSecondaries;
68 theSizeOftheListOfSecondaries = r.theSizeOftheListOfSecondaries;
69 theNumberOfSecondaries = r.theNumberOfSecondaries;
70 theStatusChange = r.theStatusChange;
71 theTouchableHandle = r.theTouchableHandle;
72 theMaterialChange = r.theMaterialChange;
73 theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange;
74 theSensitiveDetectorChange = r.theSensitiveDetectorChange;
75 theMomentumDirectionChange = r.theMomentumDirectionChange;
76 thePolarizationChange = r.thePolarizationChange;
77 thePositionChange = r.thePositionChange;
78 theTimeChange = r.theTimeChange;
79 theEnergyChange = r.theEnergyChange;
80 theVelocityChange = r.theVelocityChange;
81 theTrueStepLength = r.theTrueStepLength;
82 theLocalEnergyDeposit = r.theLocalEnergyDeposit;
83 theSteppingControlFlag = r.theSteppingControlFlag;
84 }
85 return *this;
86}
G4ThreeVector thePositionChange
G4ThreeVector theMomentumDirectionChange
G4ThreeVector thePolarizationChange
G4TrackStatus theStatusChange
G4TrackFastVector * theListOfSecondaries
G4SteppingControl theSteppingControlFlag

◆ SetMaterialCutsCoupleInTouchable()

void G4ParticleChangeForTransport::SetMaterialCutsCoupleInTouchable ( const G4MaterialCutsCouple fMaterialCutsCouple)

◆ SetMaterialInTouchable()

void G4ParticleChangeForTransport::SetMaterialInTouchable ( G4Material fMaterial)

◆ SetMomentumChanged()

◆ SetPointerToVectorOfAuxiliaryPoints()

void G4ParticleChangeForTransport::SetPointerToVectorOfAuxiliaryPoints ( std::vector< G4ThreeVector > *  vec)
inline

◆ SetSensitiveDetectorInTouchable()

void G4ParticleChangeForTransport::SetSensitiveDetectorInTouchable ( G4VSensitiveDetector fSensitiveDetector)

◆ SetTouchableHandle()

void G4ParticleChangeForTransport::SetTouchableHandle ( const G4TouchableHandle fTouchable)

◆ UpdateStepForAlongStep()

G4Step * G4ParticleChangeForTransport::UpdateStepForAlongStep ( G4Step Step)
virtual

Reimplemented from G4ParticleChange.

Definition at line 96 of file G4ParticleChangeForTransport.cc.

97{
98 // Smooth curved tajectory representation: let the Step know about
99 // the auxiliary trajectory points (jacek 30/10/2002)
100 pStep->SetPointerToVectorOfAuxiliaryPoints(fpVectorOfAuxiliaryPointsPointer);
101
102 // copy of G4ParticleChange::UpdateStepForAlongStep
103 // i.e. no effect for touchable
104
105 // A physics process always calculates the final state of the
106 // particle relative to the initial state at the beginning
107 // of the Step, i.e., based on information of G4Track (or
108 // equivalently the PreStepPoint).
109 // So, the differences (delta) between these two states have to be
110 // calculated and be accumulated in PostStepPoint.
111
112 // Take note that the return type of GetMomentumChange is a
113 // pointer to G4ThreeVector. Also it is a normalized
114 // momentum vector.
115
116 G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
117 G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
118 G4Track* aTrack = pStep->GetTrack();
119 G4double mass = aTrack->GetDynamicParticle()->GetMass();
120
121 // update kinetic energy
122 // now assume that no energy change in transportation
123 // However it is not true in electric fields
124 // Case for changing energy will be implemented in future
125
126 // update momentum direction and energy
127 if(isMomentumChanged)
128 {
130 energy = pPostStepPoint->GetKineticEnergy() +
131 (theEnergyChange - pPreStepPoint->GetKineticEnergy());
132
133 // calculate new momentum
134 G4ThreeVector pMomentum =
135 pPostStepPoint->GetMomentum() +
137 pPreStepPoint->GetMomentum());
138 G4double tMomentum = pMomentum.mag();
139 G4ThreeVector direction(1.0, 0.0, 0.0);
140 if(tMomentum > 0.)
141 {
142 G4double inv_Momentum = 1.0 / tMomentum;
143 direction = pMomentum * inv_Momentum;
144 }
145 pPostStepPoint->SetMomentumDirection(direction);
146 pPostStepPoint->SetKineticEnergy(energy);
147 }
149 pPostStepPoint->SetVelocity(theVelocityChange);
150
151 // stop case should not occur
152 // pPostStepPoint->SetMomentumDirection(G4ThreeVector(1., 0., 0.));
153
154 // update polarization
155 pPostStepPoint->AddPolarization(thePolarizationChange -
156 pPreStepPoint->GetPolarization());
157
158 // update position and time
159 pPostStepPoint->AddPosition(thePositionChange - pPreStepPoint->GetPosition());
160 pPostStepPoint->AddGlobalTime(theTimeChange - pPreStepPoint->GetLocalTime());
161 pPostStepPoint->AddLocalTime(theTimeChange - pPreStepPoint->GetLocalTime());
162 pPostStepPoint->AddProperTime(theProperTimeChange -
163 pPreStepPoint->GetProperTime());
164
165#ifdef G4VERBOSE
166 if(debugFlag) { CheckIt(*aTrack); }
167#endif
168
169 // Update the G4Step specific attributes
170 // pStep->SetStepLength( theTrueStepLength );
171 // pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
172 pStep->SetControlFlag(theSteppingControlFlag);
173
174 return pStep;
175}
double G4double
Definition: G4Types.hh:83
double mag() const
G4double GetMass() const
G4ThreeVector CalcMomentum(G4double energy, G4ThreeVector direction, G4double mass) const
G4double theProperTimeChange
virtual G4bool CheckIt(const G4Track &)
void AddPolarization(const G4ThreeVector &aValue)
void SetKineticEnergy(const G4double aValue)
G4double GetProperTime() const
void AddProperTime(const G4double aValue)
void SetVelocity(G4double v)
void AddPosition(const G4ThreeVector &aValue)
G4ThreeVector GetMomentum() const
const G4ThreeVector & GetPosition() const
void AddGlobalTime(const G4double aValue)
G4double GetLocalTime() const
const G4ThreeVector & GetPolarization() const
G4double GetKineticEnergy() const
void AddLocalTime(const G4double aValue)
void SetMomentumDirection(const G4ThreeVector &aValue)
const G4DynamicParticle * GetDynamicParticle() const
G4double energy(const ThreeVector &p, const G4double m)

◆ UpdateStepForAtRest()

G4Step * G4ParticleChangeForTransport::UpdateStepForAtRest ( G4Step Step)
virtual

Reimplemented from G4ParticleChange.

Definition at line 89 of file G4ParticleChangeForTransport.cc.

90{
91 // Update the G4Step specific attributes
92 return UpdateStepInfo(pStep);
93}
G4Step * UpdateStepInfo(G4Step *Step)

◆ UpdateStepForPostStep()

G4Step * G4ParticleChangeForTransport::UpdateStepForPostStep ( G4Step Step)
virtual

Reimplemented from G4ParticleChange.

Definition at line 178 of file G4ParticleChangeForTransport.cc.

179{
180 // A physics process always calculates the final state of the particle
181
182 // Change volume only if some kinetic energy remains
183 G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
184 if(pPostStepPoint->GetKineticEnergy() > 0.0)
185 {
186 // update next touchable
187 // (touchable can be changed only at PostStepDoIt)
188 pPostStepPoint->SetTouchableHandle(theTouchableHandle);
189
190 pPostStepPoint->SetMaterial(theMaterialChange);
191 pPostStepPoint->SetMaterialCutsCouple(theMaterialCutsCoupleChange);
192 pPostStepPoint->SetSensitiveDetector(theSensitiveDetectorChange);
193 }
194 if(this->GetFirstStepInVolume())
195 {
196 pStep->SetFirstStepFlag();
197 }
198 else
199 {
200 pStep->ClearFirstStepFlag();
201 }
202 if(this->GetLastStepInVolume())
203 {
204 pStep->SetLastStepFlag();
205 }
206 else
207 {
208 pStep->ClearLastStepFlag();
209 }
210 // It used to call base class's method
211 // - but this would copy uninitialised data members
212 // return G4ParticleChange::UpdateStepForPostStep(pStep);
213
214 // Copying what the base class does would instead
215 // - also not useful
216 // return G4VParticleChange::UpdateStepInfo(pStep);
217
218 return pStep;
219}
void SetSensitiveDetector(G4VSensitiveDetector *)
void SetMaterial(G4Material *)
void SetTouchableHandle(const G4TouchableHandle &apValue)
void SetMaterialCutsCouple(const G4MaterialCutsCouple *)
G4bool GetFirstStepInVolume() const
G4bool GetLastStepInVolume() const

Member Data Documentation

◆ theTouchableHandle

G4TouchableHandle G4ParticleChangeForTransport::theTouchableHandle
protected

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