Geant4 11.1.1
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
 
 G4ExceptionHandler (const G4ExceptionHandler &)=delete
 
G4ExceptionHandleroperator= (const G4ExceptionHandler &)=delete
 
virtual G4bool Notify (const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
 
- Public Member Functions inherited from G4VExceptionHandler
 G4VExceptionHandler ()
 
virtual ~G4VExceptionHandler ()=default
 
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 44 of file G4ExceptionHandler.hh.

Constructor & Destructor Documentation

◆ G4ExceptionHandler() [1/2]

G4ExceptionHandler::G4ExceptionHandler ( )

Definition at line 53 of file G4ExceptionHandler.cc.

53{}

◆ ~G4ExceptionHandler()

G4ExceptionHandler::~G4ExceptionHandler ( )
virtual

Definition at line 56 of file G4ExceptionHandler.cc.

56{}

◆ 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 
)
virtual

Implements G4VExceptionHandler.

Definition at line 71 of file G4ExceptionHandler.cc.

75{
76 static const G4String es_banner =
77 "\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n";
78 static const G4String ee_banner =
79 "\n-------- EEEE -------- G4Exception-END --------- EEEE -------\n";
80 static const G4String ws_banner =
81 "\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n";
82 static const G4String we_banner =
83 "\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n";
84 std::ostringstream message;
85 message << "*** G4Exception : " << exceptionCode << G4endl
86 << " issued by : " << originOfException << G4endl << description
87 << G4endl;
88 G4bool abortionForCoreDump = false;
90 switch(severity)
91 {
92 case FatalException:
93 G4cerr << es_banner << message.str()
94 << "*** Fatal Exception *** core dump ***" << G4endl;
95 DumpTrackInfo();
96 G4cerr << ee_banner << G4endl;
97 abortionForCoreDump = true;
98 break;
100 G4cerr << es_banner << message.str()
101 << "*** Fatal Error In Argument *** core dump ***" << G4endl;
102 DumpTrackInfo();
103 G4cerr << ee_banner << G4endl;
104 abortionForCoreDump = true;
105 break;
106 case RunMustBeAborted:
107 if(aps == G4State_GeomClosed || aps == G4State_EventProc)
108 {
109 G4cerr << es_banner << message.str() << "*** Run Must Be Aborted ***"
110 << G4endl;
111 DumpTrackInfo();
112 G4cerr << ee_banner << G4endl;
114 }
115 abortionForCoreDump = false;
116 break;
118 if(aps == G4State_EventProc)
119 {
120 G4cerr << es_banner << message.str() << "*** Event Must Be Aborted ***"
121 << G4endl;
122 DumpTrackInfo();
123 G4cerr << ee_banner << G4endl;
125 }
126 abortionForCoreDump = false;
127 break;
128 default:
129 G4cout << ws_banner << message.str()
130 << "*** This is just a warning message. ***" << we_banner
131 << G4endl;
132 abortionForCoreDump = false;
133 break;
134 }
135 return abortionForCoreDump;
136}
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()
virtual void AbortEvent()
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()

◆ operator!=()

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

Definition at line 65 of file G4ExceptionHandler.cc.

66{
67 return (this != &right);
68}

◆ operator=()

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

◆ operator==()

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

Definition at line 59 of file G4ExceptionHandler.cc.

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

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