test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalChannelStatusCode.h
Go to the documentation of this file.
1 #ifndef CondFormats_EcalObjects_EcalChannelStatusCode_H
2 #define CondFormats_EcalObjects_EcalChannelStatusCode_H
3 
10 
11 #include <iostream>
12 #include <boost/cstdint.hpp>
13 
20 
21 
22  public :
23 
24  enum Code {
25  kOk=0,
40  };
41 
42  enum Bits {
43  kHV=0,
44  kLV,
46  kTP,
50  };
51 
52  public:
53 
55  EcalChannelStatusCode(const uint16_t& encodedStatus) : status_(encodedStatus) {};
56 
57 
58  void print(std::ostream& s) const { s << "status is: " << status_; }
59 
62 
64  uint16_t getEncodedStatusCode() const { return status_; }
65 
67  bool checkBit(Bits bit) {return status_& (0x1<<(bit+kBitsOffset));}
68 
69  static const int chStatusMask = 0x1F;
70 
71  private:
72 
73  static const int kBitsOffset= 5;
74  /* bits 1-5 store a status code:
75  0 channel ok
76  1 DAC settings problem, pedestal not in the design range
77  2 channel with no laser, ok elsewhere
78  3 noisy
79  4 very noisy
80  5-7 reserved for more categories of noisy channels
81  8 channel at fixed gain 6 (or 6 and 1)
82  9 channel at fixed gain 1
83  10 channel at fixed gain 0 (dead of type this)
84  11 non responding isolated channel (dead of type other)
85  12 channel and one or more neigbors not responding
86  (e.g.: in a dead VFE 5x1 channel)
87  13 channel in TT with no data link, TP data ok
88  14 channel in TT with no data link and no TP data
89 
90  bit 6 : HV on/off
91  bit 7 : LV on/off
92  bit 8 : DAQ in/out
93  bit 9 : TP readout on/off
94  bit 10: Trigger in/out
95  bit 11: Temperature ok/not ok
96  bit 12: channel next to a dead channel
97  */
98  uint16_t status_;
99 
101 };
102 #endif
void print(std::ostream &s) const
Code getStatusCode() const
return decoded status
EcalChannelStatusCode(const uint16_t &encodedStatus)
static const int kBitsOffset
bool checkBit(Bits bit)
Check status of desired bit.
uint16_t getEncodedStatusCode() const
Return the encoded raw status.
static const int chStatusMask
#define COND_SERIALIZABLE
Definition: Serializable.h:30