Go to the documentation of this file.00001 #ifndef HcalChannelStatus_h
00002 #define HcalChannelStatus_h
00003
00004
00005
00006
00007
00008
00009
00010 #include <boost/cstdint.hpp>
00011
00012
00013 class HcalChannelStatus
00014 {
00015 public:
00016
00017 enum StatusBit {
00018 HcalCellOff=0,
00019 HcalCellMask=1,
00020
00021 HcalCellDead=5,
00022 HcalCellHot=6,
00023 HcalCellStabErr=7,
00024 HcalCellTimErr=8,
00025 HcalCellExcludeFromHBHENoiseSummary = 9,
00026 HcalCellExcludeFromHBHENoiseSummaryR45 = 10,
00027 HcalBadLaserSignal = 11,
00028
00029 HcalCellTrigMask=15,
00030
00031 HcalCellCaloTowerMask=18,
00032 HcalCellCaloTowerProb=19
00033 };
00034
00035 HcalChannelStatus(): mId(0), mStatus(0) {}
00036 HcalChannelStatus(unsigned long fid, uint32_t status): mId(fid), mStatus(status) {}
00037
00038
00039 void setValue(uint32_t value) {mStatus = value;}
00040
00041
00042
00043 void setBit(unsigned int bitnumber)
00044 {
00045 uint32_t statadd = 0x1<<(bitnumber);
00046 mStatus = mStatus|statadd;
00047 }
00048 void unsetBit(unsigned int bitnumber)
00049 {
00050 uint32_t statadd = 0x1<<(bitnumber);
00051 statadd = ~statadd;
00052 mStatus = mStatus&statadd;
00053 }
00054
00055 bool isBitSet(unsigned int bitnumber) const
00056 {
00057 uint32_t statadd = 0x1<<(bitnumber);
00058 return (mStatus&statadd)?(true):(false);
00059 }
00060
00061 uint32_t rawId() const {return mId;}
00062
00063 uint32_t getValue() const {return mStatus;}
00064
00065 private:
00066 uint32_t mId;
00067 uint32_t mStatus;
00068
00069 };
00070 #endif