65static const size_t SizeOfSelectedDoItVector = 100;
70 return std::numeric_limits<T>::has_infinity
71 && value == std::numeric_limits<T>::infinity();
81 fpTrackingManager = 0;
98 fSelectedAtRestDoItVector(
G4VITProcess::GetMaxProcessIndex(), 0),
99 fSelectedPostStepDoItVector(
G4VITProcess::GetMaxProcessIndex(), 0)
118 fSelectedAtRestDoItVector(right.fSelectedAtRestDoItVector),
119 fSelectedPostStepDoItVector(right.fSelectedPostStepDoItVector)
140 if(
this == &right)
return *
this;
172 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*>::iterator it;
174 for(it = fProcessGeneralInfoMap.begin(); it != fProcessGeneralInfoMap.end();
184 fProcessGeneralInfoMap.clear();
191 fInitialized =
false;
201 if(fInitialized)
return;
205 ->GetNavigatorForTracking());
236 if(fpSecondary)
delete fpSecondary;
246 fpVerbose = rhs.fpVerbose;
247 fStoreTrajectory = rhs.fStoreTrajectory;
250 fpTrackingManager = 0;
252 fInitialized =
false;
254 kCarTolerance = rhs.kCarTolerance;
255 fInitialized =
false;
260 fpTrackContainer = 0;
268 fLeadingTracks.
Reset();
282 if(
this == &rhs)
return *
this;
293 G4cout<<
"G4ITStepProcessor::CloneProcesses: is called"<<
G4endl;
309 G4cerr <<
"ERROR - G4ITStepProcessor::GetProcessNumber()" <<
G4endl<<
" ProcessManager is NULL for particle = "
312 G4Exception(
"G4ITStepProcessor::GetProcessNumber()",
"ITStepProcessor0001",
329 for(std::size_t i = 0; i < processVector->
size(); ++i)
331 G4VProcess* base_process = (*processVector)[i];
348 G4cout<<
"G4ITStepProcessor::GetProcessNumber: is called track"<<
G4endl;
352 G4cerr <<
"ERROR - G4SteppingManager::GetProcessNumber()" <<
G4endl<<
" ProcessManager is NULL for particle = "
355 G4Exception(
"G4SteppingManager::GetProcessNumber()",
"ITStepProcessor0002",
360 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*>::iterator it =
361 fProcessGeneralInfoMap.find(particle);
362 if(it != fProcessGeneralInfoMap.end())
364 G4Exception(
"G4SteppingManager::SetupGeneralProcessInfo()",
365 "ITStepProcessor0003",
379 G4cout <<
"G4ITStepProcessor::GetProcessNumber: #ofAtRest="
391 G4cout <<
"G4ITStepProcessor::GetProcessNumber:#ofAlongStp="
402 G4cout <<
"G4ITStepProcessor::GetProcessNumber: #ofPostStep="
406 if (SizeOfSelectedDoItVector<fpProcessInfo->MAXofAtRestLoops ||
407 SizeOfSelectedDoItVector<fpProcessInfo->MAXofAlongStepLoops ||
408 SizeOfSelectedDoItVector<fpProcessInfo->MAXofPostStepLoops )
410 G4cerr <<
"ERROR - G4ITStepProcessor::GetProcessNumber()" <<
G4endl
411 <<
" SizeOfSelectedDoItVector= " << SizeOfSelectedDoItVector
412 <<
" ; is smaller then one of MAXofAtRestLoops= "
416 G4Exception(
"G4ITStepProcessor::GetProcessNumber()",
418 "The array size is smaller than the actual No of processes.");
426 exceptionDescription <<
"No DoIt process found ";
427 G4Exception(
"G4ITStepProcessor::DoStepping",
"ITStepProcessor0005",
442 exceptionDescription <<
"No transportation process found ";
443 G4Exception(
"G4ITStepProcessor::SetupGeneralProcessInfo",
444 "ITStepProcessor0006",
448 fProcessGeneralInfoMap[particle] = fpProcessInfo;
459 fpITrack =
GetIT(fpTrack);
472 errMsg <<
"No IT pointer was attached to the track you try to process.";
474 "ITStepProcessor0007",
490 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*>::iterator it =
491 fProcessGeneralInfoMap.find(particle);
493 if(it == fProcessGeneralInfoMap.end())
497 if(fpProcessInfo == 0)
501 "ITStepProcessor0008",
503 exceptionDescription);
509 fpProcessInfo = it->second;
533 fN2ndariesAtRestDoIt = 0;
534 fN2ndariesAlongStepDoIt = 0;
535 fN2ndariesPostStepDoIt = 0;
547 fAtRestDoItProcTriggered = 0;
550 unsigned int NofInactiveProc=0;
555 if (fpCurrentProcess== 0)
566 lifeTime = fpCurrentProcess->
AtRestGPIL( *fpTrack, &fCondition );
576 if(lifeTime < shortestLifeTime )
578 shortestLifeTime = lifeTime;
579 fAtRestDoItProcTriggered =
G4int(ri);
591 fTimeStep = shortestLifeTime;
597 G4cerr <<
"ERROR - G4ITStepProcessor::InvokeAtRestDoItProcs()" <<
G4endl
598 <<
" No AtRestDoIt process is active!" <<
G4endl;
637 assert(fpTrack != 0);
654 if (
IsInf(fTimeStep))
665 fLeadingTracks.
Reset();
675 fLeadingTracks.
Push(fpTrack);
677 else if(fabs(fILTimeStep - fTimeStep) <
DBL_EPSILON )
685 fLeadingTracks.
Push(fpTrack);
725 fpNavigator->NewNavigatorState();
727 ->GetNavigatorState());
730 fpNavigator->LocateGlobalPointAndSetup(fpTrack->
GetPosition(),
754 ->GetNavigatorState());
759 ->fTouchableHandle()));
761 ->GetNavigatorState());
778 fpNavigator->ResetHierarchyAndLocate(fpTrack->
GetPosition(),
823 if(fpCurrentVolume == 0)
828 G4cerr <<
"ERROR - G4ITStepProcessor::SetInitialStep()" <<
G4endl<<
" Primary particle starting at - "
830 <<
" - is outside of the world volume." <<
G4endl;
831 G4Exception(
"G4ITStepProcessor::SetInitialStep()",
"ITStepProcessor0011",
836 G4cout <<
"WARNING - G4ITStepProcessor::SetInitialStep()" <<
G4endl
837 <<
" Initial track position is outside world! - "
976 ->GetNavigatorState());
977 fpNavigator->ResetNavigatorState();
988 double proposedTimeStep =
DBL_MAX;
989 G4VProcess* processWithPostStepGivenByTimeStep(0);
1003 fpCurrentProcess =
dynamic_cast<G4VITProcess*
>((*fpProcessInfo
1005 if(fpCurrentProcess == 0)
1018 fPhysIntLength = fpCurrentProcess->
PostStepGPIL(*fpTrack,
1040 G4Exception(
"G4ITStepProcessor::DefinePhysicalStepLength()",
1041 "ITStepProcessor0008",
1043 "This feature is no more supported");
1070 if(fPhysIntLength < fpState->fPhysicalStep)
1077 fPhysIntLength *= -1;
1078 if(fPhysIntLength < proposedTimeStep)
1080 proposedTimeStep = fPhysIntLength;
1081 fPostStepAtTimeDoItProcTriggered = np;
1082 processWithPostStepGivenByTimeStep = fpCurrentProcess;
1089 fPostStepDoItProcTriggered =
G4int(np);
1102 fpCurrentProcess =
dynamic_cast<G4VITProcess*
>((*fpProcessInfo
1104 if(fpCurrentProcess == 0)
continue;
1113 safetyProposedToAndByProcess,
1121 if(fPhysIntLength < fpState->fPhysicalStep)
1139 if(!fpTransportation)
1142 exceptionDescription <<
"No transportation process found ";
1143 G4Exception(
"G4ITStepProcessor::DoDefinePhysicalStepLength",
1144 "ITStepProcessor0009",
1146 exceptionDescription);
1161 if(!fpTransportation)
1164 exceptionDescription <<
"No transportation process found ";
1165 G4Exception(
"G4ITStepProcessor::DoDefinePhysicalStepLength",
1166 "ITStepProcessor0010",
1168 exceptionDescription);
1176 if(proposedTimeStep < fTimeStep)
1178 if(fPostStepAtTimeDoItProcTriggered < fpProcessInfo->MAXofPostStepLoops)
1189 fTimeStep = proposedTimeStep;
1200 if(fPostStepDoItProcTriggered < fpProcessInfo->MAXofPostStepLoops)
1216 if(safetyProposedToAndByProcess < fpState->fProposedSafety)
1226 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
G4ProcessVector * fpAlongStepGetPhysIntVector
size_t MAXofAlongStepLoops
G4ProcessVector * fpAlongStepDoItVector
G4ProcessVector * fpAtRestGetPhysIntVector
G4ITTransportation * fpTransportation
size_t MAXofPostStepLoops
G4ProcessVector * fpAtRestDoItVector