60static const std::size_t SizeOfSelectedDoItVector = 100;
65 return std::numeric_limits<T>::has_infinity
66 && value == std::numeric_limits<T>::infinity();
76 fpTrackingManager =
nullptr;
77 fpNavigator =
nullptr;
82 fpTrackContainer =
nullptr;
93 fSelectedAtRestDoItVector(
G4VITProcess::GetMaxProcessIndex(), 0),
94 fSelectedPostStepDoItVector(
G4VITProcess::GetMaxProcessIndex(), 0)
113 fSelectedAtRestDoItVector(right.fSelectedAtRestDoItVector),
114 fSelectedPostStepDoItVector(right.fSelectedPostStepDoItVector)
135 if(
this == &right)
return *
this;
167 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*>::iterator it;
169 for(it = fProcessGeneralInfoMap.begin(); it != fProcessGeneralInfoMap.end();
172 if(it->second !=
nullptr)
179 fProcessGeneralInfoMap.clear();
186 fInitialized =
false;
196 if(fInitialized)
return;
200 ->GetNavigatorForTracking());
206 if(fpVerbose ==
nullptr)
210 if(interactivity !=
nullptr)
225 if(fpStep !=
nullptr)
241 fpVerbose = rhs.fpVerbose;
242 fStoreTrajectory = rhs.fStoreTrajectory;
245 fpTrackingManager =
nullptr;
246 fpNavigator =
nullptr;
247 fInitialized =
false;
249 kCarTolerance = rhs.kCarTolerance;
250 fInitialized =
false;
255 fpTrackContainer =
nullptr;
263 fLeadingTracks.
Reset();
277 if(
this == &rhs)
return *
this;
288 G4cout<<
"G4ITStepProcessor::CloneProcesses: is called"<<
G4endl;
304 G4cerr <<
"ERROR - G4ITStepProcessor::GetProcessNumber()" <<
G4endl<<
" ProcessManager is NULL for particle = "
307 G4Exception(
"G4ITStepProcessor::GetProcessNumber()",
"ITStepProcessor0001",
326 G4VProcess* base_process = (*processVector)[i];
329 if(itProcess ==
nullptr)
343 G4cout<<
"G4ITStepProcessor::GetProcessNumber: is called track"<<
G4endl;
347 G4cerr <<
"ERROR - G4SteppingManager::GetProcessNumber()" <<
G4endl<<
" ProcessManager is NULL for particle = "
350 G4Exception(
"G4SteppingManager::GetProcessNumber()",
"ITStepProcessor0002",
356 fProcessGeneralInfoMap.find(particle);
357 if(it != fProcessGeneralInfoMap.end())
359 G4Exception(
"G4SteppingManager::SetupGeneralProcessInfo()",
360 "ITStepProcessor0003",
374 G4cout <<
"G4ITStepProcessor::GetProcessNumber: #ofAtRest="
386 G4cout <<
"G4ITStepProcessor::GetProcessNumber:#ofAlongStp="
397 G4cout <<
"G4ITStepProcessor::GetProcessNumber: #ofPostStep="
401 if (SizeOfSelectedDoItVector<fpProcessInfo->MAXofAtRestLoops ||
402 SizeOfSelectedDoItVector<fpProcessInfo->MAXofAlongStepLoops ||
403 SizeOfSelectedDoItVector<fpProcessInfo->MAXofPostStepLoops )
405 G4cerr <<
"ERROR - G4ITStepProcessor::GetProcessNumber()" <<
G4endl
406 <<
" SizeOfSelectedDoItVector= " << SizeOfSelectedDoItVector
407 <<
" ; is smaller then one of MAXofAtRestLoops= "
411 G4Exception(
"G4ITStepProcessor::GetProcessNumber()",
413 "The array size is smaller than the actual No of processes.");
421 exceptionDescription <<
"No DoIt process found ";
422 G4Exception(
"G4ITStepProcessor::DoStepping",
"ITStepProcessor0005",
437 exceptionDescription <<
"No transportation process found ";
438 G4Exception(
"G4ITStepProcessor::SetupGeneralProcessInfo",
439 "ITStepProcessor0006",
443 fProcessGeneralInfoMap[particle] = fpProcessInfo;
452 if(fpTrack !=
nullptr)
454 fpITrack =
GetIT(fpTrack);
457 if(fpITrack !=
nullptr)
463 fpTrackingInfo =
nullptr;
467 errMsg <<
"No IT pointer was attached to the track you try to process.";
469 "ITStepProcessor0007",
486 fProcessGeneralInfoMap.find(particle);
488 if(it == fProcessGeneralInfoMap.end())
492 if(fpProcessInfo ==
nullptr)
496 "ITStepProcessor0008",
498 exceptionDescription);
504 fpProcessInfo = it->second;
528 fN2ndariesAtRestDoIt = 0;
529 fN2ndariesAlongStepDoIt = 0;
530 fN2ndariesPostStepDoIt = 0;
542 fAtRestDoItProcTriggered = 0;
545 unsigned int NofInactiveProc=0;
550 if (fpCurrentProcess==
nullptr)
561 lifeTime = fpCurrentProcess->
AtRestGPIL( *fpTrack, &fCondition );
571 if(lifeTime < shortestLifeTime )
573 shortestLifeTime = lifeTime;
574 fAtRestDoItProcTriggered =
G4int(ri);
586 fTimeStep = shortestLifeTime;
592 G4cerr <<
"ERROR - G4ITStepProcessor::InvokeAtRestDoItProcs()" <<
G4endl
593 <<
" No AtRestDoIt process is active!" <<
G4endl;
632 assert(fpTrack != 0);
633 if (fpTrack ==
nullptr)
649 if (
IsInf(fTimeStep))
660 fLeadingTracks.
Reset();
670 fLeadingTracks.
Push(fpTrack);
672 else if(fabs(fILTimeStep - fTimeStep) <
DBL_EPSILON )
680 fLeadingTracks.
Push(fpTrack);
720 fpNavigator->NewNavigatorState();
722 ->GetNavigatorState());
725 fpNavigator->LocateGlobalPointAndSetup(fpTrack->
GetPosition(),
749 ->GetNavigatorState());
754 ->fTouchableHandle()));
756 ->GetNavigatorState());
773 fpNavigator->ResetHierarchyAndLocate(fpTrack->
GetPosition(),
818 if(fpCurrentVolume ==
nullptr)
823 G4cerr <<
"ERROR - G4ITStepProcessor::SetInitialStep()" <<
G4endl<<
" Primary particle starting at - "
825 <<
" - is outside of the world volume." <<
G4endl;
826 G4Exception(
"G4ITStepProcessor::SetInitialStep()",
"ITStepProcessor0011",
831 G4cout <<
"WARNING - G4ITStepProcessor::SetInitialStep()" <<
G4endl
832 <<
" Initial track position is outside world! - "
848 if(fpStep ==
nullptr)
971 ->GetNavigatorState());
972 fpNavigator->ResetNavigatorState();
984 G4VProcess* processWithPostStepGivenByTimeStep(
nullptr);
998 fpCurrentProcess =
dynamic_cast<G4VITProcess*
>((*fpProcessInfo
1000 if(fpCurrentProcess ==
nullptr)
1013 fPhysIntLength = fpCurrentProcess->
PostStepGPIL(*fpTrack,
1035 G4Exception(
"G4ITStepProcessor::DefinePhysicalStepLength()",
1036 "ITStepProcessor0008",
1038 "This feature is no more supported");
1064 if(fPhysIntLength < fpState->fPhysicalStep)
1071 fPhysIntLength *= -1;
1072 if(fPhysIntLength < proposedTimeStep)
1074 proposedTimeStep = fPhysIntLength;
1075 fPostStepAtTimeDoItProcTriggered = np;
1076 processWithPostStepGivenByTimeStep = fpCurrentProcess;
1083 fPostStepDoItProcTriggered =
G4int(np);
1095 fpCurrentProcess =
dynamic_cast<G4VITProcess*
>((*fpProcessInfo
1097 if(fpCurrentProcess ==
nullptr)
continue;
1106 safetyProposedToAndByProcess,
1114 if(fPhysIntLength < fpState->fPhysicalStep)
1132 if(fpTransportation ==
nullptr)
1135 exceptionDescription <<
"No transportation process found ";
1136 G4Exception(
"G4ITStepProcessor::DoDefinePhysicalStepLength",
1137 "ITStepProcessor0009",
1139 exceptionDescription);
1154 if(fpTransportation ==
nullptr)
1157 exceptionDescription <<
"No transportation process found ";
1158 G4Exception(
"G4ITStepProcessor::DoDefinePhysicalStepLength",
1159 "ITStepProcessor0010",
1161 exceptionDescription);
1169 if(proposedTimeStep < fTimeStep)
1171 if(fPostStepAtTimeDoItProcTriggered < fpProcessInfo->MAXofPostStepLoops)
1182 fTimeStep = proposedTimeStep;
1193 if(fPostStepDoItProcTriggered < fpProcessInfo->MAXofPostStepLoops)
1209 if(safetyProposedToAndByProcess < fpState->fProposedSafety)
1219 fpNavigator->ResetNavigatorState();
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4IT * GetIT(const G4Track *track)
#define theParticleIterator
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
void PrepareLeadingTracks()
G4TouchableHandle fTouchableHandle
~G4ITStepProcessorState() override
G4SelectedPostStepDoItVector fSelectedPostStepDoItVector
G4double fPreviousStepSize
G4SelectedAtRestDoItVector fSelectedAtRestDoItVector
G4ITStepProcessorState & operator=(const G4ITStepProcessorState &)
void ResetLeadingTracks()
virtual ~G4ITStepProcessor()
void ForceReInitialization()
void ActiveOnlyITProcess()
void SetNavigator(G4ITNavigator *value)
void PrepareLeadingTracks()
G4ITStepProcessor & operator=(const G4ITStepProcessor &other)
G4double ComputeInteractionLength(double previousTimeStep)
void SetPreviousStepTime(G4double)
void DoDefinePhysicalStepLength()
void DefinePhysicalStepLength(G4Track *)
void SetupGeneralProcessInfo(G4ParticleDefinition *, G4ProcessManager *)
double GetInteractionTime()
virtual void Initialize()
G4TrackList * GetMainList(Key)
static G4ITTrackHolder * Instance()
G4VITSteppingVerbose * GetSteppingVerbose()
G4ITTrackingInteractivity * GetInteractivity()
void StartTracking(G4Track *)
void EndTracking(G4Track *)
static G4ITTransportationManager * GetTransportationManager()
virtual void ComputeStep(const G4Track &, const G4Step &, const double timeStep, double &spaceStep)
G4TrackingInformation * GetTrackingInfo()
virtual const G4String & GetName() const =0
G4ProcessManager * GetProcessManager() const
G4int GetPDGEncoding() const
const G4String & GetParticleName() const
void reset(G4bool ifSkipIon=true)
G4PTblDicIterator * GetIterator() const
static G4ParticleTable * GetParticleTable()
G4VProcess * SetProcessActivation(G4VProcess *aProcess, G4bool fActive)
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVector * GetProcessList() const
G4ProcessVector * GetPostStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
std::size_t entries() const
void SetProcessDefinedStep(const G4VProcess *aValue)
G4VPhysicalVolume * GetPhysicalVolume() const
void DeleteSecondaryVector()
void SetPointerToVectorOfAuxiliaryPoints(std::vector< G4ThreeVector > *vec)
void InitializeStep(G4Track *aValue)
void ResetTotalEnergyDeposit()
G4TrackVector * GetfSecondary()
void CopyPostToPreStepPoint()
G4StepPoint * GetPreStepPoint() const
G4TrackVector * NewSecondaryVector()
G4StepPoint * GetPostStepPoint() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4TrackStatus GetTrackStatus() const
void SetTrackStatus(const G4TrackStatus aTrackStatus)
void SetStep(const G4Step *aValue)
G4VPhysicalVolume * GetVolume() const
void SetVertexPosition(const G4ThreeVector &aValue)
const G4TouchableHandle & GetNextTouchableHandle() const
void SetVertexMomentumDirection(const G4ThreeVector &aValue)
G4VPhysicalVolume * GetNextVolume() const
void SetNextTouchableHandle(const G4TouchableHandle &apValue)
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
G4int GetCurrentStepNumber() const
G4ParticleDefinition * GetDefinition() const
const G4TouchableHandle & GetTouchableHandle() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4double GetStepLength() const
void SetVertexKineticEnergy(const G4double aValue)
G4int GetParentID() const
void SetLogicalVolumeAtVertex(const G4LogicalVolume *)
const G4Step * GetStep() const
G4bool ProposesTimeStep() const
size_t GetProcessID() const
void SetProcessState(G4shared_ptr< G4ProcessState_Lock > aProcInfo)
G4double GetInteractionTimeLeft()
virtual void DPSLAlongStep()=0
virtual void DPSLStarted()=0
void SetStepProcessor(const G4ITStepProcessor *stepProcessor)
virtual void DPSLPostStep()=0
G4LogicalVolume * GetLogicalVolume() const
virtual G4int GetRegularStructureId() const =0
G4double PostStepGPIL(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
G4double AtRestGPIL(const G4Track &track, G4ForceCondition *condition)
G4double AlongStepGPIL(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
G4ProcessVector * fpPostStepDoItVector
G4ProcessVector * fpPostStepGetPhysIntVector
std::size_t MAXofAlongStepLoops
std::size_t MAXofAtRestLoops
G4ProcessVector * fpAlongStepGetPhysIntVector
G4ProcessVector * fpAlongStepDoItVector
G4ProcessVector * fpAtRestGetPhysIntVector
G4ITTransportation * fpTransportation
std::size_t MAXofPostStepLoops
G4ProcessVector * fpAtRestDoItVector