Main Page
Namespaces
Classes
Package Documentation
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 <sstream>
7
8
ExceptionHandler::ExceptionHandler
()
9
{}
10
11
ExceptionHandler::~ExceptionHandler
()
12
{}
13
14
bool
ExceptionHandler::Notify
(
const
char
* exceptionOrigin,
15
const
char
* exceptionCode,
16
G4ExceptionSeverity
severity
,
17
const
char
*
description
)
18
{
19
static
const
G4String es_banner
20
=
"\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n"
;
21
static
const
G4String ee_banner
22
=
"\n-------- EEEE -------- G4Exception-END --------- EEEE -------\n"
;
23
static
const
G4String ws_banner
24
=
"\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n"
;
25
static
const
G4String we_banner
26
=
"\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n"
;
27
28
std::stringstream
message
;
29
message <<
"*** G4Exception : "
<< exceptionCode <<
"\n"
30
<<
" issued by : "
<< exceptionOrigin <<
"\n"
31
<<
description
;
32
33
std::stringstream ss;
34
switch
(severity) {
35
36
case
FatalException:
37
case
FatalErrorInArgument:
38
case
RunMustBeAborted:
39
case
EventMustBeAborted:
40
ss << es_banner << message.str() << ee_banner;
41
throw
SimG4Exception
(ss.str());
42
break
;
43
44
case
JustWarning:
45
edm::LogWarning
(
"SimG4CoreApplication"
)
46
<< ws_banner << message.str() <<
"*** This is just a warning message. ***"
47
<< we_banner;
48
break
;
49
}
50
return
false
;
51
}
52
MessageLogger.h
ExceptionHandler::~ExceptionHandler
~ExceptionHandler() override
Definition:
ExceptionHandler.cc:11
ExceptionHandler.h
edm::LogWarning
Definition:
MessageLogger.h:142
ExceptionHandler::ExceptionHandler
ExceptionHandler()
Definition:
ExceptionHandler.cc:8
ExceptionHandler::Notify
bool Notify(const char *exceptionOrigin, const char *exceptionCode, G4ExceptionSeverity severity, const char *description) override
Definition:
ExceptionHandler.cc:14
ErrorSummaryFilter_cfi.severity
severity
Definition:
ErrorSummaryFilter_cfi.py:5
SimG4Exception
Definition:
SimG4Exception.h:13
heppy_report.description
description
Definition:
heppy_report.py:44
SimG4Exception.h
python.rootplot.argparse.message
message
Definition:
argparse.py:130
Generated for CMSSW Reference Manual by
1.8.11