45 : fClassName(className), fVerbose(verbosity),
46 fThldWarningEnergy(0.), fThldImportantEnergy(0.), fThldTrials(0)
52 : fClassName(className), fVerbose(verbosity),
53 fThldWarningEnergy(0.), fThldImportantEnergy(0.), fThldTrials(0)
81 const char* methodName
84 static std::atomic<unsigned int> numAdviceExcessSteps(0);
86 std::ostringstream msg;
89 msg <<
" Transportation is killing track that is looping or stuck. " <<
G4endl
93 <<
" MeV energy ( pre-Step = " << preStepEn <<
" ) " <<
G4endl;
99 msg <<
" is in volume '" << physVolume->
GetName() <<
"', ";
102 msg <<
" its material is '" << material->GetName() <<
"'";
103 msg <<
" with density = " << material->GetDensity() / gramPerCm3
108 msg <<
" unable to obtain material information (including density.) ";
113 <<
" Length of this step = " << stepData.
GetStepLength() /
mm <<
" mm "
115 <<
" Number of propagation trials = " << numTrials
118 <<
" ( Number of *calls* of Transport/AlongStepDoIt = " << noCalls <<
" )"
121 const G4int numPrints= 5;
122 if( numAdviceExcessSteps++ < numPrints )
124 msg <<
" =============== Recommendations / advice ====================" <<
G4endl;
125 msg <<
" Recommendations to address this issue (Transport-001-ExcessSteps)" <<
G4endl;
126 msg <<
" This warning is controlled by the SetThresholdWarningEnergy "
127 <<
" method of G4Transportation. " << G4endl
128 <<
" Current value of 'warning' threshold= "
130 msg <<
" - If 'unimportant' particles (with energy low enough not to matter in your "
131 <<
" application, then increase its value. " <<
G4endl;
132 msg <<
" - If particles of high-enough energy to be important are being "
133 <<
" killed, you can " << G4endl
134 <<
" a) Increase the trial steps using the method SetThresholdTrials(). "
135 <<
" Particles above the 'important' threshold " << G4endl
136 <<
" will be given this many 'chances'."
139 <<
" b) Increase the energy which you consider 'important' (above this they are"
140 <<
" killed only after extra trials), using the method SetThresholdImportantEnergy() " << G4endl
141 <<
" Note: this can incur a potentially high cost in extra simulation time "
142 <<
" if more tracks require very large number of integration steps . " << G4endl
143 <<
" c) investigate alternative integration methods " << G4endl
144 <<
" e.g. Helical methods for uniform or almost uniform fields"
145 <<
" or else higher order RK methods such as DormandPrince78 "
147 msg <<
" This information is provided " << numPrints <<
" times. Current count: "
148 << numAdviceExcessSteps <<
" / " << numPrints <<
G4endl;
149 msg <<
" =============================================================" <<
G4endl;
~G4TransportationLogger()
G4double GetKineticEnergy() const
void SetThresholdTrials(G4int maxNoTrials)
G4LogicalVolume * GetLogicalVolume() const
static constexpr double MeV
void SetThresholds(G4double newEnWarn, G4double importantEnergy, G4int newMaxTrials)
G4StepPoint * GetPreStepPoint() const
static constexpr double mm
const G4String & GetParticleName() const
G4TransportationLogger(const G4String &className, G4int verbosity)
const G4ParticleDefinition * GetParticleDefinition() const
G4int GetCurrentStepNumber() const
void SetThresholdImportantEnergy(G4double val)
G4Material * GetMaterial() const
const G4String & GetName() const
G4ThreeVector GetMomentum() const
G4double GetStepLength() const
const G4ThreeVector & GetPosition() const
G4double GetThresholdWarningEnergy() const
G4double GetKineticEnergy() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void SetThresholdWarningEnergy(G4double val)
static constexpr double centimeter
void ReportLoopingTrack(const G4Track &track, const G4Step &stepInfo, G4int numTrials, G4long noCalls, const char *methodName) const
G4double GetThresholdTrials() const
G4VPhysicalVolume * GetVolume() const
static constexpr double gram