CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DQM/HcalMonitorClient/interface/HcalDQMChannelQuality.h

Go to the documentation of this file.
00001 #ifndef HcalDQMChannelQuality_h
00002 #define HcalDQMChannelQuality_h
00003 
00004 #include <string>
00005 #include <vector>
00006 #include <algorithm>
00007 #include <boost/cstdint.hpp>
00008 
00009 // 
00010 class HcalDQMChannelQuality {
00011  public:
00012   enum Quality {
00013     UNKNOWN = 0,
00014     BAD = 1,
00015     GOOD = 2,
00016     COOL = 3,
00017     HOT = 4,
00018     DEAD = 5,
00019     END = 6
00020   };
00021 
00022   HcalDQMChannelQuality();
00023   ~HcalDQMChannelQuality();
00024 
00025   Quality quality (unsigned long fId, bool fWarning = true) const;
00026   bool isMasked (unsigned long fId, bool fWarning = true) const;
00027   unsigned short flagAlgo (unsigned long fId, bool fWarning = true) const;
00028   std::string comment (unsigned long fId, bool fWarning = true) const;
00029   bool maskCell (Quality fQual) const;
00030 
00031   bool sorted () const {return mSorted;}
00032   // get list of all available channels
00033   std::vector<unsigned long> getAllChannels () const;
00034   bool setChannel (unsigned long fId, unsigned short algo, Quality fQuality = UNKNOWN);
00035 
00036   void sort ();
00037   static const char* str (Quality fQuality);
00038   class Item {
00039   public:
00040     bool operator< (const Item& other) const {return mId < other.mId;}
00041     bool operator== (const Item& other) const {return mId == other.mId;}
00042     uint32_t mId;
00043     short    mAlgo;
00044     bool mMasked;
00045     std::string   mComment;
00046     unsigned mQuality;
00047   };
00048  protected:
00049   std::vector<Item> mItems;
00050   bool mSorted;
00051 };
00052 
00053 #endif
00054