Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ExceptionHandler Class Reference

#include <G4ExceptionHandler.hh>

+ Inheritance diagram for G4ExceptionHandler:

Public Member Functions

 G4ExceptionHandler ()
 
virtual ~G4ExceptionHandler ()
 
G4bool operator== (const G4ExceptionHandler &right) const
 
G4bool operator!= (const G4ExceptionHandler &right) const
 
virtual G4bool Notify (const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
 
- Public Member Functions inherited from G4VExceptionHandler
 G4VExceptionHandler ()
 
virtual ~G4VExceptionHandler ()
 
G4bool operator== (const G4VExceptionHandler &right) const
 
G4bool operator!= (const G4VExceptionHandler &right) const
 
virtual G4bool Notify (const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)=0
 

Detailed Description

Definition at line 55 of file G4ExceptionHandler.hh.

Constructor & Destructor Documentation

◆ G4ExceptionHandler()

G4ExceptionHandler::G4ExceptionHandler ( )

Definition at line 43 of file G4ExceptionHandler.cc.

43{}

◆ ~G4ExceptionHandler()

G4ExceptionHandler::~G4ExceptionHandler ( )
virtual

Definition at line 45 of file G4ExceptionHandler.cc.

45{}

Member Function Documentation

◆ Notify()

G4bool G4ExceptionHandler::Notify ( const char *  originOfException,
const char *  exceptionCode,
G4ExceptionSeverity  severity,
const char *  description 
)
virtual

Implements G4VExceptionHandler.

Definition at line 66 of file G4ExceptionHandler.cc.

70{
71 static const G4String es_banner =
72 "\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n";
73 static const G4String ee_banner =
74 "\n-------- EEEE -------- G4Exception-END --------- EEEE -------\n";
75 static const G4String ws_banner =
76 "\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n";
77 static const G4String we_banner =
78 "\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n";
79 std::ostringstream message;
80 message << "*** G4Exception : " << exceptionCode << G4endl
81 << " issued by : " << originOfException << G4endl << description
82 << G4endl;
83 G4bool abortionForCoreDump = false;
85 switch(severity)
86 {
87 case FatalException:
88 G4cerr << es_banner << message.str()
89 << "*** Fatal Exception *** core dump ***" << G4endl;
90 DumpTrackInfo();
91 G4cerr << ee_banner << G4endl;
92 abortionForCoreDump = true;
93 break;
95 G4cerr << es_banner << message.str()
96 << "*** Fatal Error In Argument *** core dump ***" << G4endl;
97 DumpTrackInfo();
98 G4cerr << ee_banner << G4endl;
99 abortionForCoreDump = true;
100 break;
101 case RunMustBeAborted:
102 if(aps == G4State_GeomClosed || aps == G4State_EventProc)
103 {
104 G4cerr << es_banner << message.str() << "*** Run Must Be Aborted ***"
105 << G4endl;
106 DumpTrackInfo();
107 G4cerr << ee_banner << G4endl;
109 }
110 abortionForCoreDump = false;
111 break;
113 if(aps == G4State_EventProc)
114 {
115 G4cerr << es_banner << message.str() << "*** Event Must Be Aborted ***"
116 << G4endl;
117 DumpTrackInfo();
118 G4cerr << ee_banner << G4endl;
120 }
121 abortionForCoreDump = false;
122 break;
123 default:
124 G4cout << ws_banner << message.str()
125 << "*** This is just a warning message. ***" << we_banner
126 << G4endl;
127 abortionForCoreDump = false;
128 break;
129 }
130 return abortionForCoreDump;
131}
G4ApplicationState
@ G4State_EventProc
@ G4State_GeomClosed
@ FatalException
@ FatalErrorInArgument
@ RunMustBeAborted
@ EventMustBeAborted
bool G4bool
Definition: G4Types.hh:86
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
virtual void AbortRun(G4bool softAbort=false)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:84
virtual void AbortEvent()
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()

◆ operator!=()

G4bool G4ExceptionHandler::operator!= ( const G4ExceptionHandler right) const

Definition at line 61 of file G4ExceptionHandler.cc.

62{
63 return (this != &right);
64}

◆ operator==()

G4bool G4ExceptionHandler::operator== ( const G4ExceptionHandler right) const

Definition at line 56 of file G4ExceptionHandler.cc.

57{
58 return (this == &right);
59}

The documentation for this class was generated from the following files: