File indexing completed on 2024-09-07 04:35:37
0001 #ifndef CondFormats_EcalObjects_EcalChannelStatusCode_H
0002 #define CondFormats_EcalObjects_EcalChannelStatusCode_H
0003
0004
0005
0006
0007
0008 #include "CondFormats/Serialization/interface/Serializable.h"
0009
0010 #include <iostream>
0011 #include <cstdint>
0012
0013
0014
0015
0016
0017
0018 class EcalChannelStatusCode {
0019 public:
0020 enum Code {
0021 kOk = 0,
0022 kDAC,
0023 kNoLaser,
0024 kNoisy,
0025 kNNoisy,
0026 kNNNoisy,
0027 kNNNNoisy,
0028 kNNNNNoisy,
0029 kFixedG6,
0030 kFixedG1,
0031 kFixedG0,
0032 kNonRespondingIsolated,
0033 kDeadVFE,
0034 kDeadFE,
0035 kNoDataNoTP
0036 };
0037
0038 enum Bits { kHV = 0, kLV, kDAQ, kTP, kTrigger, kTemperature, kNextToDead };
0039
0040 public:
0041 EcalChannelStatusCode() : status_(0) {}
0042 EcalChannelStatusCode(const uint16_t& encodedStatus) : status_(encodedStatus) {}
0043
0044 void print(std::ostream& s) const { s << "status is: " << status_; }
0045
0046
0047 Code getStatusCode() const { return Code(status_ & chStatusMask); }
0048
0049
0050 uint16_t getEncodedStatusCode() const { return status_; }
0051
0052
0053 bool checkBit(Bits bit) { return status_ & (0x1 << (bit + kBitsOffset)); }
0054
0055 static const int chStatusMask = 0x1F;
0056
0057 private:
0058 static const int kBitsOffset = 5;
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083 uint16_t status_;
0084
0085 COND_SERIALIZABLE;
0086 };
0087 #endif