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().
00032 : G4VProcess("TStepLimiter",fUserDefined), 00033 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().
00041 { 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::getNextStepTime(), and runManager.
00061 { *condition = NotForced; 00062 G4double remaining = runManager->getNextStepTime() - 00063 track.GetGlobalTime(); 00064 if(remaining <= 0.0) remaining = DBL_MIN; 00065 return remaining; 00066 }
virtual G4double TStepLimiter::PostStepGetPhysicalInteractionLength | ( | const G4Track & | track, | |
G4double | previousStepSize, | |||
G4ForceCondition * | condition | |||
) | [inline, virtual] |
References BLRunManager::getNextStepTime(), and runManager.
00071 { *condition = NotForced; 00072 G4double remaining = runManager->getNextStepTime() - 00073 track.GetGlobalTime(); 00074 if(remaining <= 0.0) remaining = DBL_MIN; 00075 return remaining * track.GetVelocity(); 00076 }
virtual G4VParticleChange* TStepLimiter::PostStepDoIt | ( | const G4Track & | track, | |
const G4Step & | aStep | |||
) | [inline, virtual] |
References change, and prevStatus.
00080 { prevStatus = fAlive; 00081 change.Initialize(track); 00082 change.ProposeTrackStatus(fSuspend); 00083 return &change; 00084 }
virtual G4VParticleChange* TStepLimiter::AtRestDoIt | ( | const G4Track & | track, | |
const G4Step & | aStep | |||
) | [inline, virtual] |
References change, and prevStatus.
00088 { prevStatus = fStopButAlive; 00089 change.Initialize(track); 00090 change.ProposeTrackStatus(fSuspend); 00091 return &change; 00092 }
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().