ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArRawEvent
src
LArFebErrorSummary.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArRawEvent/LArFebErrorSummary.h
"
6
7
// static constants
8
const
std::string
LArFebErrorSummary::m_errorStrings
[N_LArFebErrorType] = {
9
"Parity"
,
"BCID"
,
"SampleHeader"
,
"EVTID"
,
"ScacStatus"
,
"ScaOutOfRange"
,
10
"GainMismatch"
,
"TypeMismatch"
,
"NumOfSamples"
,
"EmptyDataBlock"
,
"DspBlockSize"
,
"CheckSum"
,
"MissingHeader"
,
11
"BadGain"
} ;
12
13
14
//Constructor
15
LArFebErrorSummary::LArFebErrorSummary
() =
default
;
16
17
LArFebErrorSummary::~LArFebErrorSummary
()
18
=
default
;
19
20
uint16_t
LArFebErrorSummary::feb_error
(
HWIdentifier
id
)
const
21
{
22
23
std::map<unsigned int ,uint16_t>::const_iterator it =
m_feb_errors
.find(
id
.get_identifier32().get_compact() ) ;
24
25
if
(it!=
m_feb_errors
.end() ) {
26
return
(*it).second ;
27
}
28
29
return
0;
30
31
}
32
33
34
bool
LArFebErrorSummary::set_feb_error
(
unsigned
int
id
, uint16_t
error
) {
35
36
std::map<unsigned int, uint16_t>::const_iterator it =
m_feb_errors
.find(
id
) ;
37
38
if
(it!=
m_feb_errors
.end() ) {
39
return
false
;
40
}
41
42
m_feb_errors
[id]=
error
;
43
44
return
true ;
45
}
46
47
const
std::map<unsigned int,uint16_t>&
LArFebErrorSummary::get_all_febs
()
const
48
{
49
return
m_feb_errors
;
50
}
51
52
void
LArFebErrorSummary::clear
()
53
{
54
m_feb_errors
.clear();
55
}
56
57
58
std::string
LArFebErrorSummary::error_to_string
(uint16_t
error
)
59
{
60
std::string str_err;
61
for
(
int
i=0;i<
N_LArFebErrorType
;i++)
62
{
63
if
(
error
& (1<<i) )
64
{
65
if
(!str_err.empty()) str_err+=
":"
;
66
str_err = str_err+
m_errorStrings
[i];
67
}
68
}
69
70
return
str_err;
71
72
}
LArFebErrorSummary.h
HWIdentifier
Definition
HWIdentifier.h:13
LArFebErrorSummary::set_feb_error
bool set_feb_error(unsigned int febid, uint16_t e)
Add another FEB error record, return true if added successfully.
Definition
LArFebErrorSummary.cxx:34
LArFebErrorSummary::m_errorStrings
static const std::string m_errorStrings[N_LArFebErrorType]
Definition
LArFebErrorSummary.h:8
LArFebErrorSummary::clear
void clear()
clear internal map
Definition
LArFebErrorSummary.cxx:52
LArFebErrorSummary::~LArFebErrorSummary
~LArFebErrorSummary()
Destructor.
LArFebErrorSummary::error_to_string
static std::string error_to_string(uint16_t error)
interpret the error in string
Definition
LArFebErrorSummary.cxx:58
LArFebErrorSummary::get_all_febs
const std::map< unsigned int, uint16_t > & get_all_febs() const
get all febs with error
Definition
LArFebErrorSummary.cxx:47
LArFebErrorSummary::m_feb_errors
std::map< unsigned int, uint16_t > m_feb_errors
error is stored in a map with key = feb id
Definition
LArFebErrorSummary.h:55
LArFebErrorSummary::feb_error
uint16_t feb_error(HWIdentifier febid) const
get error for feb
Definition
LArFebErrorSummary.cxx:20
LArFebErrorSummary::N_LArFebErrorType
@ N_LArFebErrorType
Definition
LArFebErrorSummary.h:28
LArFebErrorSummary::LArFebErrorSummary
LArFebErrorSummary()
Constructor with FEB Id.
error
Definition
IImpactPoint3dEstimator.h:72
Generated on
for ATLAS Offline Software by
1.17.0