64 return (
this == &right);
70 return (
this != &right);
78 "\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n";
80 "\n-------- EEEE -------- G4Exception-END --------- EEEE -------\n";
82 "\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n";
84 "\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n";
85 std::ostringstream message;
86 message <<
"*** G4Exception : " << exceptionCode <<
G4endl
87 <<
" issued by : " << originOfException <<
G4endl << description <<
G4endl;
88 G4bool abortionForCoreDump =
false;
92 G4cerr << es_banner << message.str() <<
"*** Fatal Exception *** core dump ***" <<
G4endl;
95 abortionForCoreDump =
true;
98 G4cerr << es_banner << message.str() <<
"*** Fatal Error In Argument *** core dump ***"
102 abortionForCoreDump =
true;
106 G4cerr << es_banner << message.str() <<
"*** Run Must Be Aborted ***" <<
G4endl;
111 abortionForCoreDump =
false;
115 G4cerr << es_banner << message.str() <<
"*** Event Must Be Aborted ***" <<
G4endl;
120 abortionForCoreDump =
false;
123 if(IfPrint(exceptionCode))
125 std::ostringstream wmessage;
126 wmessage <<
"*** G4Exception : " << exceptionCode <<
G4endl
127 <<
" issued by : " << originOfException <<
G4endl << description <<
G4endl;
128 G4cout << ws_banner << wmessage.str() <<
"*** This is just a warning message. ***" << we_banner
131 abortionForCoreDump =
false;
134 abortionForCoreDump =
false;
137 return abortionForCoreDump;
141void G4ExceptionHandler::DumpTrackInfo()
143 const G4Track* theTrack =
nullptr;
144 const G4Step* theStep =
nullptr;
152 if (theTrack ==
nullptr) {
153 G4cerr <<
" **** Track information is not available at this moment" <<
G4endl;
156 G4cerr <<
"G4Track (" << theTrack <<
") - track ID = " << theTrack->
GetTrackID()
164 G4cerr <<
" - creator process : not available" <<
G4endl;
170 if (theStep ==
nullptr) {
171 G4cerr <<
" **** Step information is not available at this moment" <<
G4endl;
178 G4cerr <<
" - Physical volume : ";
185 G4cerr <<
" (material not available)";
189 G4cerr <<
"not available";
193 G4cerr <<
" - defined by : "
201 G4cerr <<
" - Physical volume : ";
208 G4cerr <<
" (material not available)";
212 G4cerr <<
"not available";
216 G4cerr <<
" - defined by : "
223 G4cerr <<
" *** Note: Step information might not be properly updated." <<
G4endl;
228G4bool G4ExceptionHandler::IfPrint(
const char* errCode)
230 static const G4String ws_banner =
231 "\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n";
232 static const G4String we_banner =
233 "\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n";
234 auto ec = fWarnCount.find(errCode);
235 if(ec!=fWarnCount.end())
242 std::ostringstream wmessage;
243 wmessage <<
"*** G4Exception " << errCode <<
" has reached the maximum number." <<
G4endl
244 <<
"This warning message won't be displayed any longer.";
245 G4cout << ws_banner << wmessage.str() << we_banner
252 if(fTotalWarnCount>0)
255 if(fTotalWarnCount==0)
257 std::ostringstream wmessage;
258 wmessage <<
"*** G4Exception warning messages reached the maximum number." <<
G4endl
259 <<
"Warning messages won't be displayed any longer.";
260 G4cout << ws_banner << wmessage.str() << we_banner
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4bool operator==(const G4ExceptionHandler &right) const
G4bool operator!=(const G4ExceptionHandler &right) const
G4bool Notify(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description) override
~G4ExceptionHandler() override
const G4String & GetName() const
const G4String & GetParticleName() const
static G4RunManagerKernel * GetRunManagerKernel()
G4TrackingManager * GetTrackingManager() const
virtual void AbortRun(G4bool softAbort=false)
static G4RunManager * GetRunManager()
virtual void AbortEvent()
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
G4StepStatus GetStepStatus() const
const G4VProcess * GetProcessDefinedStep() const
G4Material * GetMaterial() const
const G4ThreeVector & GetPosition() const
G4VPhysicalVolume * GetPhysicalVolume() const
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
const G4ParticleDefinition * GetParticleDefinition() const
const G4VProcess * GetCreatorProcess() const
const G4String GetCreatorModelName() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4int GetParentID() const
G4SteppingManager * GetSteppingManager() const
const G4String & GetName() const
const G4String & GetProcessName() const