44 : fClassName(className), fVerbose(verbosity),
45 fThldWarningEnergy(0.), fThldImportantEnergy(0.), fThldTrials(0)
51 : fClassName(className), fVerbose(verbosity),
52 fThldWarningEnergy(0.), fThldImportantEnergy(0.), fThldTrials(0)
77 G4cout << className <<
": Current values for thresholds related to "
78 <<
" the killing of looping tracks: " <<
G4endl
80 <<
" ( below this tracks are killed without warning ) " <<
G4endl
82 <<
" ( above this tracks are given multiple chances ) " <<
G4endl
84 <<
" 'important' tracks, i.e. those above 'important' energy "
96 const char* methodName
99 static std::atomic<unsigned int> numAdviceExcessSteps(0);
100 constexpr double gramPerCm3 = gram / ( centimeter * centimeter * centimeter ) ;
101 std::ostringstream msg;
104 msg <<
" Transportation is killing track that is looping or stuck. " <<
G4endl
108 <<
" MeV energy ( pre-Step = " << preStepEn <<
" ) " <<
G4endl;
114 msg <<
" is in volume '" << physVolume->
GetName() <<
"', ";
117 msg <<
" its material is '" << material->GetName() <<
"'";
118 msg <<
" with density = " << material->GetDensity() / gramPerCm3
123 msg <<
" unable to obtain material information (including density.) ";
128 <<
" Length of this step = " << stepData.
GetStepLength() / mm <<
" mm "
130 <<
" Number of propagation trials = " << numTrials
135 msg <<
" ( Number of *calls* of Transport/AlongStepDoIt = " << noCalls <<
" )" <<
G4endl;
137 const G4int numPrints= 5;
138 if( numAdviceExcessSteps++ < numPrints )
140 msg <<
" =============== Recommendations / advice ====================" <<
G4endl;
141 msg <<
" Recommendations to address this issue (Transport-001-ExcessSteps)" <<
G4endl;
142 msg <<
" This warning is controlled by the SetThresholdWarningEnergy "
143 <<
" method of G4Transportation. " <<
G4endl
144 <<
" Current value of 'warning' threshold= "
146 msg <<
" - If 'unimportant' particles (with energy low enough not to matter in your "
147 <<
" application, then increase its value. " <<
G4endl;
148 msg <<
" - If particles of high-enough energy to be important are being "
149 <<
" killed, you can " <<
G4endl
150 <<
" a) Increase the trial steps using the method SetThresholdTrials(). "
151 <<
" Particles above the 'important' threshold " <<
G4endl
152 <<
" will be given this many 'chances'."
155 <<
" b) Increase the energy which you consider 'important' (above this they are"
156 <<
" killed only after extra trials), using the method SetThresholdImportantEnergy() " <<
G4endl
157 <<
" Note: this can incur a potentially high cost in extra simulation time "
158 <<
" if more tracks require very large number of integration steps . " <<
G4endl
159 <<
" c) investigate alternative integration methods " <<
G4endl
160 <<
" e.g. Helical methods for uniform or almost uniform fields"
161 <<
" or else higher order RK methods such as DormandPrince78 "
163 msg <<
" This information is provided " << numPrints <<
" times. Current count: "
164 << numAdviceExcessSteps <<
" / " << numPrints <<
G4endl;
165 msg <<
" =============================================================" <<
G4endl;
167 const G4String fullMethodName= fClassName +
"::" + methodName;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
G4Material * GetMaterial() const
const G4String & GetName() const
const G4String & GetParticleName() const
G4double GetKineticEnergy() const
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
const G4ParticleDefinition * GetParticleDefinition() const
G4VPhysicalVolume * GetVolume() const
const G4ThreeVector & GetPosition() const
G4int GetCurrentStepNumber() const
G4ThreeVector GetMomentum() const
G4double GetKineticEnergy() const
G4TransportationLogger(const G4String &className, G4int verbosity)
void SetThresholdWarningEnergy(G4double val)
void SetThresholdImportantEnergy(G4double val)
~G4TransportationLogger()
G4double GetThresholdImportantEnergy() const
void SetThresholdTrials(G4int maxNoTrials)
G4double GetThresholdTrials() const
G4double GetThresholdWarningEnergy() const
void SetThresholds(G4double newEnWarn, G4double importantEnergy, G4int newMaxTrials)
void ReportLoopingTrack(const G4Track &track, const G4Step &stepInfo, G4int numTrials, G4long noCalls, const char *methodName) const
void ReportLooperThresholds(const char *className)
G4LogicalVolume * GetLogicalVolume() const