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;
281 void 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 );
306 if(fCondition==
Forced && fCurrentProcess){
307 (*fSelectedAtRestDoItVector)[ri] =
Forced;
311 if(lifeTime < shortestLifeTime ){
312 shortestLifeTime = lifeTime;
313 fAtRestDoItProcTriggered =
G4int(ri);
318 (*fSelectedAtRestDoItVector)[fAtRestDoItProcTriggered] =
NotForced;
322 if(NofInactiveProc==MAXofAtRestLoops){
323 G4Exception(
"G4SteppingManager::InvokeAtRestDoItProcs()",
"Tracking0013",
331 for(
size_t np=0; np < MAXofAtRestLoops; np++){
336 if( (*fSelectedAtRestDoItVector)[MAXofAtRestLoops-np-1] !=
InActivated){
338 fCurrentProcess = (*fAtRestDoItVector)[np];
340 = fCurrentProcess->
AtRestDoIt( *fTrack, *fStep);
355 for(
G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
356 tempSecondaryTrack = fParticleChange->
GetSecondary(DSecLoop);
359 { ApplyProductionCut(tempSecondaryTrack); }
373 fSecondary->push_back( tempSecondaryTrack );
374 fN2ndariesAtRestDoIt++;
376 delete tempSecondaryTrack;
379 fSecondary->push_back( tempSecondaryTrack );
380 fN2ndariesAtRestDoIt++;
386 fParticleChange->
Clear();
397 void G4SteppingManager::InvokeAlongStepDoItProcs()
408 for(
size_t ci=0 ; ci<MAXofAlongStepLoops ; ci++ ){
409 fCurrentProcess = (*fAlongStepDoItVector)[ci];
410 if (fCurrentProcess== 0)
continue;
429 for(
G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
430 tempSecondaryTrack = fParticleChange->
GetSecondary(DSecLoop);
433 { ApplyProductionCut(tempSecondaryTrack); }
447 fSecondary->push_back( tempSecondaryTrack );
448 fN2ndariesAlongStepDoIt++;
450 delete tempSecondaryTrack;
453 fSecondary->push_back( tempSecondaryTrack );
454 fN2ndariesAlongStepDoIt++;
463 fParticleChange->
Clear();
478 void G4SteppingManager::InvokePostStepDoItProcs()
483 for(
size_t np=0; np < MAXofPostStepLoops; np++){
488 G4int Cond = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np-1];
508 for(
size_t np1=np+1; np1 < MAXofPostStepLoops; np1++){
509 G4int Cond2 = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np1-1];
521 void G4SteppingManager::InvokePSDIP(
size_t np)
523 fCurrentProcess = (*fPostStepDoItVector)[np];
545 for(
G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
546 tempSecondaryTrack = fParticleChange->
GetSecondary(DSecLoop);
549 { ApplyProductionCut(tempSecondaryTrack); }
563 fSecondary->push_back( tempSecondaryTrack );
564 fN2ndariesPostStepDoIt++;
566 delete tempSecondaryTrack;
569 fSecondary->push_back( tempSecondaryTrack );
570 fN2ndariesPostStepDoIt++;
578 fParticleChange->
Clear();
585 void G4SteppingManager::ApplyProductionCut(
G4Track* aSecondary)
587 G4bool tBelowCutEnergyAndSafety =
false;
590 if (tPtclIdx<0) {
return; }
599 tBelowCutEnergyAndSafety =
true;
606 tBelowCutEnergyAndSafety = (currentRange < CalculateSafety() );
610 if( tBelowCutEnergyAndSafety )