ATLAS Offline Software
PixelAthErrorMonAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef PIXELATHERRORMONTOOL_H
6 #define PIXELATHERRORMONTOOL_H
7 
13 
14 class PixelID;
15 
17 public:
20  };
21 };
22 
24 public:
27  };
28 };
29 
30 static const int kNumErrorStatesFEI3 {
31  17
32 };
33 static const int kNumErrorStatesFEI4 {
34  27
35 };
36 static const int kNumErrorStatesPerFE {
37  5
38 };
39 
40 // error states = enumerators of PixelByteStreamErrors and FEI4 SR's we care about
41 //
42 static constexpr std::array<const char*, kNumErrorStatesFEI3> error_names_stateFEI3 {
43  "RODTimeout",
44  "RODSyncBCIDErrors",
45  "RODSyncLVL1IDErrors",
46  "OpticalErrors",
47  "ModSyncLVL1IDErrors",
48  "ModSyncBCID2Errors",
49  "ModSyncBCID1Errors",
50  "ModTruncEoEOverflowErrors",
51  "ModTruncHitOverflowErrors",
52  "FEWarning",
53  "SEUHitParity",
54  "SEURegisterParity",
55  "SEUHamming",
56  "ModTruncEOCErrors",
57  "RODTrailerBitErrors",
58  "RODTruncHTLimitErrors",
59  "RODTruncRODOFErrors"
60 };
61 
62 static constexpr std::array<const char*, kNumErrorStatesFEI4> error_names_stateFEI4 {
63  "RODTimeoutErrors",
64  "RODBCIDErrors",
65  "RODLVL1IDErrors",
66  "RODPreambleErrors",
67  "RODTrailerErrors",
68  "RODRowColumnErrors",
69  "RODMaskedLink",
70  "RODLimitErrors",
71  "SR0BCIDCounterErrors",
72  "SR1HammingCode0Errors",
73  "SR2HammingCode1Errors",
74  "SR3HammingCode2Errors",
75  "SR4L1InCounterErrors",
76  "SR5L1RequestCounterErrors",
77  "SR6L1RegisterErrors",
78  "SR7L1TriggerIDErrors",
79  "SR8FEReadoutProcessErrors",
80  "SR15SkipppedTrigCountErrors",
81  "SR16TruncatedEventFlagErrors",
82  "SR24TripleRedundantErrorsCNFGMEM",
83  "SR25WriteRegDataErrors",
84  "SR26AddressErrors",
85  "SR27OtherCMDDecoderErrors",
86  "SR28CMDDecoderBitflipErrors",
87  "SR29TripleRedundantErrorsCMD",
88  "SR30DataBusAddressErrors",
89  "SR31TripleRedundantErrorsEFUSE"
90 };
91 
92 static constexpr std::array<const char*, ErrorCategoryRODMOD::COUNT> error_names_cat_rodmod {
93  "SyncErrorsMod",
94  "SyncErrorsROD",
95  "TruncErrorsMod",
96  "TruncErrorsROD",
97  "OpticalErrorsRODMod",
98  "SEUErrorsRODMod",
99  "TimeoutErrorsRODMod"
100 };
101 
102 static constexpr std::array<const char*, 4> error_names_cat_rodmod_norm {
103  "SyncErrorsModFracPerEvent",
104  "SyncErrorsRODFracPerEvent",
105  "TruncErrorsModFracPerEvent",
106  "TruncErrorsRODFracPerEvent"
107 };
108 
109 static constexpr std::array<const char*, ErrorCategory::COUNT> error_names_cat {
110  "SyncErrors",
111  "TruncErrors",
112  "OpticalErrors",
113  "SEUErrors",
114  "TimeoutErrors"
115 };
116 
117 static constexpr std::array<const char*, ErrorCategory::COUNT> error_names_cat_norm {
118  "SyncErrorsFracPerEvent",
119  "TruncationErrorsFracPerEvent",
120  "OpticalErrorsFracPerEvent",
121  "SEUErrorsFracPerEvent",
122  "TimeoutErrorsFracPerEvent"
123 };
124 
125 static const int numErrorStatesLayer[PixLayers::COUNT] = {
126  kNumErrorStatesFEI3, kNumErrorStatesFEI3, kNumErrorStatesFEI3, kNumErrorStatesFEI3,
127  kNumErrorStatesFEI3, kNumErrorStatesFEI4, kNumErrorStatesFEI4
128 };
129 static const int kNumErrorCatRODMods {
131 };
132 static const int numErrorCatRODModsLayer[PixLayers::COUNT] = {
133  kNumErrorCatRODMods, kNumErrorCatRODMods, kNumErrorCatRODMods, kNumErrorCatRODMods,
134  kNumErrorCatRODMods, kNumErrorCatRODMods, kNumErrorCatRODMods
135 };
136 
137 static const int nFEIBL2D {
138  2
139 };
140 
142 public:
143  PixelAthErrorMonAlg(const std::string& name, ISvcLocator* pSvcLocator);
144  virtual ~PixelAthErrorMonAlg();
145  virtual StatusCode initialize() override;
146  virtual StatusCode fillHistograms(const EventContext& ctx) const override;
147  std::string findComponentString(int bec, int ld) const;
148  int getErrorCategory(int error_cat_rodmod) const;
149  std::bitset<kNumErrorStatesFEI3> getErrorStateFEI3Mod(uint64_t errorword) const;
150  std::bitset<kNumErrorStatesFEI3> getErrorStateFE(uint64_t errorword, bool isibl) const;
151  void fillErrorCatRODmod(uint64_t mod_errorword,
152  int (&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT][nFEIBL2D]) const;
153  void fillErrorCatRODmod(uint64_t fe_errorword, bool is_fei4,
154  int (&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT][nFEIBL2D], int ife) const;
155  void fillErrorCatRODmod(int servicecode, int payload,
156  int (&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT][nFEIBL2D], int ife) const;
157  bool isPerFEI3State(const std::string& state) const;
158 private:
160  {this, "PixelByteStreamErrs", "PixelByteStreamErrs", "PixelByteStreamErrs container key"};
161  Gaudi::Property<bool> m_useByteStreamFEI4
162  {this, "UseByteStreamFEI4", false, "Switch of the ByteStream error for FEI4"};
163  Gaudi::Property<bool> m_useByteStreamFEI3
164  {this, "UseByteStreamFEI3", false, "Switch of the ByteStream error for FEI3"};
165  Gaudi::Property<bool> m_useByteStreamRD53
166  {this, "UseByteStreamRD53", false, "Switch of the ByteStream error for RD53"};
167 
168  unsigned int m_readoutTechnologyMask{};
169  bool m_doOnline{};
174 
175 };
176 #endif
PixelAthErrorMonAlg::m_doOnline
bool m_doOnline
Definition: PixelAthErrorMonAlg.h:169
PixelAthErrorMonAlg::getErrorStateFE
std::bitset< kNumErrorStatesFEI3 > getErrorStateFE(uint64_t errorword, bool isibl) const
Definition: PixelAthErrorMonAlg.cxx:439
PixelAthErrorMonAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: PixelAthErrorMonAlg.cxx:35
IInDetConditionsTool.h
PixelAthErrorMonAlg::isPerFEI3State
bool isPerFEI3State(const std::string &state) const
Definition: PixelAthErrorMonAlg.cxx:513
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
ErrorCategoryRODMOD::kSyncROD
@ kSyncROD
Definition: PixelAthErrorMonAlg.h:26
ErrorCategoryRODMOD::ErrorCategoryRODMODID
ErrorCategoryRODMODID
Definition: PixelAthErrorMonAlg.h:25
PixelAthErrorMonAlg::m_useByteStreamFEI3
Gaudi::Property< bool > m_useByteStreamFEI3
Definition: PixelAthErrorMonAlg.h:164
ErrorCategory::kTrunc
@ kTrunc
Definition: PixelAthErrorMonAlg.h:19
ErrorCategoryRODMOD
Definition: PixelAthErrorMonAlg.h:23
PixelAthErrorMonAlg::m_doHeavyIonMon
bool m_doHeavyIonMon
Definition: PixelAthErrorMonAlg.h:173
SG::ReadHandleKey< IDCInDetBSErrContainer >
PixelAthErrorMonAlg::m_doLowOccupancy
bool m_doLowOccupancy
Definition: PixelAthErrorMonAlg.h:171
PixelAthErrorMonAlg::~PixelAthErrorMonAlg
virtual ~PixelAthErrorMonAlg()
Definition: PixelAthErrorMonAlg.cxx:23
PixelAthErrorMonAlg::PixelAthErrorMonAlg
PixelAthErrorMonAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: PixelAthErrorMonAlg.cxx:12
ErrorCategory::kSeu
@ kSeu
Definition: PixelAthErrorMonAlg.h:19
ErrorCategoryRODMOD::kOpt
@ kOpt
Definition: PixelAthErrorMonAlg.h:26
PixelAthErrorMonAlg::m_readoutTechnologyMask
unsigned int m_readoutTechnologyMask
Definition: PixelAthErrorMonAlg.h:168
ErrorCategory::ErrorCategoryID
ErrorCategoryID
Definition: PixelAthErrorMonAlg.h:18
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PixelAthErrorMonAlg::fillErrorCatRODmod
void fillErrorCatRODmod(uint64_t mod_errorword, int(&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT][nFEIBL2D]) const
Definition: PixelAthErrorMonAlg.cxx:465
PixelAthMonitoringBase.h
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ErrorCategoryRODMOD::COUNT
@ COUNT
Definition: PixelAthErrorMonAlg.h:26
IPixelReadoutManager.h
ErrorCategory::kSync
@ kSync
Definition: PixelAthErrorMonAlg.h:19
PixLayers::COUNT
@ COUNT
Definition: PixelAthMonitoringBase.h:24
ErrorCategory
Definition: PixelAthErrorMonAlg.h:16
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ErrorCategoryRODMOD::kTruncMod
@ kTruncMod
Definition: PixelAthErrorMonAlg.h:26
PixelAthErrorMonAlg::m_idcErrContKey
SG::ReadHandleKey< IDCInDetBSErrContainer > m_idcErrContKey
Definition: PixelAthErrorMonAlg.h:160
PixelAthErrorMonAlg::m_doHighOccupancy
bool m_doHighOccupancy
Definition: PixelAthErrorMonAlg.h:172
PixelAthErrorMonAlg::initialize
virtual StatusCode initialize() override
initialize
Definition: PixelAthErrorMonAlg.cxx:26
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
ErrorCategory::kTout
@ kTout
Definition: PixelAthErrorMonAlg.h:19
PixelAthErrorMonAlg
Definition: PixelAthErrorMonAlg.h:141
ErrorCategoryRODMOD::kTout
@ kTout
Definition: PixelAthErrorMonAlg.h:26
ErrorCategory::COUNT
@ COUNT
Definition: PixelAthErrorMonAlg.h:19
IDCInDetBSErrContainer.h
PixelAthErrorMonAlg::m_useByteStreamFEI4
Gaudi::Property< bool > m_useByteStreamFEI4
Definition: PixelAthErrorMonAlg.h:162
PixelAthErrorMonAlg::findComponentString
std::string findComponentString(int bec, int ld) const
PixelAthErrorMonAlg::m_doLumiBlock
bool m_doLumiBlock
Definition: PixelAthErrorMonAlg.h:170
PixelAthErrorMonAlg::getErrorStateFEI3Mod
std::bitset< kNumErrorStatesFEI3 > getErrorStateFEI3Mod(uint64_t errorword) const
Definition: PixelAthErrorMonAlg.cxx:427
PixelAthErrorMonAlg::getErrorCategory
int getErrorCategory(int error_cat_rodmod) const
Definition: PixelAthErrorMonAlg.cxx:416
ErrorCategoryRODMOD::kSyncMod
@ kSyncMod
Definition: PixelAthErrorMonAlg.h:26
PixelAthMonitoringBase
Definition: PixelAthMonitoringBase.py:1
ErrorCategoryRODMOD::kSeu
@ kSeu
Definition: PixelAthErrorMonAlg.h:26
PixelByteStreamErrors.h
PixelID
Definition: PixelID.h:67
PixelAthErrorMonAlg::m_useByteStreamRD53
Gaudi::Property< bool > m_useByteStreamRD53
Definition: PixelAthErrorMonAlg.h:166
ErrorCategoryRODMOD::kTruncROD
@ kTruncROD
Definition: PixelAthErrorMonAlg.h:26
geometry_dat_to_json.ld
ld
Definition: geometry_dat_to_json.py:32
ErrorCategory::kOpt
@ kOpt
Definition: PixelAthErrorMonAlg.h:19