File indexing completed on 2023-03-17 10:46:57
0001 #ifndef HcalChannelStatus_h
0002 #define HcalChannelStatus_h
0003
0004
0005
0006
0007
0008
0009
0010 #include "CondFormats/Serialization/interface/Serializable.h"
0011 #include <cstdint>
0012
0013 class HcalChannelStatus {
0014 public:
0015
0016 enum StatusBit {
0017 HcalCellOff = 0,
0018 HcalCellMask = 1,
0019
0020 HcalCellDead = 5,
0021 HcalCellHot = 6,
0022 HcalCellStabErr = 7,
0023 HcalCellTimErr = 8,
0024 HcalCellExcludeFromHBHENoiseSummary = 9,
0025 HcalCellExcludeFromHBHENoiseSummaryR45 =
0026 10,
0027 HcalBadLaserSignal = 11,
0028
0029 HcalCellTrigMask = 15,
0030
0031 HcalCellCaloTowerMask = 18,
0032 HcalCellCaloTowerProb = 19
0033 };
0034
0035 HcalChannelStatus() : mId(0), mStatus(0) {}
0036 HcalChannelStatus(unsigned long fid, uint32_t status) : mId(fid), mStatus(status) {}
0037
0038
0039 void setValue(uint32_t value) { mStatus = value; }
0040
0041
0042
0043 void setBit(unsigned int bitnumber) {
0044 uint32_t statadd = 0x1 << (bitnumber);
0045 mStatus = mStatus | statadd;
0046 }
0047 void unsetBit(unsigned int bitnumber) {
0048 uint32_t statadd = 0x1 << (bitnumber);
0049 statadd = ~statadd;
0050 mStatus = mStatus & statadd;
0051 }
0052
0053 bool isBitSet(unsigned int bitnumber) const {
0054 uint32_t statadd = 0x1 << (bitnumber);
0055 return (mStatus & statadd) ? (true) : (false);
0056 }
0057
0058 uint32_t rawId() const { return mId; }
0059
0060 uint32_t getValue() const { return mStatus; }
0061
0062 private:
0063 uint32_t mId;
0064 uint32_t mStatus;
0065
0066 COND_SERIALIZABLE;
0067 };
0068 #endif