CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
unsigned short errorFlag() const
bool eventLost() const
bool hitErrorGroup3() const
bool hitLostROFifoOverflowGroup1() const
bool hitErrorGroup0() const
static std::string hptdcErrorName(const unsigned short id)
bool hitLostROFifoOverflowGroup2() const
bool hitLostL1OverflowGroup2() const
bool hitLostROFifoOverflowGroup0() const
unsigned short error_flags
bool internalFatalChipError() const
bool hitErrorGroup1() const
bool hitLostL1OverflowGroup1() const
bool hitLostROFifoOverflowGroup3() const
bool hitLostL1OverflowGroup0() const
bool hitRejectedByEventSizeLimit() const
bool errorId(unsigned short id) const
bool hitLostL1OverflowGroup3() const
bool hitErrorGroup2() const
HPTDCErrorFlags(unsigned short flags=0)