CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalChannelStatus.h
Go to the documentation of this file.
1 #ifndef HcalChannelStatus_h
2 #define HcalChannelStatus_h
3 
4 /*
5 \class HcalChannelStatus
6 \author Radek Ofierzynski
7 contains one channel status and corresponding DetId
8 */
9 
10 #include <boost/cstdint.hpp>
11 
12 
14 {
15  public:
16  // contains the defined bits for easy access, see https://twiki.cern.ch/twiki/bin/view/CMS/HcalDataValidationWorkflow
17  enum StatusBit {
18  HcalCellOff=0, // 1=Hcal cell is off
19  HcalCellMask=1, // 1=Hcal cell is masked/to be masked at RecHit Level
20  // Quality Bits
21  HcalCellDead=5, // 1=Hcal cell is dead (from DQM algo)
22  HcalCellHot=6, // 1=Hcal cell is hot (from DQM algo)
23  HcalCellStabErr=7, // 1=Hcal cell has stability error
24  HcalCellTimErr=8, // 1=Hcal cell has timing error
25  // Trigger Bits
26  HcalCellTrigMask=15, // 1=cell is masked from the Trigger
27  // CaloTower Bits
28  HcalCellCaloTowerMask=18, // 1=cell is always excluded from the CaloTower, regardless of other bit settings.
29  HcalCellCaloTowerProb=19 // 1=cell is counted as problematic within the tower.
30  };
31 
33  HcalChannelStatus(unsigned long fid, uint32_t status): mId(fid), mStatus(status) {}
34 
35  // void setDetId(unsigned long fid) {mId = fid;}
36  void setValue(uint32_t value) {mStatus = value;}
37 
38  // for the following, one can use unsigned int values or HcalChannelStatus::StatusBit values
39  // e.g. 5 or HcalChannelStatus::HcalCellDead
40  void setBit(unsigned int bitnumber)
41  {
42  uint32_t statadd = 0x1<<(bitnumber);
43  mStatus = mStatus|statadd;
44  }
45  void unsetBit(unsigned int bitnumber)
46  {
47  uint32_t statadd = 0x1<<(bitnumber);
48  statadd = ~statadd;
49  mStatus = mStatus&statadd;
50  }
51 
52  bool isBitSet(unsigned int bitnumber) const
53  {
54  uint32_t statadd = 0x1<<(bitnumber);
55  return (mStatus&statadd)?(true):(false);
56  }
57 
58  uint32_t rawId() const {return mId;}
59 
60  uint32_t getValue() const {return mStatus;}
61 
62  private:
63  uint32_t mId;
64  uint32_t mStatus;
65 
66 };
67 #endif
HcalChannelStatus(unsigned long fid, uint32_t status)
void unsetBit(unsigned int bitnumber)
void setBit(unsigned int bitnumber)
uint32_t rawId() const
bool isBitSet(unsigned int bitnumber) const
void setValue(uint32_t value)
tuple status
Definition: ntuplemaker.py:245
uint32_t getValue() const
list fid
Definition: NewTree.py:51