SimG4Core
Application
src
ExceptionHandler.cc
Go to the documentation of this file.
1
#include "
SimG4Core/Application/interface/ExceptionHandler.h
"
2
#include "
SimG4Core/Notification/interface/SimG4Exception.h
"
3
4
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
5
6
#include "globals.hh"
7
#include <sstream>
8
9
ExceptionHandler::ExceptionHandler
() {}
10
11
ExceptionHandler::~ExceptionHandler
() {}
12
13
bool
ExceptionHandler::Notify
(
const
char
* exceptionOrigin,
14
const
char
* exceptionCode,
15
G4ExceptionSeverity
severity
,
16
const
char
*
description
) {
17
static
const
G4String es_banner =
"\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n"
;
18
static
const
G4String ee_banner =
"\n-------- EEEE -------- G4Exception-END --------- EEEE -------\n"
;
19
static
const
G4String ws_banner =
"\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n"
;
20
static
const
G4String we_banner =
"\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n"
;
21
22
std::stringstream message;
23
message <<
"*** G4Exception : "
<< exceptionCode <<
"\n"
24
<<
" issued by : "
<< exceptionOrigin <<
"\n"
25
<<
description
;
26
27
std::stringstream
ss
;
28
switch
(
severity
) {
29
case
FatalException:
30
case
FatalErrorInArgument:
31
case
RunMustBeAborted:
32
case
EventMustBeAborted:
33
ss
<< es_banner << message.str() << ee_banner;
34
throw
SimG4Exception
(
ss
.str());
35
break
;
36
37
case
JustWarning:
38
edm::LogWarning
(
"SimG4CoreApplication"
)
39
<< ws_banner << message.str() <<
"*** This is just a warning message. ***"
<< we_banner;
40
break
;
41
}
42
return
false
;
43
}
MessageLogger.h
edmLumisInFiles.description
description
Definition:
edmLumisInFiles.py:11
SimG4Exception
Definition:
SimG4Exception.h:13
ExceptionHandler::~ExceptionHandler
~ExceptionHandler() override
Definition:
ExceptionHandler.cc:11
contentValuesCheck.ss
ss
Definition:
contentValuesCheck.py:33
edm::LogWarning
Definition:
MessageLogger.h:141
SimG4Exception.h
HLT_2018_cff.severity
severity
Definition:
HLT_2018_cff.py:48631
ExceptionHandler.h
ExceptionHandler::Notify
bool Notify(const char *exceptionOrigin, const char *exceptionCode, G4ExceptionSeverity severity, const char *description) override
Definition:
ExceptionHandler.cc:13
ExceptionHandler::ExceptionHandler
ExceptionHandler()
Definition:
ExceptionHandler.cc:9
Generated for CMSSW Reference Manual by
1.8.16