The steps in time are not exact, as Geant4 inherently limits steps in space, not time. This class assumes the velocity of the track does not change during the step. This is approximate, but for a 50 MeV/c mu+ in a 20 MegaVolt/meter electric field, it is accurate to 4 ps for steps of 1 ns; for a 200 MeV/c mu+ it is accurate to 0.5 ps for steps of 1 ns. For better timing accuracy, use smaller steps. Obviously the accuracy will be better for tracks with beta near 1. Due to the algorithm used, these timing errors do NOT accumulate.
Public Member Functions | |
TStepLimiter () | |
virtual | ~TStepLimiter () |
G4VProcess * | clone () |
virtual G4bool | IsApplicable (const G4ParticleDefinition &) |
virtual G4double | AlongStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection) |
virtual G4VParticleChange * | AlongStepDoIt (const G4Track &track, const G4Step &stepData) |
virtual G4double | AtRestGetPhysicalInteractionLength (const G4Track &track, G4ForceCondition *condition) |
virtual G4double | PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) |
virtual G4VParticleChange * | PostStepDoIt (const G4Track &track, const G4Step &aStep) |
virtual G4VParticleChange * | AtRestDoIt (const G4Track &track, const G4Step &aStep) |
Static Public Member Functions | |
static G4TrackStatus | getPrevStatus () |
getPrevStatus() returns the previous status of the most recently suspended track. | |
Private Attributes | |
ParticleChange | change |
BLRunManager * | runManager |
Static Private Attributes | |
static G4TrackStatus | prevStatus = fPostponeToNextEvent |
Classes | |
class | ParticleChange |
TStepLimiter::TStepLimiter | ( | ) | [inline] |
References BLRunManager::getObject(), and runManager.
Referenced by clone().
00033 : G4VProcess("TStepLimiter",fUserDefined), 00034 change() { runManager = BLRunManager::getObject(); }
G4VProcess* TStepLimiter::clone | ( | ) | [inline] |
static G4TrackStatus TStepLimiter::getPrevStatus | ( | ) | [inline, static] |
getPrevStatus() returns the previous status of the most recently suspended track.
References prevStatus.
Referenced by BLRunManager::beamOnCollective().
00042 { return prevStatus; }
virtual G4bool TStepLimiter::IsApplicable | ( | const G4ParticleDefinition & | ) | [inline, virtual] |
virtual G4double TStepLimiter::AlongStepGetPhysicalInteractionLength | ( | const G4Track & | track, | |
G4double | previousStepSize, | |||
G4double | currentMinimumStep, | |||
G4double & | proposedSafety, | |||
G4GPILSelection * | selection | |||
) | [inline, virtual] |
virtual G4VParticleChange* TStepLimiter::AlongStepDoIt | ( | const G4Track & | track, | |
const G4Step & | stepData | |||
) | [inline, virtual] |
virtual G4double TStepLimiter::AtRestGetPhysicalInteractionLength | ( | const G4Track & | track, | |
G4ForceCondition * | condition | |||
) | [inline, virtual] |
References BLRunManager::getStepTime(), and runManager.
00062 { *condition = NotForced; 00063 G4double remaining = runManager->getStepTime() - 00064 track.GetGlobalTime(); 00065 if(remaining <= 0.0) remaining = DBL_MIN; 00066 return remaining; 00067 }
virtual G4double TStepLimiter::PostStepGetPhysicalInteractionLength | ( | const G4Track & | track, | |
G4double | previousStepSize, | |||
G4ForceCondition * | condition | |||
) | [inline, virtual] |
References BLRunManager::getStepTime(), and runManager.
00072 { *condition = NotForced; 00073 G4double remaining = runManager->getStepTime() - 00074 track.GetGlobalTime(); 00075 if(remaining <= 0.0) remaining = DBL_MIN; 00076 return remaining * track.GetVelocity(); 00077 }
virtual G4VParticleChange* TStepLimiter::PostStepDoIt | ( | const G4Track & | track, | |
const G4Step & | aStep | |||
) | [inline, virtual] |
References change, and prevStatus.
00081 { prevStatus = fAlive; 00082 change.Initialize(track); 00083 change.ProposeTrackStatus(fSuspend); 00084 return &change; 00085 }
virtual G4VParticleChange* TStepLimiter::AtRestDoIt | ( | const G4Track & | track, | |
const G4Step & | aStep | |||
) | [inline, virtual] |
References change, and prevStatus.
00089 { prevStatus = fStopButAlive; 00090 change.Initialize(track); 00091 change.ProposeTrackStatus(fSuspend); 00092 return &change; 00093 }
G4TrackStatus TStepLimiter::prevStatus = fPostponeToNextEvent [static, private] |
Referenced by AtRestDoIt(), getPrevStatus(), and PostStepDoIt().
ParticleChange TStepLimiter::change [private] |
Referenced by AlongStepDoIt(), AtRestDoIt(), and PostStepDoIt().
BLRunManager* TStepLimiter::runManager [private] |
Referenced by AtRestGetPhysicalInteractionLength(), PostStepGetPhysicalInteractionLength(), and TStepLimiter().