#include <HcalDQMChannelQuality.h>
Classes | |
class | Item |
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 |
Definition at line 10 of file HcalDQMChannelQuality.h.
HcalDQMChannelQuality::HcalDQMChannelQuality | ( | ) |
Definition at line 6 of file HcalDQMChannelQuality.cc.
: mSorted (false) {}
HcalDQMChannelQuality::~HcalDQMChannelQuality | ( | ) |
Definition at line 9 of file HcalDQMChannelQuality.cc.
{}
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 ExpressReco_HICollisions_FallBack::cerr, spr::find(), HcalDQMChannelQuality::Item::mId, mItems, sorted(), and filterCSVwithJSON::target.
{ Item target; target.mId = fId; std::vector<Item>::const_iterator cell; if (sorted ()) { cell = std::lower_bound (mItems.begin(), mItems.end(), target); } else { if (fWarning) std::cerr << "HcalDQMChannelQuality::quality-> container is not sorted. Sort it to search effectively" << std::endl; cell = std::find (mItems.begin(), mItems.end(), target); } if (cell == mItems.end() || cell->mId != fId) throw cms::Exception ("Conditions not found") << "Unavailable Quality for cell " << fId; return cell->mAlgo; }
std::vector< unsigned long > HcalDQMChannelQuality::getAllChannels | ( | ) | const |
Definition at line 63 of file HcalDQMChannelQuality.cc.
References mItems, and query::result.
bool HcalDQMChannelQuality::isMasked | ( | unsigned long | fId, |
bool | fWarning = true |
||
) | const |
Definition at line 27 of file HcalDQMChannelQuality.cc.
References ExpressReco_HICollisions_FallBack::cerr, spr::find(), HcalDQMChannelQuality::Item::mId, mItems, sorted(), and filterCSVwithJSON::target.
{ Item target; target.mId = fId; std::vector<Item>::const_iterator cell; if (sorted ()) { cell = std::lower_bound (mItems.begin(), mItems.end(), target); } else { if (fWarning) std::cerr << "HcalDQMChannelQuality::quality-> container is not sorted. Sort it to search effectively" << std::endl; cell = std::find (mItems.begin(), mItems.end(), target); } if (cell == mItems.end() || cell->mId != fId) throw cms::Exception ("Conditions not found") << "Unavailable Quality for cell " << fId; return cell->mMasked; }
bool HcalDQMChannelQuality::maskCell | ( | Quality | fQual | ) | const |
Definition at line 81 of file HcalDQMChannelQuality.cc.
References BAD, COOL, DEAD, END, GOOD, and HOT.
Referenced by setChannel().
HcalDQMChannelQuality::Quality HcalDQMChannelQuality::quality | ( | unsigned long | fId, |
bool | fWarning = true |
||
) | const |
Definition at line 11 of file HcalDQMChannelQuality.cc.
References ExpressReco_HICollisions_FallBack::cerr, spr::find(), HcalDQMChannelQuality::Item::mId, mItems, sorted(), and filterCSVwithJSON::target.
{ Item target; target.mId = fId; std::vector<Item>::const_iterator cell; if (sorted ()) { cell = std::lower_bound (mItems.begin(), mItems.end(), target); } else { if (fWarning) std::cerr << "HcalDQMChannelQuality::quality-> container is not sorted. Sort it to search effectively" << std::endl; cell = std::find (mItems.begin(), mItems.end(), target); } if (cell == mItems.end() || cell->mId != fId) throw cms::Exception ("Conditions not found") << "Unavailable Quality for cell " << fId; return (HcalDQMChannelQuality::Quality) cell->mQuality; }
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.
void HcalDQMChannelQuality::sort | ( | ) |
bool HcalDQMChannelQuality::sorted | ( | ) | const [inline] |
Definition at line 31 of file HcalDQMChannelQuality.h.
References mSorted.
Referenced by flagAlgo(), isMasked(), and quality().
{return mSorted;}
const char * HcalDQMChannelQuality::str | ( | Quality | fQuality | ) | [static] |
Definition at line 100 of file HcalDQMChannelQuality.cc.
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().