CMS 3D CMS Logo

HPTDCErrorFlags.h
Go to the documentation of this file.
1 #ifndef DataFormats_CTPPSDigi_HPTDCErrorFlags_h
2 #define DataFormats_CTPPSDigi_HPTDCErrorFlags_h
3 
4 #include <string>
5 
16 public:
17  HPTDCErrorFlags(unsigned short flags = 0) : error_flags(flags) {}
18 
19  bool errorId(unsigned short id) const {
20  switch (id) {
21  case 0:
22  return internalFatalChipError();
23  case 1:
24  return eventLost();
25  case 2:
27  case 3:
28  return hitErrorGroup3();
29  case 4:
30  return hitLostL1OverflowGroup3();
31  case 5:
33  case 6:
34  return hitErrorGroup2();
35  case 7:
36  return hitLostL1OverflowGroup2();
37  case 8:
39  case 9:
40  return hitErrorGroup1();
41  case 10:
42  return hitLostL1OverflowGroup1();
43  case 11:
45  case 12:
46  return hitErrorGroup0();
47  case 13:
48  return hitLostL1OverflowGroup0();
49  case 14:
51  default:
52  return true;
53  }
54  }
55 
56  bool internalFatalChipError() const { return error_flags & 0x1; }
57  bool eventLost() const { return (error_flags >> 1) & 0x1; }
58  bool hitRejectedByEventSizeLimit() const { return (error_flags >> 2) & 0x1; }
59  bool hitErrorGroup3() const { return (error_flags >> 3) & 0x1; }
60  bool hitLostL1OverflowGroup3() const { return (error_flags >> 4) & 0x1; }
61  bool hitLostROFifoOverflowGroup3() const { return (error_flags >> 5) & 0x1; }
62  bool hitErrorGroup2() const { return (error_flags >> 6) & 0x1; }
63  bool hitLostL1OverflowGroup2() const { return (error_flags >> 7) & 0x1; }
64  bool hitLostROFifoOverflowGroup2() const { return (error_flags >> 8) & 0x1; }
65  bool hitErrorGroup1() const { return (error_flags >> 9) & 0x1; }
66  bool hitLostL1OverflowGroup1() const { return (error_flags >> 10) & 0x1; }
67  bool hitLostROFifoOverflowGroup1() const { return (error_flags >> 11) & 0x1; }
68  bool hitErrorGroup0() const { return (error_flags >> 12) & 0x1; }
69  bool hitLostL1OverflowGroup0() const { return (error_flags >> 13) & 0x1; }
70  bool hitLostROFifoOverflowGroup0() const { return (error_flags >> 14) & 0x1; }
71 
72  inline unsigned short errorFlag() const { return error_flags; }
73 
74  static std::string hptdcErrorName(const unsigned short id) {
75  switch (id) {
76  case 0:
77  return "InternalFatalChipError";
78  case 1:
79  return "EventLost";
80  case 2:
81  return "HitRejectedByEventSizeLimit";
82  case 3:
83  return "HitErrorGroup3";
84  case 4:
85  return "HitLostL1OverflowGroup3";
86  case 5:
87  return "HitLostROFifoOverflowGroup3";
88  case 6:
89  return "HitErrorGroup2";
90  case 7:
91  return "HitLostL1OverflowGroup2";
92  case 8:
93  return "HitLostROFifoOverflowGroup2";
94  case 9:
95  return "HitErrorGroup1";
96  case 10:
97  return "HitLostL1OverflowGroup1";
98  case 11:
99  return "HitLostROFifoOverflowGroup1";
100  case 12:
101  return "HitErrorGroup0";
102  case 13:
103  return "HitLostL1OverflowGroup0";
104  case 14:
105  return "HitLostROFifoOverflowGroup0";
106  default:
107  return "NONE";
108  }
109  }
110 
111 private:
112  unsigned short error_flags;
113 };
114 
115 #endif
HPTDCErrorFlags::errorFlag
unsigned short errorFlag() const
Definition: HPTDCErrorFlags.h:72
HPTDCErrorFlags::hitErrorGroup0
bool hitErrorGroup0() const
Definition: HPTDCErrorFlags.h:68
HPTDCErrorFlags::error_flags
unsigned short error_flags
Definition: HPTDCErrorFlags.h:112
HPTDCErrorFlags::hitLostL1OverflowGroup3
bool hitLostL1OverflowGroup3() const
Definition: HPTDCErrorFlags.h:60
HPTDCErrorFlags::hitLostROFifoOverflowGroup3
bool hitLostROFifoOverflowGroup3() const
Definition: HPTDCErrorFlags.h:61
HPTDCErrorFlags
Definition: HPTDCErrorFlags.h:15
HPTDCErrorFlags::hitErrorGroup3
bool hitErrorGroup3() const
Definition: HPTDCErrorFlags.h:59
HPTDCErrorFlags::HPTDCErrorFlags
HPTDCErrorFlags(unsigned short flags=0)
Definition: HPTDCErrorFlags.h:17
HPTDCErrorFlags::hitLostL1OverflowGroup0
bool hitLostL1OverflowGroup0() const
Definition: HPTDCErrorFlags.h:69
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HPTDCErrorFlags::hitLostROFifoOverflowGroup2
bool hitLostROFifoOverflowGroup2() const
Definition: HPTDCErrorFlags.h:64
HPTDCErrorFlags::hitLostL1OverflowGroup1
bool hitLostL1OverflowGroup1() const
Definition: HPTDCErrorFlags.h:66
HPTDCErrorFlags::errorId
bool errorId(unsigned short id) const
Definition: HPTDCErrorFlags.h:19
HPTDCErrorFlags::hptdcErrorName
static std::string hptdcErrorName(const unsigned short id)
Definition: HPTDCErrorFlags.h:74
HPTDCErrorFlags::hitErrorGroup1
bool hitErrorGroup1() const
Definition: HPTDCErrorFlags.h:65
HPTDCErrorFlags::hitLostROFifoOverflowGroup1
bool hitLostROFifoOverflowGroup1() const
Definition: HPTDCErrorFlags.h:67
HPTDCErrorFlags::hitLostROFifoOverflowGroup0
bool hitLostROFifoOverflowGroup0() const
Definition: HPTDCErrorFlags.h:70
HPTDCErrorFlags::hitErrorGroup2
bool hitErrorGroup2() const
Definition: HPTDCErrorFlags.h:62
HPTDCErrorFlags::internalFatalChipError
bool internalFatalChipError() const
Definition: HPTDCErrorFlags.h:56
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13150
HPTDCErrorFlags::hitLostL1OverflowGroup2
bool hitLostL1OverflowGroup2() const
Definition: HPTDCErrorFlags.h:63
HPTDCErrorFlags::hitRejectedByEventSizeLimit
bool hitRejectedByEventSizeLimit() const
Definition: HPTDCErrorFlags.h:58
HPTDCErrorFlags::eventLost
bool eventLost() const
Definition: HPTDCErrorFlags.h:57