7 #include "G4EventManager.hh"
8 #include "G4StateManager.hh"
16 : fRunManager(rm),fRunManagerMT(0)
20 : fRunManager(0),fRunManagerMT(rm)
26 const char* exceptionCode,
31 cout <<
"*** G4Exception : " << exceptionCode <<
" issued by " << exceptionOrigin << endl;
32 cout <<
" " << description << endl;
33 bool abortionForCoreDump =
false;
34 G4ApplicationState aps = G4StateManager::GetStateManager()->GetCurrentState();
38 if ( aps==G4State_EventProc && exceptionOrigin==
string(
"G4HadronicProcess") )
40 cout <<
"*** Fatal exception *** " << endl;
41 throw SimG4Exception(
"SimG4CoreApplication: Bug in G4HadronicProcess" ) ;
45 cout <<
"*** Fatal exception *** core dump ***" << endl;
46 abortionForCoreDump =
true;
53 case FatalErrorInArgument:
54 cout <<
"*** Fatal error in argument *** core dump ***" << endl;
55 abortionForCoreDump =
true;
57 case RunMustBeAborted:
58 if(aps==G4State_GeomClosed || aps==G4State_EventProc)
60 cout <<
"*** Run must be aborted " << endl;
64 abortionForCoreDump =
false;
66 case EventMustBeAborted:
67 if(aps==G4State_EventProc)
69 cout <<
"*** Event must be aborted " << endl;
97 throw SimG4Exception(
"SimG4CoreApplication: G4Navigator:StuckTrack detected" ) ;
99 abortionForCoreDump =
false;
102 cout <<
"*** This is just a warning message " << endl;
103 abortionForCoreDump =
false;
107 return abortionForCoreDump;
virtual ~ExceptionHandler()
void abortRun(bool softAbort=false)
void abortRun(bool softAbort=false)
virtual bool Notify(const char *exceptionOrigin, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
RunManagerMT * fRunManagerMT