CMS 3D CMS Logo

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 class HcalChannelStatus
00013 {
00014  public:
00015  HcalChannelStatus(): mId(0), mStatus(0), empty(true) {}
00016  HcalChannelStatus(unsigned long fid, uint32_t status): mId(fid), mStatus(status), empty(false) {}
00017 
00018   void setDetId(unsigned long fid) {mId = fid; empty = false;}
00019   void setValue(uint32_t value) {mStatus = value; empty = false;}
00020 
00021  void setBit(unsigned int bitnumber) 
00022     {
00023       uint32_t statadd = 0x1<<(bitnumber-1);
00024       mStatus = mStatus|statadd;
00025     }
00026  void unsetBit(unsigned int bitnumber) 
00027     {
00028       uint32_t statadd = 0x1<<(bitnumber-1);
00029       statadd = ~statadd;
00030       mStatus = mStatus&statadd;
00031     }
00032 
00033  uint32_t rawId() const {return mId;}
00034 
00035  uint32_t getValue() const {return mStatus;}
00036  bool isEmpty() const {return empty;}
00037 
00038 
00039   private:
00040     uint32_t mId;
00041     uint32_t mStatus;
00042     bool empty;
00043 
00044 };
00045 #endif

Generated on Tue Jun 9 17:26:34 2009 for CMSSW by  doxygen 1.5.4