ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7// static constants
8const 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
16
18= default;
19
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
34bool 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
47const std::map<unsigned int,uint16_t>& LArFebErrorSummary::get_all_febs() const
48{
49 return m_feb_errors;
50}
51
53{
54 m_feb_errors.clear();
55}
56
57
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}
bool set_feb_error(unsigned int febid, uint16_t e)
Add another FEB error record, return true if added successfully.
static const std::string m_errorStrings[N_LArFebErrorType]
void clear()
clear internal map
~LArFebErrorSummary()
Destructor.
static std::string error_to_string(uint16_t error)
interpret the error in string
const std::map< unsigned int, uint16_t > & get_all_febs() const
get all febs with error
std::map< unsigned int, uint16_t > m_feb_errors
error is stored in a map with key = feb id
uint16_t feb_error(HWIdentifier febid) const
get error for feb
LArFebErrorSummary()
Constructor with FEB Id.