GRSISort
"v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TILLDataParserException.cxx
Go to the documentation of this file.
1
#include "
TILLDataParserException.h
"
2
#include "
TILLDataParser.h
"
3
4
TILLDataParserException::TILLDataParserException
(
TILLDataParser::EDataParserState
state,
int
failedWord,
bool
multipleErrors)
5
: fParserState(state), fFailedWord(failedWord), fMultipleErrors(multipleErrors)
6
{
7
/// default constructor for TILLDataParserException, 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 TILLDataParserException::what()
9
std::ostringstream stream;
10
stream<<
"TILLDataParser failed "
;
11
if
(
fMultipleErrors
) {
12
stream<<
"on multiple words, first was "
;
13
}
else
{
14
stream<<
"only on "
;
15
}
16
stream<<
fFailedWord
<<
". word: "
;
17
switch
(
fParserState
) {
18
case
TILLDataParser::EDataParserState::kGood
: stream<<
"state is good, no idea what went wrong!"
<<std::endl;
break
;
19
case
TILLDataParser::EDataParserState::kBadHeader
:
20
stream<<
"bad header (either not high nibble 0x8 or an undefined bank)"
<<std::endl;
21
break
;
22
case
TILLDataParser::EDataParserState::kMissingWords
: stream<<
"missing scaler words"
<<std::endl;
break
;
23
case
TILLDataParser::EDataParserState::kBadScalerLowTS
:
24
stream<<
"bad scaler word with low time stamp bits (high nibble not 0xa)"
<<std::endl;
25
break
;
26
case
TILLDataParser::EDataParserState::kBadScalerValue
:
27
stream<<
"bad scaler value (should never happen?)"
<<std::endl;
28
break
;
29
case
TILLDataParser::EDataParserState::kBadScalerHighTS
:
30
stream<<
"bad scaler word with high time stamp bits (either high nibble not 0xe or the 8 LSB don't match the 8 "
31
"LSB of time stamp)"
32
<<std::endl;
33
break
;
34
case
TILLDataParser::EDataParserState::kBadScalerType
: stream<<
"undefined scaler type"
<<std::endl;
break
;
35
case
TILLDataParser::EDataParserState::kBadTriggerId
:
36
stream<<
"bad word with channel trigger ID (high nibble not 0x9)"
<<std::endl;
37
break
;
38
case
TILLDataParser::EDataParserState::kBadLowTS
:
39
stream<<
"bad word with low time stamp bits (high nibble not 0xa)"
<<std::endl;
40
break
;
41
case
TILLDataParser::EDataParserState::kBadHighTS
:
42
stream<<
"bad word with deadtime/high time stamp bits (high nibble not 0xb)"
<<std::endl;
43
break
;
44
case
TILLDataParser::EDataParserState::kSecondHeader
:
45
stream<<
"found a second header (w/o finding a footer first)"
<<std::endl;
46
break
;
47
case
TILLDataParser::EDataParserState::kWrongNofWords
: stream<<
"wrong number of words"
<<std::endl;
break
;
48
case
TILLDataParser::EDataParserState::kNotSingleCfd
:
49
stream<<
"expected a single cfd word, got either none or multiple ones"
<<std::endl;
50
break
;
51
case
TILLDataParser::EDataParserState::kSizeMismatch
:
52
stream<<
"number of charge, cfd, and integration length words doesn't match"
<<std::endl;
53
break
;
54
case
TILLDataParser::EDataParserState::kBadFooter
:
55
stream<<
"bad footer (mismatch between lowest 14 bits of channel trigger ID)"
<<std::endl;
56
break
;
57
case
TILLDataParser::EDataParserState::kFault
:
58
stream<<
"found a fault word (high nibble 0xf) from the DAQ"
<<std::endl;
59
break
;
60
case
TILLDataParser::EDataParserState::kMissingPsd
: stream<<
"missing psd words"
<<std::endl;
break
;
61
case
TILLDataParser::EDataParserState::kMissingCfd
:
62
stream<<
"missing the cfd word (second word w/o MSB set)"
<<std::endl;
63
break
;
64
case
TILLDataParser::EDataParserState::kMissingCharge
:
65
stream<<
"missing charge words (should be at least two words w/o MSB set"
<<std::endl;
66
break
;
67
case
TILLDataParser::EDataParserState::kBadBank
: stream<<
"undefined bank"
<<std::endl;
break
;
68
case
TILLDataParser::EDataParserState::kBadModuleType
: stream<<
"undefined module type"
<<std::endl;
break
;
69
case
TILLDataParser::EDataParserState::kEndOfData
:
70
stream<<
"reached end of bank data but not end of fragment"
<<std::endl;
71
break
;
72
case
TILLDataParser::EDataParserState::kUndefined
:
73
stream<<
"undefined state, should not be possible?"
<<std::endl;
74
break
;
75
default
:
break
;
76
};
77
78
fMessage
= stream.str();
79
}
80
81
TILLDataParserException::~TILLDataParserException
()
82
{
83
/// default destructor
84
}
85
86
const
char
*
TILLDataParserException::what
() const noexcept
87
{
88
/// return message string built in default constructor
89
return
fMessage
.c_str();
90
}
TILLDataParser.h
TILLDataParserException.h
TILLDataParserException::what
const char * what() const noexcept override
Definition
TILLDataParserException.cxx:86
TILLDataParserException::fMultipleErrors
bool fMultipleErrors
Definition
TILLDataParserException.h:29
TILLDataParserException::TILLDataParserException
TILLDataParserException(TILLDataParser::EDataParserState state, int failedWord, bool multipleErrors)
Definition
TILLDataParserException.cxx:4
TILLDataParserException::~TILLDataParserException
~TILLDataParserException() override
Definition
TILLDataParserException.cxx:81
TILLDataParserException::fFailedWord
int fFailedWord
Definition
TILLDataParserException.h:28
TILLDataParserException::fParserState
TILLDataParser::EDataParserState fParserState
Definition
TILLDataParserException.h:27
TILLDataParserException::fMessage
std::string fMessage
Definition
TILLDataParserException.h:30
TILLDataParser::EDataParserState
EDataParserState
Definition
TILLDataParser.h:51
TILLDataParser::EDataParserState::kBadTriggerId
@ kBadTriggerId
TILLDataParser::EDataParserState::kBadScalerLowTS
@ kBadScalerLowTS
TILLDataParser::EDataParserState::kGood
@ kGood
TILLDataParser::EDataParserState::kSizeMismatch
@ kSizeMismatch
TILLDataParser::EDataParserState::kBadScalerHighTS
@ kBadScalerHighTS
TILLDataParser::EDataParserState::kBadScalerType
@ kBadScalerType
TILLDataParser::EDataParserState::kMissingCfd
@ kMissingCfd
TILLDataParser::EDataParserState::kWrongNofWords
@ kWrongNofWords
TILLDataParser::EDataParserState::kEndOfData
@ kEndOfData
TILLDataParser::EDataParserState::kUndefined
@ kUndefined
TILLDataParser::EDataParserState::kMissingPsd
@ kMissingPsd
TILLDataParser::EDataParserState::kMissingWords
@ kMissingWords
TILLDataParser::EDataParserState::kBadModuleType
@ kBadModuleType
TILLDataParser::EDataParserState::kBadLowTS
@ kBadLowTS
TILLDataParser::EDataParserState::kBadHeader
@ kBadHeader
TILLDataParser::EDataParserState::kBadHighTS
@ kBadHighTS
TILLDataParser::EDataParserState::kMissingCharge
@ kMissingCharge
TILLDataParser::EDataParserState::kFault
@ kFault
TILLDataParser::EDataParserState::kSecondHeader
@ kSecondHeader
TILLDataParser::EDataParserState::kNotSingleCfd
@ kNotSingleCfd
TILLDataParser::EDataParserState::kBadBank
@ kBadBank
TILLDataParser::EDataParserState::kBadFooter
@ kBadFooter
TILLDataParser::EDataParserState::kBadScalerValue
@ kBadScalerValue
IllData
libraries
TILLDataParser
TILLDataParserException.cxx
GRSISort ("v4.0.0.5") Reference Guide Generated on Mon Feb 3 2025 16:38:04.