#include <HcalDcsValues.h>
Public Types | |
typedef std::vector< HcalDcsValue > | DcsSet |
enum | DcsSubDet { HcalHB = 1, HcalHE = 2, HcalHO0 = 3, HcalHO12 = 4, HcalHF = 5 } |
Public Member Functions | |
bool | addValue (HcalDcsValue const &newVal) |
bool | DcsValuesOK (DcsSubDet subd, int LS=-1) |
bool | exists (HcalDcsDetId const &fid) |
DcsSet const & | getAllSubdetValues (DcsSubDet subd) const |
DcsSet | getValues (HcalDcsDetId const &fid) |
HcalDcsValues () | |
std::string | myname () const |
void | sortAll () |
virtual | ~HcalDcsValues () |
Protected Member Functions | |
bool | foundDcsId (DcsSet const &valList, HcalDcsDetId const &fid) const |
bool | sortList (DcsSet &valList) const |
bool | subDetOk (DcsSet const &valList, int LS) const |
Private Attributes | |
bool | mHBsorted |
DcsSet | mHBValues |
bool | mHEsorted |
DcsSet | mHEValues |
bool | mHFsorted |
DcsSet | mHFValues |
bool | mHO0sorted |
DcsSet | mHO0Values |
bool | mHO12sorted |
DcsSet | mHO12Values |
Definition at line 23 of file HcalDcsValues.h.
typedef std::vector<HcalDcsValue> HcalDcsValues::DcsSet |
Definition at line 25 of file HcalDcsValues.h.
HcalDcsValues::HcalDcsValues | ( | ) |
Definition at line 5 of file HcalDcsValues.cc.
: mHBsorted(false),mHEsorted(false),mHO0sorted(false), mHO12sorted(false), mHFsorted(false) { }
HcalDcsValues::~HcalDcsValues | ( | ) | [virtual] |
Definition at line 10 of file HcalDcsValues.cc.
{ }
bool HcalDcsValues::addValue | ( | HcalDcsValue const & | newVal | ) |
Definition at line 13 of file HcalDcsValues.cc.
References HcalDcsValue::DcsId(), HcalDcsBarrel, HcalDcsEndcap, HcalDcsForward, HcalDcsOuter, mHBsorted, mHBValues, mHEsorted, mHEValues, mHFsorted, mHFValues, mHO0sorted, mHO0Values, mHO12sorted, and mHO12Values.
{ HcalDcsDetId tempId( newVal.DcsId() ); switch (tempId.subdet()) { case HcalDcsBarrel : mHBValues.push_back(newVal); mHBsorted=false; return true; case HcalDcsEndcap : mHEValues.push_back(newVal); mHEsorted=false; return true; case HcalDcsOuter : if (tempId.ring() == 0) { mHO0Values.push_back(newVal); mHO0sorted=false; } else { mHO12Values.push_back(newVal); mHO12sorted=false; } return true; case HcalDcsForward : mHFValues.push_back(newVal); mHFsorted=false; return true; default : return false; } }
bool HcalDcsValues::DcsValuesOK | ( | DcsSubDet | subd, |
int | LS = -1 |
||
) |
Definition at line 166 of file HcalDcsValues.cc.
References HcalHB, HcalHE, HcalHF, HcalHO0, HcalHO12, mHBsorted, mHBValues, mHEsorted, mHEValues, mHFsorted, mHFValues, mHO0sorted, mHO0Values, mHO12sorted, mHO12Values, sortList(), and subDetOk().
{ switch (subd) { case HcalHB : if (!mHBsorted) mHBsorted = sortList(mHBValues); return subDetOk(mHBValues, LS); case HcalHE : if (!mHEsorted) mHEsorted = sortList(mHEValues); return subDetOk(mHEValues, LS); case HcalHO0 : if (!mHO0sorted) mHO0sorted = sortList(mHO0Values); return subDetOk(mHO0Values, LS); case HcalHO12 : if (!mHO12sorted) mHO12sorted = sortList(mHO12Values); return subDetOk(mHO12Values, LS); case HcalHF : if (!mHFsorted) mHFsorted = sortList(mHFValues); return subDetOk(mHFValues, LS); default : return false; } return false; }
bool HcalDcsValues::exists | ( | HcalDcsDetId const & | fid | ) |
Definition at line 50 of file HcalDcsValues.cc.
References foundDcsId(), HcalDcsBarrel, HcalDcsEndcap, HcalDcsForward, HcalDcsOuter, mHBsorted, mHBValues, mHEsorted, mHEValues, mHFsorted, mHFValues, mHO0sorted, mHO0Values, mHO12sorted, mHO12Values, HcalDcsDetId::ring(), sortList(), and HcalOtherDetId::subdet().
{ switch (fid.subdet()) { case HcalDcsBarrel : if (!mHBsorted) mHBsorted = sortList(mHBValues); return foundDcsId(mHBValues, fid); case HcalDcsEndcap : if (!mHEsorted) mHEsorted = sortList(mHEValues); return foundDcsId(mHEValues, fid); case HcalDcsOuter : if (fid.ring() == 0) { if (!mHO0sorted) mHO0sorted = sortList(mHO0Values); return foundDcsId(mHO0Values, fid); } else { if (!mHO12sorted) mHO12sorted = sortList(mHO12Values); return foundDcsId(mHO12Values, fid); } case HcalDcsForward : if (!mHFsorted) mHFsorted = sortList(mHFValues); return foundDcsId(mHBValues, fid); default : return false; } }
bool HcalDcsValues::foundDcsId | ( | DcsSet const & | valList, |
HcalDcsDetId const & | fid | ||
) | const [protected] |
Definition at line 188 of file HcalDcsValues.cc.
References DetId::rawId().
Referenced by exists().
{ HcalDcsValue dummy(fid.rawId(), -1, 0., 0., 0.); DcsSet::const_iterator lb = lower_bound(valList.begin(), valList.end(), dummy); if ((lb != valList.end()) && (lb->DcsId() == fid.rawId())) return true; return false; }
HcalDcsValues::DcsSet const & HcalDcsValues::getAllSubdetValues | ( | DcsSubDet | subd | ) | const |
Definition at line 155 of file HcalDcsValues.cc.
References HcalHB, HcalHE, HcalHF, HcalHO0, HcalHO12, mHBValues, mHEValues, mHFValues, mHO0Values, and mHO12Values.
HcalDcsValues::DcsSet HcalDcsValues::getValues | ( | HcalDcsDetId const & | fid | ) |
Definition at line 73 of file HcalDcsValues.cc.
References HcalDcsBarrel, HcalDcsEndcap, HcalDcsForward, HcalDcsOuter, mHBsorted, mHBValues, mHEsorted, mHEValues, mHFsorted, mHFValues, mHO0sorted, mHO0Values, mHO12sorted, mHO12Values, DetId::rawId(), HcalDcsDetId::ring(), sortList(), and HcalOtherDetId::subdet().
{ DcsSet * valList = 0; switch(fid.subdet()) { case HcalDcsBarrel : valList = &mHBValues; if (!mHBsorted) mHBsorted = sortList(mHBValues); break; case HcalDcsEndcap : valList = &mHEValues; if (!mHEsorted) mHEsorted = sortList(mHEValues); break; case HcalDcsOuter : if (fid.ring() == 0) { valList = &mHO0Values; if (!mHO0sorted) mHO0sorted = sortList(mHO0Values); } else { valList = &mHO12Values; if (!mHO12sorted) mHO12sorted = sortList(mHO12Values); } break; case HcalDcsForward : valList = &mHFValues; if (!mHFsorted) mHFsorted = sortList(mHFValues); break; default : valList = 0; } if (valList) { HcalDcsValue dummy(fid.rawId(), -1, 0., 0., 0.); DcsSet::const_iterator lb = lower_bound(valList->begin(), valList->end(), dummy); if ((lb != valList->end()) && (lb->DcsId() == fid.rawId())) { DcsSet::const_iterator ub = upper_bound(valList->begin(), valList->end(), dummy); return DcsSet(lb, ub) ; } } return DcsSet() ; }
std::string HcalDcsValues::myname | ( | ) | const [inline] |
Definition at line 45 of file HcalDcsValues.h.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ return (std::string)"HcalDcsValues"; }
void HcalDcsValues::sortAll | ( | ) |
Definition at line 42 of file HcalDcsValues.cc.
References mHBsorted, mHBValues, mHEsorted, mHEValues, mHFsorted, mHFValues, mHO0sorted, mHO0Values, mHO12sorted, mHO12Values, and sortList().
{ mHBsorted = sortList(mHBValues); mHEsorted = sortList(mHEValues); mHO0sorted = sortList(mHO0Values); mHO12sorted = sortList(mHO12Values); mHFsorted = sortList(mHFValues); }
bool HcalDcsValues::sortList | ( | DcsSet & | valList | ) | const [protected] |
Definition at line 213 of file HcalDcsValues.cc.
References python::multivaluedict::sort().
Referenced by DcsValuesOK(), exists(), getValues(), and sortAll().
{ sort(valList.begin(), valList.end()); return true; }
bool HcalDcsValues::subDetOk | ( | DcsSet const & | valList, |
int | LS | ||
) | const [protected] |
Definition at line 197 of file HcalDcsValues.cc.
Referenced by DcsValuesOK().
{ std::set<uint32_t> badIds; DcsSet::const_iterator val = valList.begin(); while ( (val != valList.end()) && ( (LS>-1) ? (val->LS()<=LS) : true) ) { if (!val->isValueGood()) { badIds.insert(val->DcsId()); } else { std::set<uint32_t>::iterator fnd = badIds.find(val->DcsId()); if (*fnd == val->DcsId()) badIds.erase(fnd); } ++val; } return (badIds.size()==0); }
bool HcalDcsValues::mHBsorted [mutable, private] |
Definition at line 59 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().
DcsSet HcalDcsValues::mHBValues [private] |
Definition at line 58 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().
bool HcalDcsValues::mHEsorted [mutable, private] |
Definition at line 61 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().
DcsSet HcalDcsValues::mHEValues [private] |
Definition at line 60 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().
bool HcalDcsValues::mHFsorted [mutable, private] |
Definition at line 67 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().
DcsSet HcalDcsValues::mHFValues [private] |
Definition at line 66 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().
bool HcalDcsValues::mHO0sorted [mutable, private] |
Definition at line 63 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().
DcsSet HcalDcsValues::mHO0Values [private] |
Definition at line 62 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().
bool HcalDcsValues::mHO12sorted [mutable, private] |
Definition at line 65 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().
DcsSet HcalDcsValues::mHO12Values [private] |
Definition at line 64 of file HcalDcsValues.h.
Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().