64static const std::size_t SizeOfSelectedDoItVector = 100;
69 return std::numeric_limits<T>::has_infinity
70 && value == std::numeric_limits<T>::infinity();
80 fpTrackingManager = 0;
97 fSelectedAtRestDoItVector(
G4VITProcess::GetMaxProcessIndex(), 0),
98 fSelectedPostStepDoItVector(
G4VITProcess::GetMaxProcessIndex(), 0)
117 fSelectedAtRestDoItVector(right.fSelectedAtRestDoItVector),
118 fSelectedPostStepDoItVector(right.fSelectedPostStepDoItVector)
139 if(
this == &right)
return *
this;
171 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*>::iterator it;
173 for(it = fProcessGeneralInfoMap.begin(); it != fProcessGeneralInfoMap.end();
183 fProcessGeneralInfoMap.clear();
190 fInitialized =
false;
200 if(fInitialized)
return;
204 ->GetNavigatorForTracking());
235 if(fpSecondary)
delete fpSecondary;
245 fpVerbose = rhs.fpVerbose;
246 fStoreTrajectory = rhs.fStoreTrajectory;
249 fpTrackingManager = 0;
251 fInitialized =
false;
253 kCarTolerance = rhs.kCarTolerance;
254 fInitialized =
false;
259 fpTrackContainer = 0;
267 fLeadingTracks.
Reset();
281 if(
this == &rhs)
return *
this;
292 G4cout<<
"G4ITStepProcessor::CloneProcesses: is called"<<
G4endl;
308 G4cerr <<
"ERROR - G4ITStepProcessor::GetProcessNumber()" <<
G4endl<<
" ProcessManager is NULL for particle = "
311 G4Exception(
"G4ITStepProcessor::GetProcessNumber()",
"ITStepProcessor0001",
330 G4VProcess* base_process = (*processVector)[i];
347 G4cout<<
"G4ITStepProcessor::GetProcessNumber: is called track"<<
G4endl;
351 G4cerr <<
"ERROR - G4SteppingManager::GetProcessNumber()" <<
G4endl<<
" ProcessManager is NULL for particle = "
354 G4Exception(
"G4SteppingManager::GetProcessNumber()",
"ITStepProcessor0002",
359 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*>::iterator it =
360 fProcessGeneralInfoMap.find(particle);
361 if(it != fProcessGeneralInfoMap.end())
363 G4Exception(
"G4SteppingManager::SetupGeneralProcessInfo()",
364 "ITStepProcessor0003",
378 G4cout <<
"G4ITStepProcessor::GetProcessNumber: #ofAtRest="
390 G4cout <<
"G4ITStepProcessor::GetProcessNumber:#ofAlongStp="
401 G4cout <<
"G4ITStepProcessor::GetProcessNumber: #ofPostStep="
405 if (SizeOfSelectedDoItVector<fpProcessInfo->MAXofAtRestLoops ||
406 SizeOfSelectedDoItVector<fpProcessInfo->MAXofAlongStepLoops ||
407 SizeOfSelectedDoItVector<fpProcessInfo->MAXofPostStepLoops )
409 G4cerr <<
"ERROR - G4ITStepProcessor::GetProcessNumber()" <<
G4endl
410 <<
" SizeOfSelectedDoItVector= " << SizeOfSelectedDoItVector
411 <<
" ; is smaller then one of MAXofAtRestLoops= "
415 G4Exception(
"G4ITStepProcessor::GetProcessNumber()",
417 "The array size is smaller than the actual No of processes.");
425 exceptionDescription <<
"No DoIt process found ";
426 G4Exception(
"G4ITStepProcessor::DoStepping",
"ITStepProcessor0005",
441 exceptionDescription <<
"No transportation process found ";
442 G4Exception(
"G4ITStepProcessor::SetupGeneralProcessInfo",
443 "ITStepProcessor0006",
447 fProcessGeneralInfoMap[particle] = fpProcessInfo;
458 fpITrack =
GetIT(fpTrack);
471 errMsg <<
"No IT pointer was attached to the track you try to process.";
473 "ITStepProcessor0007",
489 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*>::iterator it =
490 fProcessGeneralInfoMap.find(particle);
492 if(it == fProcessGeneralInfoMap.end())
496 if(fpProcessInfo == 0)
500 "ITStepProcessor0008",
502 exceptionDescription);
508 fpProcessInfo = it->second;
532 fN2ndariesAtRestDoIt = 0;
533 fN2ndariesAlongStepDoIt = 0;
534 fN2ndariesPostStepDoIt = 0;
546 fAtRestDoItProcTriggered = 0;
549 unsigned int NofInactiveProc=0;
554 if (fpCurrentProcess== 0)
565 lifeTime = fpCurrentProcess->
AtRestGPIL( *fpTrack, &fCondition );
575 if(lifeTime < shortestLifeTime )
577 shortestLifeTime = lifeTime;
578 fAtRestDoItProcTriggered =
G4int(ri);
590 fTimeStep = shortestLifeTime;
596 G4cerr <<
"ERROR - G4ITStepProcessor::InvokeAtRestDoItProcs()" <<
G4endl
597 <<
" No AtRestDoIt process is active!" <<
G4endl;
636 assert(fpTrack != 0);
653 if (
IsInf(fTimeStep))
664 fLeadingTracks.
Reset();
674 fLeadingTracks.
Push(fpTrack);
676 else if(fabs(fILTimeStep - fTimeStep) <
DBL_EPSILON )
684 fLeadingTracks.
Push(fpTrack);
724 fpNavigator->NewNavigatorState();
726 ->GetNavigatorState());
729 fpNavigator->LocateGlobalPointAndSetup(fpTrack->
GetPosition(),
753 ->GetNavigatorState());
758 ->fTouchableHandle()));
760 ->GetNavigatorState());
777 fpNavigator->ResetHierarchyAndLocate(fpTrack->
GetPosition(),
822 if(fpCurrentVolume == 0)
827 G4cerr <<
"ERROR - G4ITStepProcessor::SetInitialStep()" <<
G4endl<<
" Primary particle starting at - "
829 <<
" - is outside of the world volume." <<
G4endl;
830 G4Exception(
"G4ITStepProcessor::SetInitialStep()",
"ITStepProcessor0011",
835 G4cout <<
"WARNING - G4ITStepProcessor::SetInitialStep()" <<
G4endl
836 <<
" Initial track position is outside world! - "
975 ->GetNavigatorState());
976 fpNavigator->ResetNavigatorState();
988 G4VProcess* processWithPostStepGivenByTimeStep(0);
1002 fpCurrentProcess =
dynamic_cast<G4VITProcess*
>((*fpProcessInfo
1004 if(fpCurrentProcess == 0)
1017 fPhysIntLength = fpCurrentProcess->
PostStepGPIL(*fpTrack,
1039 G4Exception(
"G4ITStepProcessor::DefinePhysicalStepLength()",
1040 "ITStepProcessor0008",
1042 "This feature is no more supported");
1069 if(fPhysIntLength < fpState->fPhysicalStep)
1076 fPhysIntLength *= -1;
1077 if(fPhysIntLength < proposedTimeStep)
1079 proposedTimeStep = fPhysIntLength;
1080 fPostStepAtTimeDoItProcTriggered = np;
1081 processWithPostStepGivenByTimeStep = fpCurrentProcess;
1088 fPostStepDoItProcTriggered =
G4int(np);
1101 fpCurrentProcess =
dynamic_cast<G4VITProcess*
>((*fpProcessInfo
1103 if(fpCurrentProcess == 0)
continue;
1112 safetyProposedToAndByProcess,
1120 if(fPhysIntLength < fpState->fPhysicalStep)
1138 if(!fpTransportation)
1141 exceptionDescription <<
"No transportation process found ";
1142 G4Exception(
"G4ITStepProcessor::DoDefinePhysicalStepLength",
1143 "ITStepProcessor0009",
1145 exceptionDescription);
1160 if(!fpTransportation)
1163 exceptionDescription <<
"No transportation process found ";
1164 G4Exception(
"G4ITStepProcessor::DoDefinePhysicalStepLength",
1165 "ITStepProcessor0010",
1167 exceptionDescription);
1175 if(proposedTimeStep < fTimeStep)
1177 if(fPostStepAtTimeDoItProcTriggered < fpProcessInfo->MAXofPostStepLoops)
1188 fTimeStep = proposedTimeStep;
1199 if(fPostStepDoItProcTriggered < fpProcessInfo->MAXofPostStepLoops)
1215 if(safetyProposedToAndByProcess < fpState->fProposedSafety)
1225 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
G4SelectedPostStepDoItVector fSelectedPostStepDoItVector
virtual ~G4ITStepProcessorState()
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
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
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)
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
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