ATLAS Offline Software
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
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
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 
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 
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 
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 }
LArFebErrorSummary::LArFebErrorSummary
LArFebErrorSummary()
Constructor with FEB Id.
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::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
skel.it
it
Definition: skel.GENtoEVGEN.py:423
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
HWIdentifier
Definition: HWIdentifier.h:13
LArFebErrorSummary::feb_error
uint16_t feb_error(HWIdentifier febid) const
get error for feb
Definition: LArFebErrorSummary.cxx:20
LArFebErrorSummary::m_errorStrings
static const std::string m_errorStrings[N_LArFebErrorType]
Definition: LArFebErrorSummary.h:57
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
LArFebErrorSummary::N_LArFebErrorType
@ N_LArFebErrorType
Definition: LArFebErrorSummary.h:28
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.h
get_generator_info.error
error
Definition: get_generator_info.py:40
error
Definition: IImpactPoint3dEstimator.h:70
LArFebErrorSummary::clear
void clear()
clear internal map
Definition: LArFebErrorSummary.cxx:52