CMS 3D CMS Logo

EcalChannelStatusCode.h
Go to the documentation of this file.
1 #ifndef CondFormats_EcalObjects_EcalChannelStatusCode_H
2 #define CondFormats_EcalObjects_EcalChannelStatusCode_H
3 
9 
10 #include <iostream>
11 #include <cstdint>
12 
19 public:
20  enum Code {
21  kOk = 0,
36  };
37 
39 
40 public:
42  EcalChannelStatusCode(const uint16_t& encodedStatus) : status_(encodedStatus){};
43 
44  void print(std::ostream& s) const { s << "status is: " << status_; }
45 
47  Code getStatusCode() const { return Code(status_ & chStatusMask); }
48 
50  uint16_t getEncodedStatusCode() const { return status_; }
51 
53  bool checkBit(Bits bit) { return status_ & (0x1 << (bit + kBitsOffset)); }
54 
55  static const int chStatusMask = 0x1F;
56 
57 private:
58  static const int kBitsOffset = 5;
59  /* bits 1-5 store a status code:
60  0 channel ok
61  1 DAC settings problem, pedestal not in the design range
62  2 channel with no laser, ok elsewhere
63  3 noisy
64  4 very noisy
65  5-7 reserved for more categories of noisy channels
66  8 channel at fixed gain 6 (or 6 and 1)
67  9 channel at fixed gain 1
68  10 channel at fixed gain 0 (dead of type this)
69  11 non responding isolated channel (dead of type other)
70  12 channel and one or more neigbors not responding
71  (e.g.: in a dead VFE 5x1 channel)
72  13 channel in TT with no data link, TP data ok
73  14 channel in TT with no data link and no TP data
74 
75  bit 6 : HV on/off
76  bit 7 : LV on/off
77  bit 8 : DAQ in/out
78  bit 9 : TP readout on/off
79  bit 10: Trigger in/out
80  bit 11: Temperature ok/not ok
81  bit 12: channel next to a dead channel
82  */
83  uint16_t status_;
84 
86 };
87 #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:38