CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalDQMStatusDictionary.h
Go to the documentation of this file.
1 #ifndef EcalDQMStatusDictionary_H
2 #define EcalDQMStatusDictionary_H
3 
12 #include <boost/cstdint.hpp>
13 #include <iostream>
14 #include <vector>
15 
17 
19 
20  public:
21 
22  struct codeDef {
23  uint32_t code;
24  char desc[39];
25  };
26 
27  static void getDictionary(std::vector<codeDef> &dict) {
28  dict.clear();
29  for (unsigned int i=0; i<DICTSIZE1+DICTSIZE2; i++) dict.push_back(getDef(i));
30  }
31 
32  static void getCodes(std::vector<codeDef>& codeVec, uint32_t code) {
33  codeVec.clear();
34  for (unsigned int i=0; i<DICTSIZE1+DICTSIZE2; i++) {
35  if (code & getDef(i).code) {
36  codeVec.push_back(getDef(i));
37  }
38  }
39  }
40 
41  private:
42 
43  EcalDQMStatusDictionary() {}; // Hidden to force static use
44  ~EcalDQMStatusDictionary() {}; // Hidden to force static use
45 
46  const static unsigned int DICTSIZE1 = 30;
47  const static unsigned int DICTSIZE2 = 7;
48 
49  static codeDef getDef(unsigned int i) {
50  const static codeDef DICT[DICTSIZE1+DICTSIZE2] =
51  {
52 
53  // single status codes
54 
55  { ((uint32_t) 1 << EcalDQMStatusHelper::CH_ID_ERROR), "CH_ID_ERROR" },
56  { ((uint32_t) 1 << EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR), "CH_GAIN_ZERO_ERROR" },
57  { ((uint32_t) 1 << EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR), "CH_GAIN_SWITCH_ERROR" },
58  { ((uint32_t) 1 << EcalDQMStatusHelper::TT_ID_ERROR), "TT_ID_ERROR"},
59  { ((uint32_t) 1 << EcalDQMStatusHelper::TT_SIZE_ERROR), "TT_SIZE_ERROR"},
60 
61  { ((uint32_t) 1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR), "PEDESTAL_LOW_GAIN_MEAN_ERROR"},
62  { ((uint32_t) 1 << EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_MEAN_ERROR), "PEDESTAL_MIDDLE_GAIN_MEAN_ERROR"},
63  { ((uint32_t) 1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR), "PEDESTAL_HIGH_GAIN_MEAN_ERROR"},
64  { ((uint32_t) 1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_RMS_ERROR), "PEDESTAL_LOW_GAIN_RMS_ERROR"},
65  { ((uint32_t) 1 << EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_RMS_ERROR), "PEDESTAL_MIDDLE_GAIN_RMS_ERROR"},
66  { ((uint32_t) 1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_RMS_ERROR), "PEDESTAL_HIGH_GAIN_RMS_ERROR"},
67 
68  { ((uint32_t) 1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR), "PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR"},
69  { ((uint32_t) 1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR), "PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR"},
70 
71  { ((uint32_t) 1 << EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_MEAN_ERROR), "TESTPULSE_LOW_GAIN_MEAN_ERROR"},
72  { ((uint32_t) 1 << EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_MEAN_ERROR), "TESTPULSE_MIDDLE_GAIN_MEAN_ERROR"},
73  { ((uint32_t) 1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR), "TESTPULSE_HIGH_GAIN_MEAN_ERROR"},
74  { ((uint32_t) 1 << EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_RMS_ERROR), "TESTPULSE_LOW_GAIN_RMS_ERROR"},
75  { ((uint32_t) 1 << EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_RMS_ERROR), "TESTPULSE_MIDDLE_GAIN_RMS_ERROR"},
76  { ((uint32_t) 1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_RMS_ERROR), "TESTPULSE_HIGH_GAIN_RMS_ERROR"},
77 
78  { ((uint32_t) 1 << EcalDQMStatusHelper::LASER_MEAN_ERROR), "LASER_MEAN_ERROR"},
79  { ((uint32_t) 1 << EcalDQMStatusHelper::LASER_RMS_ERROR), "LASER_RMS_ERROR"},
80  { ((uint32_t) 1 << EcalDQMStatusHelper::LASER_TIMING_MEAN_ERROR), "LASER_TIMING_MEAN_ERROR"},
81  { ((uint32_t) 1 << EcalDQMStatusHelper::LASER_TIMING_RMS_ERROR), "LASER_TIMING_RMS_ERROR"},
82 
83  { ((uint32_t) 1 << EcalDQMStatusHelper::LED_MEAN_ERROR), "LED_MEAN_ERROR"},
84  { ((uint32_t) 1 << EcalDQMStatusHelper::LED_RMS_ERROR), "LED_RMS_ERROR"},
85  { ((uint32_t) 1 << EcalDQMStatusHelper::LED_TIMING_MEAN_ERROR), "LED_TIMING_MEAN_ERROR"},
86  { ((uint32_t) 1 << EcalDQMStatusHelper::LED_TIMING_RMS_ERROR), "LED_TIMING_RMS_ERROR"},
87 
88  { ((uint32_t) 1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR), "STATUS_FLAG_ERROR"},
89 
90  { ((uint32_t) 1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING), "PHYSICS_BAD_CHANNEL_WARNING"},
91  { ((uint32_t) 1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_ERROR), "PHYSICS_BAD_CHANNEL_ERROR"},
92 
93  // combined status codes
94 
95  { ((uint32_t) 1 << EcalDQMStatusHelper::TT_SIZE_ERROR |
106  1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_ERROR), "disabled_channel"},
107 
131  1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_ERROR), "dead_channel"},
132 
141 
147  1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_RMS_ERROR), "testpulse_problem"},
148 
149  { ((uint32_t) 1 << EcalDQMStatusHelper::LASER_MEAN_ERROR |
152  1 << EcalDQMStatusHelper::LASER_TIMING_RMS_ERROR), "laser_problem"},
153 
154  { ((uint32_t) 1 << EcalDQMStatusHelper::LED_MEAN_ERROR |
157  1 << EcalDQMStatusHelper::LED_TIMING_RMS_ERROR), "led_problem"},
158 
163  1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_ERROR), "noise_problem"}
164 
165  };
166 
167  return DICT[i];
168  }
169 
170 
171 };
172 
173 #endif // EcalDQMStatusDictionary_H
static const int LED_MEAN_ERROR
int i
Definition: DBlmapReader.cc:9
static void getCodes(std::vector< codeDef > &codeVec, uint32_t code)
static const int PEDESTAL_MIDDLE_GAIN_RMS_ERROR
static const int LASER_MEAN_ERROR
static const int TESTPULSE_LOW_GAIN_RMS_ERROR
static const int PHYSICS_BAD_CHANNEL_WARNING
static const int LASER_TIMING_RMS_ERROR
static const int PEDESTAL_HIGH_GAIN_MEAN_ERROR
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
static const unsigned int DICTSIZE2
static const int PHYSICS_BAD_CHANNEL_ERROR
static const int TT_SIZE_ERROR
static const int CH_GAIN_SWITCH_ERROR
static const int TESTPULSE_MIDDLE_GAIN_MEAN_ERROR
static const int PEDESTAL_LOW_GAIN_RMS_ERROR
static const int PEDESTAL_HIGH_GAIN_RMS_ERROR
static const int STATUS_FLAG_ERROR
static const int TESTPULSE_MIDDLE_GAIN_RMS_ERROR
static void getDictionary(std::vector< codeDef > &dict)
static const unsigned int DICTSIZE1
static codeDef getDef(unsigned int i)
static const int TESTPULSE_HIGH_GAIN_RMS_ERROR
static const int LED_TIMING_MEAN_ERROR
static const int PEDESTAL_LOW_GAIN_MEAN_ERROR
static const int TESTPULSE_LOW_GAIN_MEAN_ERROR
static const int LED_TIMING_RMS_ERROR
static const int CH_GAIN_ZERO_ERROR
static const int PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR
static const int LASER_TIMING_MEAN_ERROR
static const int TT_ID_ERROR
static const int LED_RMS_ERROR
static const int PEDESTAL_MIDDLE_GAIN_MEAN_ERROR
static const int TESTPULSE_HIGH_GAIN_MEAN_ERROR
static const int LASER_RMS_ERROR
static const int CH_ID_ERROR