60 G4cout<<
"G4SteppingManager::GetProcessNumber: is called track="
67 G4cerr <<
"ERROR - G4SteppingManager::GetProcessNumber()" << G4endl
68 <<
" ProcessManager is NULL for particle = "
71 G4Exception(
"G4SteppingManager::GetProcessNumber()",
"Tracking0011",
81 G4cout <<
"G4SteppingManager::GetProcessNumber: #ofAtRest="
82 << MAXofAtRestLoops <<
G4endl;
90 G4cout <<
"G4SteppingManager::GetProcessNumber:#ofAlongStp="
91 << MAXofAlongStepLoops <<
G4endl;
99 G4cout <<
"G4SteppingManager::GetProcessNumber: #ofPostStep="
100 << MAXofPostStepLoops <<
G4endl;
103 if (SizeOfSelectedDoItVector<MAXofAtRestLoops ||
104 SizeOfSelectedDoItVector<MAXofAlongStepLoops ||
105 SizeOfSelectedDoItVector<MAXofPostStepLoops )
107 G4cerr <<
"ERROR - G4SteppingManager::GetProcessNumber()" << G4endl
108 <<
" SizeOfSelectedDoItVector= " << SizeOfSelectedDoItVector
109 <<
" ; is smaller then one of MAXofAtRestLoops= "
110 << MAXofAtRestLoops << G4endl
111 <<
" or MAXofAlongStepLoops= " << MAXofAlongStepLoops
112 <<
" or MAXofPostStepLoops= " << MAXofPostStepLoops <<
G4endl;
113 G4Exception(
"G4SteppingManager::GetProcessNumber()",
115 "The array size is smaller than the actual No of processes.");
128 void G4SteppingManager::DefinePhysicalStepLength()
163 fPostStepDoItProcTriggered = MAXofPostStepLoops;
165 for(
size_t np=0; np < MAXofPostStepLoops; np++){
166 fCurrentProcess = (*fPostStepGetPhysIntVector)(np);
167 if (fCurrentProcess== 0) {
172 physIntLength = fCurrentProcess->
173 PostStepGPIL( *fTrack,
181 switch (fCondition) {
190 G4Exception(
"G4SteppingManager::DefinePhysicalStepLength()",
"Tracking1001",
FatalException,
"This feature no more supported");
194 (*fSelectedPostStepDoItVector)[np] =
Forced;
207 for(
size_t nrest=np+1; nrest < MAXofPostStepLoops; nrest++){
208 (*fSelectedPostStepDoItVector)[nrest] =
InActivated;
213 if(physIntLength < PhysicalStep ){
214 PhysicalStep = physIntLength;
216 fPostStepDoItProcTriggered =
G4int(np);
225 if (fPostStepDoItProcTriggered<MAXofPostStepLoops) {
226 if ((*fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] ==
228 (*fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] =
235 G4double safetyProposedToAndByProcess = proposedSafety;
237 for(
size_t kp=0; kp < MAXofAlongStepLoops; kp++){
238 fCurrentProcess = (*fAlongStepGetPhysIntVector)[kp];
239 if (fCurrentProcess== 0)
continue;
242 physIntLength = fCurrentProcess->
243 AlongStepGPIL( *fTrack, fPreviousStepSize,
245 safetyProposedToAndByProcess,
251 if(physIntLength < PhysicalStep){
252 PhysicalStep = physIntLength;
263 if(kp == MAXofAlongStepLoops-1)
270 if (safetyProposedToAndByProcess < proposedSafety)
272 proposedSafety = safetyProposedToAndByProcess;
275 safetyProposedToAndByProcess = proposedSafety;
282 void G4SteppingManager::InvokeAtRestDoItProcs()
288 G4double lifeTime, shortestLifeTime;
290 fAtRestDoItProcTriggered = 0;
293 unsigned int NofInactiveProc=0;
294 for(
size_t ri=0 ; ri < MAXofAtRestLoops ; ri++ ){
295 fCurrentProcess = (*fAtRestGetPhysIntVector)[ri];
296 if (fCurrentProcess== 0) {
303 fCurrentProcess->
AtRestGPIL( *fTrack, &fCondition );
307 if(fCondition==
Forced && fCurrentProcess){
308 (*fSelectedAtRestDoItVector)[ri] =
Forced;
312 if(lifeTime < shortestLifeTime ){
313 shortestLifeTime = lifeTime;
314 fAtRestDoItProcTriggered =
G4int(ri);
319 (*fSelectedAtRestDoItVector)[fAtRestDoItProcTriggered] =
NotForced;
323 if(NofInactiveProc==MAXofAtRestLoops){
324 G4Exception(
"G4SteppingManager::InvokeAtRestDoItProcs()",
"Tracking0013",
332 for(
size_t np=0; np < MAXofAtRestLoops; np++){
337 if( (*fSelectedAtRestDoItVector)[MAXofAtRestLoops-np-1] !=
InActivated){
339 fCurrentProcess = (*fAtRestDoItVector)[np];
341 = fCurrentProcess->
AtRestDoIt( *fTrack, *fStep);
356 for(
G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
357 tempSecondaryTrack = fParticleChange->
GetSecondary(DSecLoop);
360 { ApplyProductionCut(tempSecondaryTrack); }
376 fSecondary->push_back( tempSecondaryTrack );
377 fN2ndariesAtRestDoIt++;
379 delete tempSecondaryTrack;
382 fSecondary->push_back( tempSecondaryTrack );
383 fN2ndariesAtRestDoIt++;
389 fParticleChange->
Clear();
400 void G4SteppingManager::InvokeAlongStepDoItProcs()
411 for(
size_t ci=0 ; ci<MAXofAlongStepLoops ; ci++ ){
412 fCurrentProcess = (*fAlongStepDoItVector)[ci];
413 if (fCurrentProcess== 0)
continue;
432 for(
G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
433 tempSecondaryTrack = fParticleChange->
GetSecondary(DSecLoop);
436 { ApplyProductionCut(tempSecondaryTrack); }
452 fSecondary->push_back( tempSecondaryTrack );
453 fN2ndariesAlongStepDoIt++;
455 delete tempSecondaryTrack;
458 fSecondary->push_back( tempSecondaryTrack );
459 fN2ndariesAlongStepDoIt++;
468 fParticleChange->
Clear();
483 void G4SteppingManager::InvokePostStepDoItProcs()
488 for(
size_t np=0; np < MAXofPostStepLoops; np++){
493 G4int Cond = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np-1];
513 for(
size_t np1=np+1; np1 < MAXofPostStepLoops; np1++){
514 G4int Cond2 = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np1-1];
526 void G4SteppingManager::InvokePSDIP(
size_t np)
528 fCurrentProcess = (*fPostStepDoItVector)[np];
550 for(
G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
551 tempSecondaryTrack = fParticleChange->
GetSecondary(DSecLoop);
554 { ApplyProductionCut(tempSecondaryTrack); }
570 fSecondary->push_back( tempSecondaryTrack );
571 fN2ndariesPostStepDoIt++;
573 delete tempSecondaryTrack;
576 fSecondary->push_back( tempSecondaryTrack );
577 fN2ndariesPostStepDoIt++;
585 fParticleChange->
Clear();
592 void G4SteppingManager::ApplyProductionCut(
G4Track* aSecondary)
594 G4bool tBelowCutEnergyAndSafety =
false;
597 if (tPtclIdx<0) {
return; }
606 tBelowCutEnergyAndSafety =
true;
613 tBelowCutEnergyAndSafety = (currentRange < CalculateSafety() );
617 if( tBelowCutEnergyAndSafety )
void SetTrackStatus(const G4TrackStatus aTrackStatus)
G4ParticleDefinition * GetDefinition() const
void SetStepLength(G4double value)
G4int GetNumberOfSecondaries() const
virtual G4Step * UpdateStepForAlongStep(G4Step *Step)
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
static G4LossTableManager * Instance()
G4Track * GetSecondary(G4int anIndex) const
static G4int GetIndex(const G4String &name)
void SetProcessDefinedStep(const G4VProcess *aValue)
virtual void PostStepDoItOneByOne()=0
const G4DynamicParticle * GetDynamicParticle() const
G4TrackStatus GetTrackStatus() const
G4int GetPDGEncoding() const
G4ParticleDefinition * GetGenericIon() const
G4ProcessManager * GetProcessManager() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
void SetStepStatus(const G4StepStatus aValue)
const G4String & GetParticleName() const
G4bool IsGeneralIon() const
void SetCreatorProcess(const G4VProcess *aValue)
G4VPhysicalVolume * GetNextVolume() const
G4double AtRestGPIL(const G4Track &track, G4ForceCondition *condition)
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4double GetKineticEnergy() const
virtual void DPSLAlongStep()=0
G4GLOB_DLL std::ostream G4cout
virtual void DPSLPostStep()=0
void SetStepLength(G4double value)
G4int GetCoupleIndex(const G4MaterialCutsCouple *aCouple) const
G4double GetCharge() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4ProductionCutsTable * GetProductionCutsTable()
static G4ParticleTable * GetParticleTable()
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)=0
virtual void AlongStepDoItOneByOne()=0
void SetParentID(const G4int aValue)
G4StepPoint * GetPostStepPoint() const
void AddTotalEnergyDeposit(G4double value)
G4bool IsGoodForTracking() const
G4bool GetApplyCutsFlag() const
G4TrackStatus GetTrackStatus() const
void SetKineticEnergy(const G4double aValue)
virtual G4Step * UpdateStepForPostStep(G4Step *Step)
void SetSafety(const G4double aValue)
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)=0
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
virtual G4Step * UpdateStepForAtRest(G4Step *Step)
virtual void DPSLStarted()=0
G4GLOB_DLL std::ostream G4cerr
virtual G4VParticleChange * AtRestDoIt(const G4Track &track, const G4Step &stepData)=0
G4ProcessVector * GetPostStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const