6 #include "G4EventManager.hh"
7 #include "G4StateManager.hh"
24 G4ExceptionSeverity severity,
const char*
description)
27 cout <<
"*** G4Exception : " << exceptionCode <<
" issued by " << exceptionOrigin << endl;
28 cout <<
" " << description << endl;
29 bool abortionForCoreDump =
false;
30 G4ApplicationState aps = G4StateManager::GetStateManager()->GetCurrentState();
34 if ( aps==G4State_EventProc && exceptionOrigin==
string(
"G4HadronicProcess") )
36 cout <<
"*** Fatal exception *** " << endl;
37 throw SimG4Exception(
"SimG4CoreApplication: Bug in G4HadronicProcess" ) ;
41 cout <<
"*** Fatal exception *** core dump ***" << endl;
42 abortionForCoreDump =
true;
49 case FatalErrorInArgument:
50 cout <<
"*** Fatal error in argument *** core dump ***" << endl;
51 abortionForCoreDump =
true;
53 case RunMustBeAborted:
54 if(aps==G4State_GeomClosed || aps==G4State_EventProc)
56 cout <<
"*** Run must be aborted " << endl;
60 abortionForCoreDump =
false;
62 case EventMustBeAborted:
63 if(aps==G4State_EventProc)
65 cout <<
"*** Event must be aborted " << endl;
93 throw SimG4Exception(
"SimG4CoreApplication: G4Navigator:StuckTrack detected" ) ;
95 abortionForCoreDump =
false;
98 cout <<
"*** This is just a warning message " << endl;
99 abortionForCoreDump =
false;
103 return abortionForCoreDump;
virtual ~ExceptionHandler()
void abortRun(bool softAbort=false)
virtual bool Notify(const char *exceptionOrigin, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)