79 #define PrepareState() G4ITTransportationState* __state = this->GetState<G4ITTransportationState>(); 83 #define State(theXInfo) (__state->theXInfo) 98 fThreshold_Warning_Energy(100 *
MeV),
99 fThreshold_Important_Energy(250 *
MeV),
100 fThresholdTrials(10),
101 fUnimportant_Energy(1 *
MeV),
102 fSumEnergyKilled(0.0),
103 fMaxEnergyKilled(0.0),
104 fShortStepOptimisation(false),
105 fVerboseLevel(verbose)
220 G4cout <<
" G4ITTransportation: Statistics for looping particles " 222 G4cout <<
" Sum of energy of loopers killed: " 224 G4cout <<
" Max energy of loopers killed: " 257 G4GPILSelection* selection)
260 G4double geometryStepLength(-1.0), newSafety(-1.0);
275 *selection = CandidateForSelection;
312 G4bool fieldExertsForce =
false;
313 if ((particleCharge != 0.0))
334 if (!fieldExertsForce)
341 geometryStepLength = currentMinimumStep;
373 currentSafety = newSafety;
379 geometryStepLength = linearStepLength;
384 geometryStepLength = currentMinimumStep;
392 + geometryStepLength * startMomentumDir;
403 / track.GetVelocity();
405 + track.GetGlobalTime();
422 <<
"ITTransportation does not support external fields.";
424 <<
" If you are dealing with a tradiational MC simulation, ";
425 exceptionDescription <<
"please use G4Transportation.";
427 G4Exception(
"G4ITTransportation::AlongStepGetPhysicalInteractionLength",
583 if (currentMinimumStep == 0.0)
585 if (currentSafety == 0.0)
602 if (particleCharge != 0.0)
607 currentSafety = endSafety;
628 #ifdef G4DEBUG_TRANSPORT 630 G4cout <<
"***G4Transportation::AlongStepGPIL ** " <<
G4endl;
631 G4cout <<
" Called Navigator->ComputeSafety at " 633 <<
" and it returned safety= " << endSafety <<
G4endl;
635 <<
" to obtain pseudo-safety= " << currentSafety <<
G4endl;
645 return geometryStepLength;
650 const double timeStep,
651 double& oPhysicalStep)
658 track.CalculateVelocity();
659 G4double initialVelocity = track.GetVelocity();
675 oPhysicalStep = initialVelocity * timeStep;
680 + oPhysicalStep * startMomentumDir;
690 const G4Step& stepData)
693 #if defined (DEBUG_MEM) 694 MemStat mem_first, mem_second, mem_diff;
697 #if defined (DEBUG_MEM) 709 if (!pdefOpticalPhoton) pdefOpticalPhoton =
732 G4double startTime = track.GetGlobalTime();
740 G4double initialVelocity = stepData.GetPreStepPoint()->GetVelocity();
741 G4double stepLength = track.GetStepLength();
744 if (track.GetParticleDefinition() == pdefOpticalPhoton)
747 double finalVelocity = track.CalculateVelocityForOpticalPhoton();
749 deltaTime = stepLength / finalVelocity;
751 else if (initialVelocity > 0.0)
753 deltaTime = stepLength / initialVelocity;
806 <<
" G4ITTransportation is killing track that is looping or stuck " 807 <<
G4endl<<
" This track has " << track.GetKineticEnergy() /
MeV 808 <<
" MeV energy." <<
G4endl;
810 <<
" No of calls to AlongStepDoIt = " << noCalls
822 G4cout <<
" G4ITTransportation::AlongStepDoIt(): Particle looping - " 824 <<
" No of calls to = " << noCalls <<
G4endl;
842 #if defined (DEBUG_MEM) 844 mem_diff = mem_second-mem_first;
845 G4cout <<
"\t || MEM || End of G4ITTransportation::AlongStepDoIt, diff is: " 862 G4ForceCondition* pForceCond)
864 *pForceCond = Forced;
878 G4bool isLastStep =
false;
894 G4cout <<
"Step is limited by geometry " 895 <<
"track ID : " << track.GetTrackID() <<
G4endl;
905 exceptionDescription <<
"No current touchable found ";
906 G4Exception(
" G4ITTransportation::PostStepDoIt",
"G4ITTransportation001",
912 track.GetPosition(), track.GetMomentumDirection(),
924 <<
" [nm]" <<
" Track ID : " << track.GetTrackID() <<
G4endl;
925 G4cout <<
"G4ITTransportation will killed the track because " 926 "State(fCurrentTouchableHandle)->GetVolume() == 0"<<
G4endl;
948 #ifdef G4DEBUG_TRANSPORT 953 if( ! (exiting || entering) )
955 G4cout <<
" Transport> : Proposed isLastStep= " << isLastStep
958 <<
" Track position : " << track.GetPosition() /
nanometer <<
" [nm]" 978 retCurrentTouchable = track.GetTouchableHandle();
981 #ifdef G4DEBUG_TRANSPORT 983 G4cout <<
" Transport> Proposed isLastStep= " << isLastStep
984 <<
" Geometry did not limit step. Position : " 1011 pNewMaterialCutsCouple =
1015 if (pNewVol != 0 && pNewMaterialCutsCouple != 0
1016 && pNewMaterialCutsCouple->
GetMaterial() != pNewMaterial)
1024 fParticleChange.SetMaterialCutsCoupleInTouchable(pNewMaterialCutsCouple);
1053 GetIT(track)->GetTrackingInfo()->GetTrackStateManager());
1084 fieldMgrStore->ClearAllChordFindersState();
G4double fCandidateEndGlobalTime
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4ParticleChangeForTransport fParticleChange
std::ostringstream G4ExceptionDescription
const G4Material * GetMaterial() const
G4bool fShortStepOptimisation
CLHEP::Hep3Vector G4ThreeVector
G4ITNavigator * GetNavigatorForTracking() const
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
static const double nanometer
virtual ~G4ITTransportationState()
G4Material * GetMaterial() const
G4double fMaxEnergyKilled
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &)
G4ProductionCuts * GetProductionCuts() const
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
G4bool DoesFieldExist() const
G4ThreeVector fTransportEndPosition
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection)
G4double theInteractionTimeLeft
void SetInstantiateProcessState(G4bool flag)
G4ReferenceCountedHandle< G4VTouchable > G4TouchableHandle
G4ITNavigator * fLinearNavigator
virtual void StartTracking(G4Track *)
G4bool DoesGlobalFieldExist()
virtual void ConfigureForTrack(const G4Track *)
G4ITTransportation & operator=(const G4ITTransportation &)
virtual void StartTracking(G4Track *aTrack)
G4IT * GetIT(const G4Track *track)
G4double fEndPointDistance
static G4ITTransportationManager * GetTransportationManager()
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double, G4ForceCondition *pForceCond)
G4GLOB_DLL std::ostream G4cout
virtual void ComputeStep(const G4Track &, const G4Step &, const double timeStep, double &spaceStep)
G4PropagatorInField * fFieldPropagator
virtual ~G4ITTransportation()
virtual void ResetTrackState()
G4bool fInstantiateProcessState
G4bool fGeometryLimitedStep
virtual void StartTracking(G4Track *)
void SetInstantiateProcessState(G4bool flag)
void SetProcessSubType(G4int)
G4shared_ptr< G4ProcessState > fpState
G4bool enablePostStepDoIt
G4FieldManager * FindAndSetFieldManager(G4VPhysicalVolume *pCurrentPhysVol)
G4FieldManager * GetFieldManager() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4ITSafetyHelper * fpSafetyHelper
virtual void NewTrackState()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4TransportationManager * GetTransportationManager()
G4TrackingInformation * GetTrackingInfo()
G4double fSumEnergyKilled
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
G4double GetCharge() const
static G4FieldManagerStore * GetInstance()
static G4ParticleTable * GetParticleTable()
std::vector< G4ThreeVector > * GimmeTrajectoryVectorAndForgetIt() const
G4ITSafetyHelper * GetSafetyHelper() const
const G4ThreeVector & GetMomentumDirection() const
G4ITTransportation(const G4String &aName="ITTransportation", G4int verbosityLevel=0)
G4double fTransportEndKineticEnergy
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4bool fEndGlobalTimeComputed
G4VParticleChange * pParticleChange
G4VSensitiveDetector * GetSensitiveDetector() const
G4TouchableHandle fCurrentTouchableHandle
void ClearPropagatorState()
G4bool enableAlongStepDoIt
G4PropagatorInField * GetPropagatorInField() const
G4double fUnimportant_Energy
G4double fThreshold_Important_Energy
G4double fThreshold_Warning_Energy
G4bool fParticleIsLooping
G4LogicalVolume * GetLogicalVolume() const
virtual void SaveTrackState(G4TrackStateManager &manager)
G4ThreeVector fTransportEndSpin
void SetCurrentSafety(G4double val, const G4ThreeVector &pos)
virtual void LoadTrackState(G4TrackStateManager &manager)
G4ITTransportationState()
Process State.
G4ThreeVector fTransportEndMomentumDir
G4ThreeVector fPreviousSftOrigin
const G4Field * GetDetectorField() const