GRSISort
"v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
THILDataParserException.cxx
Go to the documentation of this file.
1
#include "
THILDataParserException.h
"
2
#include "
THILDataParser.h
"
3
4
THILDataParserException::THILDataParserException
(
THILDataParser::EDataParserState
state,
int
failedWord)
5
: fParserState(state), fFailedWord(failedWord)
6
{
7
/// default constructor for THILDataParserException, stores the data parser state and the word the parser failed on
8
/// and creates a message based on them that can be accessed via THILDataParserException::what()
9
std::ostringstream stream;
10
stream<<
"THILDataParser failed on "
<<
fFailedWord
<<
". word: "
;
11
switch
(
fParserState
) {
12
case
THILDataParser::EDataParserState::kGood
:
13
stream<<
"state is good, no idea what went wrong!"
<<std::endl;
14
break
;
15
case
THILDataParser::EDataParserState::kOddUsedLength
:
16
stream<<
"odd used data length"
<<std::endl;
17
break
;
18
case
THILDataParser::EDataParserState::kWrongBufferType
:
19
stream<<
"wrong buffer type, should have been 0x0200"
<<std::endl;
20
break
;
21
case
THILDataParser::EDataParserState::kZeroEventLength
:
22
stream<<
"event length is zero"
<<std::endl;
23
break
;
24
case
THILDataParser::EDataParserState::kOddEventLength
:
25
stream<<
"odd event length"
<<std::endl;
26
break
;
27
case
THILDataParser::EDataParserState::kWrongEventLength
:
28
stream<<
"wrong event length"
<<std::endl;
29
break
;
30
case
THILDataParser::EDataParserState::kWrongUsPattern
:
31
stream<<
"wrong pattern for time in microseconds"
<<std::endl;
32
break
;
33
case
THILDataParser::EDataParserState::kWrongGeHPPattern
:
34
stream<<
"wrong pattern for hitpattern of germanium"
<<std::endl;
35
break
;
36
case
THILDataParser::EDataParserState::kWrongGeEnPattern
:
37
stream<<
"wrong pattern for energy of germanium"
<<std::endl;
38
break
;
39
case
THILDataParser::EDataParserState::kWrongGeTimePattern
:
40
stream<<
"wrong pattern for time of germanium"
<<std::endl;
41
break
;
42
case
THILDataParser::EDataParserState::kWrongSi1HPPattern
:
43
stream<<
"wrong pattern for hitpattern of Si 1"
<<std::endl;
44
break
;
45
case
THILDataParser::EDataParserState::kWrongSi1EnPattern
:
46
stream<<
"wrong pattern for energy of Si 1"
<<std::endl;
47
break
;
48
case
THILDataParser::EDataParserState::kWrongSi2HPPattern
:
49
stream<<
"wrong pattern for hitpattern of Si 2"
<<std::endl;
50
break
;
51
case
THILDataParser::EDataParserState::kWrongSi2EnPattern
:
52
stream<<
"wrong pattern for energy of Si 2"
<<std::endl;
53
break
;
54
case
THILDataParser::EDataParserState::kWrongSi3HPPattern
:
55
stream<<
"wrong pattern for hitpattern of Si 3"
<<std::endl;
56
break
;
57
case
THILDataParser::EDataParserState::kWrongSi3EnPattern
:
58
stream<<
"wrong pattern for energy of Si 3"
<<std::endl;
59
break
;
60
case
THILDataParser::EDataParserState::kWrongEventId
:
61
stream<<
"wrong event ID"
<<std::endl;
62
break
;
63
default
:
break
;
64
};
65
66
fMessage
= stream.str();
67
}
68
69
THILDataParserException::~THILDataParserException
()
70
{
71
/// default destructor
72
}
73
74
const
char
*
THILDataParserException::what
() const noexcept
75
{
76
/// return message string built in default constructor
77
return
fMessage
.c_str();
78
}
THILDataParser.h
THILDataParserException.h
THILDataParserException::fMessage
std::string fMessage
Definition
THILDataParserException.h:28
THILDataParserException::fParserState
THILDataParser::EDataParserState fParserState
Definition
THILDataParserException.h:26
THILDataParserException::~THILDataParserException
~THILDataParserException() override
Definition
THILDataParserException.cxx:69
THILDataParserException::THILDataParserException
THILDataParserException(THILDataParser::EDataParserState state, int failedWord)
Definition
THILDataParserException.cxx:4
THILDataParserException::fFailedWord
int fFailedWord
Definition
THILDataParserException.h:27
THILDataParserException::what
const char * what() const noexcept override
Definition
THILDataParserException.cxx:74
THILDataParser::EDataParserState
EDataParserState
Definition
THILDataParser.h:60
THILDataParser::EDataParserState::kWrongSi1HPPattern
@ kWrongSi1HPPattern
THILDataParser::EDataParserState::kWrongGeTimePattern
@ kWrongGeTimePattern
THILDataParser::EDataParserState::kGood
@ kGood
THILDataParser::EDataParserState::kWrongUsPattern
@ kWrongUsPattern
THILDataParser::EDataParserState::kWrongGeHPPattern
@ kWrongGeHPPattern
THILDataParser::EDataParserState::kWrongSi1EnPattern
@ kWrongSi1EnPattern
THILDataParser::EDataParserState::kZeroEventLength
@ kZeroEventLength
THILDataParser::EDataParserState::kWrongEventId
@ kWrongEventId
THILDataParser::EDataParserState::kWrongEventLength
@ kWrongEventLength
THILDataParser::EDataParserState::kWrongBufferType
@ kWrongBufferType
THILDataParser::EDataParserState::kOddUsedLength
@ kOddUsedLength
THILDataParser::EDataParserState::kWrongSi2HPPattern
@ kWrongSi2HPPattern
THILDataParser::EDataParserState::kWrongSi3HPPattern
@ kWrongSi3HPPattern
THILDataParser::EDataParserState::kOddEventLength
@ kOddEventLength
THILDataParser::EDataParserState::kWrongGeEnPattern
@ kWrongGeEnPattern
THILDataParser::EDataParserState::kWrongSi3EnPattern
@ kWrongSi3EnPattern
THILDataParser::EDataParserState::kWrongSi2EnPattern
@ kWrongSi2EnPattern
HILData
libraries
THILDataParser
THILDataParserException.cxx
GRSISort ("v4.0.0.5") Reference Guide Generated on Mon Feb 3 2025 16:38:04.