#include <DQM/HcalMonitorClient/interface/HcalDQMChannelQuality.h>
Public Types | |
enum | Quality { UNKNOWN = 0, BAD = 1, GOOD = 2, COOL = 3, HOT = 4, DEAD = 5, END = 6 } |
Public Member Functions | |
std::string | comment (unsigned long fId, bool fWarning=true) const |
unsigned short | flagAlgo (unsigned long fId, bool fWarning=true) const |
std::vector< unsigned long > | getAllChannels () const |
HcalDQMChannelQuality () | |
bool | isMasked (unsigned long fId, bool fWarning=true) const |
bool | maskCell (Quality fQual) const |
Quality | quality (unsigned long fId, bool fWarning=true) const |
bool | setChannel (unsigned long fId, unsigned short algo, Quality fQuality=UNKNOWN) |
void | sort () |
bool | sorted () const |
~HcalDQMChannelQuality () | |
Static Public Member Functions | |
static const char * | str (Quality fQuality) |
Protected Attributes | |
std::vector< Item > | mItems |
bool | mSorted |
Classes | |
class | Item |
Definition at line 10 of file HcalDQMChannelQuality.h.
HcalDQMChannelQuality::HcalDQMChannelQuality | ( | ) |
HcalDQMChannelQuality::~HcalDQMChannelQuality | ( | ) |
std::string HcalDQMChannelQuality::comment | ( | unsigned long | fId, | |
bool | fWarning = true | |||
) | const |
unsigned short HcalDQMChannelQuality::flagAlgo | ( | unsigned long | fId, | |
bool | fWarning = true | |||
) | const |
Definition at line 45 of file HcalDQMChannelQuality.cc.
References TestMuL1L2Filter_cff::cerr, lat::endl(), find(), HcalDQMChannelQuality::Item::mId, mItems, sorted(), and target.
00045 { 00046 00047 Item target; 00048 target.mId = fId; 00049 std::vector<Item>::const_iterator cell; 00050 if (sorted ()) { 00051 cell = std::lower_bound (mItems.begin(), mItems.end(), target); 00052 } 00053 else { 00054 if (fWarning) std::cerr << "HcalDQMChannelQuality::quality-> container is not sorted. Sort it to search effectively" << std::endl; 00055 cell = std::find (mItems.begin(), mItems.end(), target); 00056 } 00057 if (cell == mItems.end() || cell->mId != fId) 00058 throw cms::Exception ("Conditions not found") << "Unavailable Quality for cell " << fId; 00059 return cell->mAlgo; 00060 00061 }
std::vector< unsigned long > HcalDQMChannelQuality::getAllChannels | ( | ) | const |
Definition at line 63 of file HcalDQMChannelQuality.cc.
References mItems, and HLT_VtxMuL3::result.
00063 { 00064 std::vector<unsigned long> result; 00065 for (std::vector<Item>::const_iterator item = mItems.begin (); item != mItems.end (); item++) { 00066 result.push_back (item->mId); 00067 } 00068 return result; 00069 }
Definition at line 27 of file HcalDQMChannelQuality.cc.
References TestMuL1L2Filter_cff::cerr, lat::endl(), find(), HcalDQMChannelQuality::Item::mId, mItems, sorted(), and target.
00027 { 00028 00029 Item target; 00030 target.mId = fId; 00031 std::vector<Item>::const_iterator cell; 00032 if (sorted ()) { 00033 cell = std::lower_bound (mItems.begin(), mItems.end(), target); 00034 } 00035 else { 00036 if (fWarning) std::cerr << "HcalDQMChannelQuality::quality-> container is not sorted. Sort it to search effectively" << std::endl; 00037 cell = std::find (mItems.begin(), mItems.end(), target); 00038 } 00039 if (cell == mItems.end() || cell->mId != fId) 00040 throw cms::Exception ("Conditions not found") << "Unavailable Quality for cell " << fId; 00041 return cell->mMasked; 00042 00043 }
Definition at line 81 of file HcalDQMChannelQuality.cc.
References BAD, COOL, DEAD, END, GOOD, and HOT.
Referenced by setChannel().
00081 { 00082 switch (fQuality) { 00083 case BAD: return true; 00084 case HOT: return true; 00085 case GOOD: return false; 00086 case COOL: return false; 00087 case DEAD: return false; 00088 case END: return false; 00089 default: return false; 00090 } 00091 }
HcalDQMChannelQuality::Quality HcalDQMChannelQuality::quality | ( | unsigned long | fId, | |
bool | fWarning = true | |||
) | const |
Definition at line 11 of file HcalDQMChannelQuality.cc.
References TestMuL1L2Filter_cff::cerr, lat::endl(), find(), HcalDQMChannelQuality::Item::mId, mItems, sorted(), and target.
00011 { 00012 Item target; 00013 target.mId = fId; 00014 std::vector<Item>::const_iterator cell; 00015 if (sorted ()) { 00016 cell = std::lower_bound (mItems.begin(), mItems.end(), target); 00017 } 00018 else { 00019 if (fWarning) std::cerr << "HcalDQMChannelQuality::quality-> container is not sorted. Sort it to search effectively" << std::endl; 00020 cell = std::find (mItems.begin(), mItems.end(), target); 00021 } 00022 if (cell == mItems.end() || cell->mId != fId) 00023 throw cms::Exception ("Conditions not found") << "Unavailable Quality for cell " << fId; 00024 return (HcalDQMChannelQuality::Quality) cell->mQuality; 00025 }
bool HcalDQMChannelQuality::setChannel | ( | unsigned long | fId, | |
unsigned short | algo, | |||
Quality | fQuality = UNKNOWN | |||
) |
Definition at line 71 of file HcalDQMChannelQuality.cc.
References HcalDQMChannelQuality::Item::mAlgo, maskCell(), HcalDQMChannelQuality::Item::mId, HcalDQMChannelQuality::Item::mMasked, HcalDQMChannelQuality::Item::mQuality, and mSorted.
00071 { 00072 Item item; 00073 item.mId = fId; 00074 item.mAlgo = fAlgo; 00075 item.mMasked = maskCell(fQuality); 00076 item.mQuality = unsigned (fQuality); 00077 mSorted = false; 00078 return true; 00079 }
void HcalDQMChannelQuality::sort | ( | ) |
Definition at line 93 of file HcalDQMChannelQuality.cc.
References mItems, mSorted, and python::multivaluedict::sort().
00093 { 00094 if (!mSorted) { 00095 std::sort (mItems.begin(), mItems.end()); 00096 mSorted = true; 00097 } 00098 }
bool HcalDQMChannelQuality::sorted | ( | ) | const [inline] |
Definition at line 31 of file HcalDQMChannelQuality.h.
References mSorted.
Referenced by flagAlgo(), isMasked(), and quality().
00031 {return mSorted;}
const char * HcalDQMChannelQuality::str | ( | Quality | fQuality | ) | [static] |
Definition at line 100 of file HcalDQMChannelQuality.cc.
References BAD, COOL, DEAD, END, GOOD, and HOT.
00100 { 00101 switch (fQuality) { 00102 case BAD: return "BAD"; 00103 case GOOD: return "GOOD"; 00104 case COOL: return "COOL"; 00105 case HOT: return "HOT"; 00106 case DEAD: return "DEAD"; 00107 case END: return "END"; 00108 default: return "UNKNOWN"; 00109 } 00110 }
std::vector<Item> HcalDQMChannelQuality::mItems [protected] |
Definition at line 49 of file HcalDQMChannelQuality.h.
Referenced by flagAlgo(), getAllChannels(), isMasked(), quality(), and sort().
bool HcalDQMChannelQuality::mSorted [protected] |
Definition at line 50 of file HcalDQMChannelQuality.h.
Referenced by setChannel(), sort(), and sorted().