CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HPTDCErrorFlags.h
Go to the documentation of this file.
1 #ifndef CTPPSDigi_HPTDCErrorFlags_h
2 #define CTPPSDigi_HPTDCErrorFlags_h
3 
4 #include <string>
5 
15 // namespace HPTDCErrors {
17 HPTDCErrorFlags(unsigned short flags=0): error_flags(flags) {}
18 
19  public:
20  bool getErrorId(unsigned short id)
21  {
22  switch (id) {
23  case 0: return getInternalFatalChipError();
24  case 1: return getEventLost();
25  case 2: return getHitRejectedByEventSizeLimit();
26  case 3: return getHitErrorGroup3();
27  case 4: return getHitLostL1OverflowGroup3();
28  case 5: return getHitLostROFifoOverflowGroup3();
29  case 6: return getHitErrorGroup2();
30  case 7: return getHitLostL1OverflowGroup2();
31  case 8: return getHitLostROFifoOverflowGroup2();
32  case 9: return getHitErrorGroup1();
33  case 10: return getHitLostL1OverflowGroup1();
34  case 11: return getHitLostROFifoOverflowGroup1();
35  case 12: return getHitErrorGroup0();
36  case 13: return getHitLostL1OverflowGroup0();
37  case 14: return getHitLostROFifoOverflowGroup0();
38  default: return true;
39  }
40  }
41 
42  bool getInternalFatalChipError() { return error_flags&0x1; }
43  bool getEventLost() { return (error_flags>> 1)&0x1; }
44  bool getHitRejectedByEventSizeLimit() { return (error_flags>> 2)&0x1; }
45  bool getHitErrorGroup3() { return (error_flags>> 3)&0x1; }
46  bool getHitLostL1OverflowGroup3() { return (error_flags>> 4)&0x1; }
47  bool getHitLostROFifoOverflowGroup3() { return (error_flags>> 5)&0x1; }
48  bool getHitErrorGroup2() { return (error_flags>> 6)&0x1; }
49  bool getHitLostL1OverflowGroup2() { return (error_flags>> 7)&0x1; }
50  bool getHitLostROFifoOverflowGroup2() { return (error_flags>> 8)&0x1; }
51  bool getHitErrorGroup1() { return (error_flags>> 9)&0x1; }
52  bool getHitLostL1OverflowGroup1() { return (error_flags>>10)&0x1; }
53  bool getHitLostROFifoOverflowGroup1() { return (error_flags>>11)&0x1; }
54  bool getHitErrorGroup0() { return (error_flags>>12)&0x1; }
55  bool getHitLostL1OverflowGroup0() { return (error_flags>>13)&0x1; }
56  bool getHitLostROFifoOverflowGroup0() { return (error_flags>>14)&0x1; }
57 
58  inline unsigned short getErrorFlag() const
59  {
60  return error_flags;
61  }
62 
63  static std::string getHPTDCErrorName(const unsigned short id)
64  {
65  switch (id) {
66  case 0: return "InternalFatalChipError";
67  case 1: return "EventLost";
68  case 2: return "HitRejectedByEventSizeLimit";
69  case 3: return "HitErrorGroup3";
70  case 4: return "HitLostL1OverflowGroup3";
71  case 5: return "HitLostROFifoOverflowGroup3";
72  case 6: return "HitErrorGroup2";
73  case 7: return "HitLostL1OverflowGroup2";
74  case 8: return "HitLostROFifoOverflowGroup2";
75  case 9: return "HitErrorGroup1";
76  case 10: return "HitLostL1OverflowGroup1";
77  case 11: return "HitLostROFifoOverflowGroup1";
78  case 12: return "HitErrorGroup0";
79  case 13: return "HitLostL1OverflowGroup0";
80  case 14: return "HitLostROFifoOverflowGroup0";
81  default: return "NONE";
82  }
83  }
84 
85  private:
86  unsigned short error_flags;
87 
88 
89 };
90 
91 
92 
93 #endif
94 
unsigned short error_flags
unsigned short getErrorFlag() const
bool getHitLostROFifoOverflowGroup1()
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
bool getInternalFatalChipError()
bool getHitLostL1OverflowGroup2()
bool getHitLostROFifoOverflowGroup0()
bool getHitErrorGroup3()
bool getHitLostROFifoOverflowGroup2()
HPTDCErrorFlags(unsigned short flags=0)
bool getHitLostL1OverflowGroup3()
bool getHitErrorGroup2()
bool getErrorId(unsigned short id)
bool getHitRejectedByEventSizeLimit()
bool getHitErrorGroup0()
static std::string getHPTDCErrorName(const unsigned short id)
bool getHitLostL1OverflowGroup0()
bool getHitLostL1OverflowGroup1()
bool getHitLostROFifoOverflowGroup3()
bool getHitErrorGroup1()