74 fEndPointDistance( -1.0 ),
75 fShortStepOptimisation(
false )
107 if ( !pNullTouchableHandle)
118 G4cout <<
" G4Transportation constructor> set fShortStepOptimisation to ";
141 outStr <<
" G4Transportation: Statistics for looping particles " <<
G4endl;
144 outStr <<
" Sum of energy of looping tracks killed: "
147 <<
" Sum of energy of non-electrons : "
155 outStr <<
" Max energy of non-electron looper killed: "
162 outStr <<
" Sum of energy of loopers 'saved': "
164 outStr <<
" Sum of energy of unstable loopers 'saved': "
170 outStr <<
" No looping tracks found or killed. " <<
G4endl;
188 G4double geometryStepLength= -1.0, newSafety= -1.0;
223 currentSafety = 0.0 ;
248 G4bool eligibleEM = (particleCharge != 0.0)
252 if( (fieldMgr!=
nullptr) && (eligibleEM||eligibleGrav) )
264 fieldExertsForce = eligibleEM
272 if( !fieldExertsForce )
279 geometryStepLength = currentMinimumStep ;
292 fPreviousSftOrigin = startPosition ;
296 currentSafety = newSafety ;
302 geometryStepLength = linearStepLength ;
307 geometryStepLength = currentMinimumStep ;
354 if( currentMinimumStep > 0 )
370 geometryStepLength =
std::min( lengthAlongCurve, currentMinimumStep );
374 fPreviousSftOrigin = startPosition ;
380 geometryStepLength = lengthAlongCurve= 0.0 ;
423 G4double absEdiff = std::fabs(startEnergy- endEnergy);
431 if( std::fabs(startEnergy- endEnergy) >
perThousand * endEnergy )
436 if( (no_large_ediff% warnModulo) == 0 )
440 message <<
"Energy change in Step is above 1^-3 relative value. "
442 <<
" Relative change in 'tracking' step = "
443 << std::setw(15) << (endEnergy-startEnergy)/startEnergy
445 <<
" Starting E= " << std::setw(12) << startEnergy /
MeV
447 <<
" Ending E= " << std::setw(12) << endEnergy /
MeV
449 <<
"Energy has been corrected -- however, review"
450 <<
" field propagation parameters for accuracy." <<
G4endl;
452 || (no_large_ediff == warnModulo * moduloFactor) )
454 message <<
"These include EpsilonStepMax(/Min) in G4FieldManager " << G4endl
455 <<
"which determine fractional error per step for integrated quantities. " << G4endl
456 <<
"Note also the influence of the permitted number of integration steps."
459 message <<
"Bad 'endpoint'. Energy change detected and corrected."
461 <<
"Has occurred already " << no_large_ediff <<
" times.";
464 if( no_large_ediff == warnModulo * moduloFactor )
466 warnModulo *= moduloFactor;
484 if( currentMinimumStep == 0.0 )
494 if( particleCharge != 0.0 )
498 currentSafety = endSafety ;
508 #ifdef G4DEBUG_TRANSPORT
510 G4cout <<
"***G4Transportation::AlongStepGPIL ** " <<
G4endl ;
512 <<
" and it returned safety= " << endSafety <<
G4endl ;
514 <<
" to obtain pseudo-safety= " << currentSafety <<
G4endl ;
518 G4cout <<
"***G4Transportation::AlongStepGPIL ** " <<
G4endl ;
519 G4cout <<
" Avoiding call to ComputeSafety : " <<
G4endl;
528 return geometryStepLength ;
540 const char *methodName=
"AlongStepDoIt";
570 if ( initialVelocity > 0.0 ) { deltaTime = stepLength/initialVelocity; }
605 if( (candidateForEnd && stable) || (unstableAndKillable && unstableForEnd) )
610 G4int particlePDG= particleType->GetPDGEncoding();
611 const G4int electronPDG= 11;
622 if( particleType->GetPDGEncoding() != electronPDG )
638 noCallsASDI, methodName );
653 G4cout <<
" " << methodName
654 <<
" Particle is looping but is saved ..." <<
G4endl
656 <<
" No of calls to = " << noCallsASDI <<
G4endl;
719 LocateGlobalPointAndUpdateTouchableHandle( track.
GetPosition(),
780 if ( pNewVol!=0 && pNewMaterialCutsCouple!=0
781 && pNewMaterialCutsCouple->
GetMaterial()!=pNewMaterial )
785 pNewMaterialCutsCouple =
907 G4int maxTrials = 10;
921 G4int maxTrials = 30;
933 const char*
message=
"Logger object missing from G4Transportation object";
956 G4int oldPrec= outStr.precision(6);
958 outStr <<
G4endl << indent << GetProcessName() <<
": ";
960 outStr <<
" Parameters for looping particles: " <<
G4endl
961 <<
" warning-E = " << fThreshold_Warning_Energy /
CLHEP::MeV <<
" MeV " <<
G4endl
962 <<
" important E = " << fThreshold_Important_Energy /
CLHEP::MeV <<
" MeV " <<
G4endl
963 <<
" thresholdTrials " << fThresholdTrials <<
G4endl;
964 outStr.precision(oldPrec);