#include <CastorRawGains.h>
Public Types | |
typedef std::vector< Item > | Container |
typedef CastorRawGain | Item |
Public Member Functions | |
CastorRawGain * | addItem (DetId fId) |
add new (empty) item | |
void | addValues (DetId fId, const CastorRawGain &fValues) |
fill values | |
CastorRawGains () | |
std::vector< DetId > | getAllChannels () const |
get list of all available channels | |
const CastorRawGain * | getValues (DetId fId) const |
get value | |
void | sort () |
sort values by channelId | |
bool | sorted () const |
check if data are sorted | |
~CastorRawGains () | |
Private Attributes | |
Container | mItems |
bool | mSorted |
Definition at line 17 of file CastorRawGains.h.
typedef std::vector<Item> CastorRawGains::Container |
Definition at line 35 of file CastorRawGains.h.
typedef CastorRawGain CastorRawGains::Item |
Definition at line 34 of file CastorRawGains.h.
CastorRawGains::CastorRawGains | ( | ) |
Definition at line 31 of file CastorRawGains.cc.
: mSorted (false) {}
CastorRawGains::~CastorRawGains | ( | ) |
Definition at line 34 of file CastorRawGains.cc.
{}
CastorRawGain * CastorRawGains::addItem | ( | DetId | fId | ) |
add new (empty) item
Definition at line 60 of file CastorRawGains.cc.
References mItems, mSorted, and DetId::rawId().
{ CastorRawGain item (fId.rawId ()); mItems.push_back (item); mSorted = false; return &(mItems.back ()); }
void CastorRawGains::addValues | ( | DetId | fId, |
const CastorRawGain & | fValues | ||
) |
fill values
Definition at line 67 of file CastorRawGains.cc.
References CastorRawGain::getError(), CastorRawGain::getStatus(), CastorRawGain::getValue(), CastorRawGain::getVoltage(), mItems, mSorted, and DetId::rawId().
std::vector< DetId > CastorRawGains::getAllChannels | ( | ) | const |
get list of all available channels
Definition at line 51 of file CastorRawGains.cc.
References mItems, and query::result.
const CastorRawGain * CastorRawGains::getValues | ( | DetId | fId | ) | const |
get value
Definition at line 36 of file CastorRawGains.cc.
References pat::BAD, benchmark_cfg::cerr, spr::find(), mItems, DetId::rawId(), sorted(), and filterCSVwithJSON::target.
{ Item target (fId.rawId (), 0, 0, 0, CastorRawGain::BAD); std::vector<Item>::const_iterator cell; if (sorted ()) { cell = std::lower_bound (mItems.begin(), mItems.end(), target, compareItems ()); } else { std::cerr << "CastorRawGains::getValues-> container is not sorted. Please sort it to search effectively" << std::endl; cell = find (mItems, fId.rawId ()); } if (cell == mItems.end() || cell->rawId () != target.rawId ()) throw cms::Exception ("Conditions not found") << "Unavailable Raw Gains for cell " << HcalGenericDetId(target.rawId()); return &(*cell); }
void CastorRawGains::sort | ( | ) |
bool CastorRawGains::sorted | ( | ) | const [inline] |
check if data are sorted
Definition at line 26 of file CastorRawGains.h.
References mSorted.
Referenced by getValues().
{return mSorted;}
Container CastorRawGains::mItems [private] |
Definition at line 37 of file CastorRawGains.h.
Referenced by addItem(), addValues(), getAllChannels(), getValues(), and sort().
bool CastorRawGains::mSorted [private] |
Definition at line 38 of file CastorRawGains.h.
Referenced by addItem(), addValues(), sort(), and sorted().