CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/CondFormats/HcalObjects/interface/HcalChannelStatus.h

Go to the documentation of this file.
00001 #ifndef HcalChannelStatus_h
00002 #define HcalChannelStatus_h
00003 
00004 /* 
00005 \class HcalChannelStatus
00006 \author Radek Ofierzynski
00007 contains one channel status and corresponding DetId
00008 */
00009 
00010 #include <boost/cstdint.hpp>
00011 
00012 
00013 class HcalChannelStatus
00014 {
00015  public:
00016   // contains the defined bits for easy access, see https://twiki.cern.ch/twiki/bin/view/CMS/HcalDataValidationWorkflow
00017   enum StatusBit {       
00018     HcalCellOff=0,             // 1=Hcal cell is off
00019     HcalCellMask=1,            // 1=Hcal cell is masked/to be masked at RecHit Level
00020     // Quality Bits
00021     HcalCellDead=5,            // 1=Hcal cell is dead (from DQM algo)
00022     HcalCellHot=6,             // 1=Hcal cell is hot (from DQM algo)
00023     HcalCellStabErr=7,         // 1=Hcal cell has stability error
00024     HcalCellTimErr=8,          // 1=Hcal cell has timing error
00025     HcalCellExcludeFromHBHENoiseSummary = 9, //1=cell is completely excluded from all HBHENoiseSummary computations 
00026     HcalCellExcludeFromHBHENoiseSummaryR45 = 10, //1=cell's rechit is excluded when calculating the TS4TS5 ratio only in the HBHE Noise Summary
00027     HcalBadLaserSignal = 11,  //1 = channel does not receive good laser calibration signal
00028     // Trigger Bits
00029     HcalCellTrigMask=15,       // 1=cell is masked from the Trigger 
00030     // CaloTower Bits
00031     HcalCellCaloTowerMask=18,  // 1=cell is always excluded from the CaloTower, regardless of other bit settings.
00032     HcalCellCaloTowerProb=19   // 1=cell is counted as problematic within the tower.
00033   };
00034 
00035   HcalChannelStatus(): mId(0), mStatus(0) {}
00036   HcalChannelStatus(unsigned long fid, uint32_t status): mId(fid), mStatus(status) {}
00037 
00038   //  void setDetId(unsigned long fid) {mId = fid;}
00039   void setValue(uint32_t value) {mStatus = value;}
00040 
00041   // for the following, one can use unsigned int values or HcalChannelStatus::StatusBit values
00042   //   e.g. 5 or HcalChannelStatus::HcalCellDead
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