59 G4cout<<
"G4SteppingManager::GetProcessNumber: is called track="
66 G4cerr <<
"ERROR - G4SteppingManager::GetProcessNumber()" <<
G4endl
67 <<
" ProcessManager is NULL for particle = "
70 G4Exception(
"G4SteppingManager::GetProcessNumber()",
"Tracking0011",
80 G4cout <<
"G4SteppingManager::GetProcessNumber: #ofAtRest="
81 << MAXofAtRestLoops <<
G4endl;
89 G4cout <<
"G4SteppingManager::GetProcessNumber:#ofAlongStp="
90 << MAXofAlongStepLoops <<
G4endl;
98 G4cout <<
"G4SteppingManager::GetProcessNumber: #ofPostStep="
99 << MAXofPostStepLoops <<
G4endl;
102 if (SizeOfSelectedDoItVector<MAXofAtRestLoops ||
103 SizeOfSelectedDoItVector<MAXofAlongStepLoops ||
104 SizeOfSelectedDoItVector<MAXofPostStepLoops )
106 G4cerr <<
"ERROR - G4SteppingManager::GetProcessNumber()" <<
G4endl
107 <<
" SizeOfSelectedDoItVector= " << SizeOfSelectedDoItVector
108 <<
" ; is smaller then one of MAXofAtRestLoops= "
109 << MAXofAtRestLoops <<
G4endl
110 <<
" or MAXofAlongStepLoops= " << MAXofAlongStepLoops
111 <<
" or MAXofPostStepLoops= " << MAXofPostStepLoops <<
G4endl;
112 G4Exception(
"G4SteppingManager::GetProcessNumber()",
114 "The array size is smaller than the actual No of processes.");
127 void G4SteppingManager::DefinePhysicalStepLength()
162 fPostStepDoItProcTriggered = MAXofPostStepLoops;
164 for(
size_t np=0; np < MAXofPostStepLoops; np++){
165 fCurrentProcess = (*fPostStepGetPhysIntVector)(np);
166 if (fCurrentProcess== 0) {
171 physIntLength = fCurrentProcess->
172 PostStepGPIL( *fTrack,
180 switch (fCondition) {
189 G4Exception(
"G4SteppingManager::DefinePhysicalStepLength()",
"Tracking1001",
FatalException,
"This feature no more supported");
193 (*fSelectedPostStepDoItVector)[np] =
Forced;
206 for(
size_t nrest=np+1; nrest < MAXofPostStepLoops; nrest++){
207 (*fSelectedPostStepDoItVector)[nrest] =
InActivated;
212 if(physIntLength < PhysicalStep ){
213 PhysicalStep = physIntLength;
215 fPostStepDoItProcTriggered =
G4int(np);
224 if (fPostStepDoItProcTriggered<MAXofPostStepLoops) {
225 if ((*fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] ==
227 (*fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] =
234 G4double safetyProposedToAndByProcess = proposedSafety;
236 for(
size_t kp=0; kp < MAXofAlongStepLoops; kp++){
237 fCurrentProcess = (*fAlongStepGetPhysIntVector)[kp];
238 if (fCurrentProcess== 0)
continue;
241 physIntLength = fCurrentProcess->
242 AlongStepGPIL( *fTrack, fPreviousStepSize,
244 safetyProposedToAndByProcess,
250 if(physIntLength < PhysicalStep){
251 PhysicalStep = physIntLength;
262 if(kp == MAXofAlongStepLoops-1)
269 if (safetyProposedToAndByProcess < proposedSafety)
271 proposedSafety = safetyProposedToAndByProcess;
274 safetyProposedToAndByProcess = proposedSafety;
281void G4SteppingManager::InvokeAtRestDoItProcs()
287 G4double lifeTime, shortestLifeTime;
289 fAtRestDoItProcTriggered = 0;
292 unsigned int NofInactiveProc=0;
293 for(
size_t ri=0 ; ri < MAXofAtRestLoops ; ri++ ){
294 fCurrentProcess = (*fAtRestGetPhysIntVector)[ri];
295 if (fCurrentProcess== 0) {
302 fCurrentProcess->
AtRestGPIL( *fTrack, &fCondition );
304 if(fCondition==
Forced && fCurrentProcess){
305 (*fSelectedAtRestDoItVector)[ri] =
Forced;
309 if(lifeTime < shortestLifeTime ){
310 shortestLifeTime = lifeTime;
311 fAtRestDoItProcTriggered =
G4int(ri);
312 (*fSelectedAtRestDoItVector)[fAtRestDoItProcTriggered] =
NotForced;
319 if(NofInactiveProc==MAXofAtRestLoops){
320 G4cerr <<
"ERROR - G4SteppingManager::InvokeAtRestDoItProcs()" <<
G4endl
321 <<
" No AtRestDoIt process is active!" <<
G4endl;
330 for(
size_t np=0; np < MAXofAtRestLoops; np++){
335 if( (*fSelectedAtRestDoItVector)[MAXofAtRestLoops-np-1] !=
InActivated){
337 fCurrentProcess = (*fAtRestDoItVector)[np];
339 = fCurrentProcess->
AtRestDoIt( *fTrack, *fStep);
354 for(
G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
355 tempSecondaryTrack = fParticleChange->
GetSecondary(DSecLoop);
358 { ApplyProductionCut(tempSecondaryTrack); }
372 fSecondary->push_back( tempSecondaryTrack );
373 fN2ndariesAtRestDoIt++;
375 delete tempSecondaryTrack;
378 fSecondary->push_back( tempSecondaryTrack );
379 fN2ndariesAtRestDoIt++;
385 fParticleChange->
Clear();
396void G4SteppingManager::InvokeAlongStepDoItProcs()
407 for(
size_t ci=0 ; ci<MAXofAlongStepLoops ; ci++ ){
408 fCurrentProcess = (*fAlongStepDoItVector)[ci];
409 if (fCurrentProcess== 0)
continue;
428 for(
G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
429 tempSecondaryTrack = fParticleChange->
GetSecondary(DSecLoop);
432 { ApplyProductionCut(tempSecondaryTrack); }
446 fSecondary->push_back( tempSecondaryTrack );
447 fN2ndariesAlongStepDoIt++;
449 delete tempSecondaryTrack;
452 fSecondary->push_back( tempSecondaryTrack );
453 fN2ndariesAlongStepDoIt++;
462 fParticleChange->
Clear();
477void G4SteppingManager::InvokePostStepDoItProcs()
482 for(
size_t np=0; np < MAXofPostStepLoops; np++){
487 G4int Cond = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np-1];
507 for(
size_t np1=np+1; np1 < MAXofPostStepLoops; np1++){
508 G4int Cond2 = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np1-1];
520void G4SteppingManager::InvokePSDIP(
size_t np)
522 fCurrentProcess = (*fPostStepDoItVector)[np];
544 for(
G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
545 tempSecondaryTrack = fParticleChange->
GetSecondary(DSecLoop);
548 { ApplyProductionCut(tempSecondaryTrack); }
562 fSecondary->push_back( tempSecondaryTrack );
563 fN2ndariesPostStepDoIt++;
565 delete tempSecondaryTrack;
568 fSecondary->push_back( tempSecondaryTrack );
569 fN2ndariesPostStepDoIt++;
577 fParticleChange->
Clear();
584void G4SteppingManager::ApplyProductionCut(
G4Track* aSecondary)
586 G4bool tBelowCutEnergyAndSafety =
false;
589 if (tPtclIdx<0) {
return; }
598 tBelowCutEnergyAndSafety =
true;
605 tBelowCutEnergyAndSafety = (currentRange < CalculateSafety() );
609 if( tBelowCutEnergyAndSafety )
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
G4double GetCharge() const
static G4LossTableManager * Instance()
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4ProcessManager * GetProcessManager() const
G4int GetPDGEncoding() const
G4bool GetApplyCutsFlag() const
const G4String & GetParticleName() const
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVector * GetPostStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
static G4ProductionCutsTable * GetProductionCutsTable()
G4int GetCoupleIndex(const G4MaterialCutsCouple *aCouple) const
static G4int GetIndex(const G4String &name)
void SetSafety(const G4double aValue)
void SetStepStatus(const G4StepStatus aValue)
void SetProcessDefinedStep(const G4VProcess *aValue)
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
void SetStepLength(G4double value)
void AddTotalEnergyDeposit(G4double value)
G4StepPoint * GetPostStepPoint() const
G4TrackStatus GetTrackStatus() const
void SetTrackStatus(const G4TrackStatus aTrackStatus)
void SetStepLength(G4double value)
G4VPhysicalVolume * GetNextVolume() const
G4ParticleDefinition * GetDefinition() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetKineticEnergy() const
void SetKineticEnergy(const G4double aValue)
G4bool IsGoodForTracking() const
void SetParentID(const G4int aValue)
void SetCreatorProcess(const G4VProcess *aValue)
virtual G4Step * UpdateStepForAlongStep(G4Step *Step)
virtual G4Step * UpdateStepForAtRest(G4Step *Step)
virtual G4Step * UpdateStepForPostStep(G4Step *Step)
G4int GetNumberOfSecondaries() const
G4Track * GetSecondary(G4int anIndex) const
G4TrackStatus GetTrackStatus() const
virtual G4VParticleChange * AtRestDoIt(const G4Track &track, const G4Step &stepData)=0
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)=0
G4double AtRestGPIL(const G4Track &track, G4ForceCondition *condition)
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)=0
virtual void AlongStepDoItOneByOne()=0
virtual void DPSLPostStep()=0
virtual void DPSLAlongStep()=0
virtual void PostStepDoItOneByOne()=0
virtual void DPSLStarted()=0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)