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  HcalCellExcludeFromHBHENoiseSummary = 9, //1=cell is completely excluded from all HBHENoiseSummary computations
26  HcalCellExcludeFromHBHENoiseSummaryR45 = 10, //1=cell's rechit is excluded when calculating the TS4TS5 ratio only in the HBHE Noise Summary
27  HcalBadLaserSignal = 11, //1 = channel does not receive good laser calibration signal
28  // Trigger Bits
29  HcalCellTrigMask=15, // 1=cell is masked from the Trigger
30  // CaloTower Bits
31  HcalCellCaloTowerMask=18, // 1=cell is always excluded from the CaloTower, regardless of other bit settings.
32  HcalCellCaloTowerProb=19 // 1=cell is counted as problematic within the tower.
33  };
34 
36  HcalChannelStatus(unsigned long fid, uint32_t status): mId(fid), mStatus(status) {}
37 
38  // void setDetId(unsigned long fid) {mId = fid;}
39  void setValue(uint32_t value) {mStatus = value;}
40 
41  // for the following, one can use unsigned int values or HcalChannelStatus::StatusBit values
42  // e.g. 5 or HcalChannelStatus::HcalCellDead
43  void setBit(unsigned int bitnumber)
44  {
45  uint32_t statadd = 0x1<<(bitnumber);
46  mStatus = mStatus|statadd;
47  }
48  void unsetBit(unsigned int bitnumber)
49  {
50  uint32_t statadd = 0x1<<(bitnumber);
51  statadd = ~statadd;
52  mStatus = mStatus&statadd;
53  }
54 
55  bool isBitSet(unsigned int bitnumber) const
56  {
57  uint32_t statadd = 0x1<<(bitnumber);
58  return (mStatus&statadd)?(true):(false);
59  }
60 
61  uint32_t rawId() const {return mId;}
62 
63  uint32_t getValue() const {return mStatus;}
64 
65  private:
66  uint32_t mId;
67  uint32_t mStatus;
68 
69 };
70 #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