#include <MaxTimeCuts.hh>
Inheritance diagram for MaxTimeCuts:
Public Member Functions | |
MaxTimeCuts (const G4String &processName="MaxTimeCuts") | |
virtual | ~MaxTimeCuts () |
virtual G4double | PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) |
Definition at line 50 of file MaxTimeCuts.hh.
MaxTimeCuts::MaxTimeCuts | ( | const G4String & | processName = "MaxTimeCuts" |
) |
Definition at line 50 of file MaxTimeCuts.cc.
References fUserDefined, G4cout, G4endl, G4VProcess::GetProcessName(), G4VProcess::SetProcessType(), and G4VProcess::verboseLevel.
00051 : SpecialCuts(aName) 00052 { 00053 if (verboseLevel>1) { 00054 G4cout << GetProcessName() << " is created "<< G4endl; 00055 } 00056 SetProcessType(fUserDefined); 00057 }
MaxTimeCuts::~MaxTimeCuts | ( | ) | [virtual] |
G4double MaxTimeCuts::PostStepGetPhysicalInteractionLength | ( | const G4Track & | track, | |
G4double | previousStepSize, | |||
G4ForceCondition * | condition | |||
) | [virtual] |
Reimplemented from SpecialCuts.
Definition at line 66 of file MaxTimeCuts.cc.
References DBL_MAX, G4Track::GetDynamicParticle(), G4Track::GetGlobalTime(), G4VPhysicalVolume::GetLogicalVolume(), G4DynamicParticle::GetTotalEnergy(), G4DynamicParticle::GetTotalMomentum(), G4LogicalVolume::GetUserLimits(), G4UserLimits::GetUserMaxTime(), G4Track::GetVolume(), and NotForced.
00071 { 00072 // condition is set to "Not Forced" 00073 *condition = NotForced; 00074 00075 G4double proposedStep = DBL_MAX; 00076 // get the pointer to UserLimits 00077 G4UserLimits* pUserLimits = aTrack.GetVolume()->GetLogicalVolume()->GetUserLimits(); 00078 const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle(); 00079 00080 // can apply cuts for specific particles - use if(particleDef): 00081 // G4ParticleDefinition* aParticleDef = aTrack.GetDefinition(); 00082 00083 // G4cout << " Time: " << pUserLimits->GetUserMaxTime(aTrack) << G4endl; 00084 00085 if (pUserLimits) { 00086 G4double temp = DBL_MAX; 00087 //max time limit 00088 G4double dTime= (pUserLimits->GetUserMaxTime(aTrack) - aTrack.GetGlobalTime()); 00089 if (dTime < 0. ) { 00090 proposedStep = 0.; 00091 } else { 00092 G4double beta = (aParticle->GetTotalMomentum())/(aParticle->GetTotalEnergy()); 00093 temp = beta*c_light*dTime; 00094 if (proposedStep > temp) proposedStep = temp; 00095 } 00096 00097 } 00098 return proposedStep; 00099 }