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
EcalChannelStatusCode::getEncodedStatusCode
uint16_t getEncodedStatusCode() const
Return the encoded raw status.
Definition: EcalChannelStatusCode.h:50
EcalChannelStatusCode
Definition: EcalChannelStatusCode.h:18
EcalChannelStatusCode::kNNNNoisy
Definition: EcalChannelStatusCode.h:27
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
EcalChannelStatusCode::kNextToDead
Definition: EcalChannelStatusCode.h:38
EcalChannelStatusCode::EcalChannelStatusCode
EcalChannelStatusCode()
Definition: EcalChannelStatusCode.h:41
EcalChannelStatusCode::chStatusMask
static const int chStatusMask
Definition: EcalChannelStatusCode.h:55
EcalChannelStatusCode::kDAC
Definition: EcalChannelStatusCode.h:22
EcalChannelStatusCode::kNoLaser
Definition: EcalChannelStatusCode.h:23
alignCSCRings.s
s
Definition: alignCSCRings.py:92
EcalChannelStatusCode::kFixedG1
Definition: EcalChannelStatusCode.h:30
EcalChannelStatusCode::EcalChannelStatusCode
EcalChannelStatusCode(const uint16_t &encodedStatus)
Definition: EcalChannelStatusCode.h:42
EcalChannelStatusCode::kDAQ
Definition: EcalChannelStatusCode.h:38
EcalChannelStatusCode::kFixedG6
Definition: EcalChannelStatusCode.h:29
EcalChannelStatusCode::kDeadFE
Definition: EcalChannelStatusCode.h:34
EcalChannelStatusCode::kNoDataNoTP
Definition: EcalChannelStatusCode.h:35
EcalChannelStatusCode::checkBit
bool checkBit(Bits bit)
Check status of desired bit.
Definition: EcalChannelStatusCode.h:53
EcalChannelStatusCode::kTP
Definition: EcalChannelStatusCode.h:38
EcalChannelStatusCode::kNonRespondingIsolated
Definition: EcalChannelStatusCode.h:32
EcalChannelStatusCode::kOk
Definition: EcalChannelStatusCode.h:21
EcalChannelStatusCode::kTrigger
Definition: EcalChannelStatusCode.h:38
EcalChannelStatusCode::getStatusCode
Code getStatusCode() const
return decoded status
Definition: EcalChannelStatusCode.h:47
Serializable.h
EcalChannelStatusCode::Bits
Bits
Definition: EcalChannelStatusCode.h:38
EcalChannelStatusCode::kNNoisy
Definition: EcalChannelStatusCode.h:25
EcalChannelStatusCode::kTemperature
Definition: EcalChannelStatusCode.h:38
EcalChannelStatusCode::print
void print(std::ostream &s) const
Definition: EcalChannelStatusCode.h:44
EcalChannelStatusCode::Code
Code
Definition: EcalChannelStatusCode.h:20
EcalChannelStatusCode::kNNNoisy
Definition: EcalChannelStatusCode.h:26
EcalChannelStatusCode::kDeadVFE
Definition: EcalChannelStatusCode.h:33
EcalChannelStatusCode::kBitsOffset
static const int kBitsOffset
Definition: EcalChannelStatusCode.h:58
EcalChannelStatusCode::kNoisy
Definition: EcalChannelStatusCode.h:24
EcalChannelStatusCode::kLV
Definition: EcalChannelStatusCode.h:38
EcalChannelStatusCode::kNNNNNoisy
Definition: EcalChannelStatusCode.h:28
EcalChannelStatusCode::kFixedG0
Definition: EcalChannelStatusCode.h:31
EcalChannelStatusCode::status_
uint16_t status_
Definition: EcalChannelStatusCode.h:83
EcalChannelStatusCode::kHV
Definition: EcalChannelStatusCode.h:38