Geant4 11.2.2
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 ()=default
 
 ~G4ExceptionHandler () override=default
 
G4bool operator== (const G4ExceptionHandler &right) const
 
G4bool operator!= (const G4ExceptionHandler &right) const
 
 G4ExceptionHandler (const G4ExceptionHandler &)=delete
 
G4ExceptionHandleroperator= (const G4ExceptionHandler &)=delete
 
G4bool Notify (const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description) override
 
- Public Member Functions inherited from G4VExceptionHandler
 G4VExceptionHandler ()
 
virtual ~G4VExceptionHandler ()=default
 
G4bool operator== (const G4VExceptionHandler &right) const
 
G4bool operator!= (const G4VExceptionHandler &right) const
 

Detailed Description

Definition at line 44 of file G4ExceptionHandler.hh.

Constructor & Destructor Documentation

◆ G4ExceptionHandler() [1/2]

G4ExceptionHandler::G4ExceptionHandler ( )
default

◆ ~G4ExceptionHandler()

G4ExceptionHandler::~G4ExceptionHandler ( )
overridedefault

◆ G4ExceptionHandler() [2/2]

G4ExceptionHandler::G4ExceptionHandler ( const G4ExceptionHandler & )
delete

Member Function Documentation

◆ Notify()

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

Implements G4VExceptionHandler.

Definition at line 65 of file G4ExceptionHandler.cc.

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

◆ operator!=()

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

Definition at line 59 of file G4ExceptionHandler.cc.

60{
61 return (this != &right);
62}

◆ operator=()

G4ExceptionHandler & G4ExceptionHandler::operator= ( const G4ExceptionHandler & )
delete

◆ operator==()

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

Definition at line 53 of file G4ExceptionHandler.cc.

54{
55 return (this == &right);
56}

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