![]() |
![]() |
#include <CondFormats/HcalObjects/interface/HcalRawGains.h>
Public Types | |
typedef std::vector< Item > | Container |
typedef HcalRawGain | Item |
Public Member Functions | |
HcalRawGain * | addItem (DetId fId) |
add new (empty) item | |
void | addValues (DetId fId, const HcalRawGain &fValues) |
fill values | |
std::vector< DetId > | getAllChannels () const |
get list of all available channels | |
const HcalRawGain * | getValues (DetId fId) const |
get value | |
HcalRawGains () | |
void | sort () |
sort values by channelId | |
bool | sorted () const |
check if data are sorted | |
~HcalRawGains () | |
Private Attributes | |
Container | mItems |
bool | mSorted |
Definition at line 20 of file HcalRawGains.h.
typedef std::vector<Item> HcalRawGains::Container |
Definition at line 38 of file HcalRawGains.h.
typedef HcalRawGain HcalRawGains::Item |
Definition at line 37 of file HcalRawGains.h.
HcalRawGains::HcalRawGains | ( | ) |
HcalRawGains::~HcalRawGains | ( | ) |
HcalRawGain * HcalRawGains::addItem | ( | DetId | fId | ) |
add new (empty) item
Definition at line 63 of file HcalRawGains.cc.
References mItems, mSorted, and DetId::rawId().
00063 { 00064 HcalRawGain item (fId.rawId ()); 00065 mItems.push_back (item); 00066 mSorted = false; 00067 return &(mItems.back ()); 00068 }
void HcalRawGains::addValues | ( | DetId | fId, | |
const HcalRawGain & | fValues | |||
) |
fill values
Definition at line 70 of file HcalRawGains.cc.
References HcalRawGain::getError(), HcalRawGain::getStatus(), HcalRawGain::getValue(), HcalRawGain::getVoltage(), mItems, mSorted, and DetId::rawId().
00070 { 00071 Item item (fId.rawId (), fValues.getValue(), fValues.getError(), fValues.getVoltage(), fValues.getStatus()); 00072 mItems.push_back (item); 00073 mSorted = false; 00074 }
std::vector< DetId > HcalRawGains::getAllChannels | ( | ) | const |
get list of all available channels
Definition at line 54 of file HcalRawGains.cc.
References mItems, and HLT_VtxMuL3::result.
00054 { 00055 std::vector<DetId> result; 00056 for (std::vector<Item>::const_iterator item = mItems.begin (); item != mItems.end (); item++) { 00057 result.push_back (DetId (item->rawId ())); 00058 } 00059 return result; 00060 }
const HcalRawGain * HcalRawGains::getValues | ( | DetId | fId | ) | const |
get value
Definition at line 39 of file HcalRawGains.cc.
References HcalRawGain::BAD, TestMuL1L2Filter_cff::cerr, lat::endl(), find(), mItems, DetId::rawId(), sorted(), and target.
00039 { 00040 Item target (fId.rawId (), 0, 0, 0, HcalRawGain::BAD); 00041 std::vector<Item>::const_iterator cell; 00042 if (sorted ()) { 00043 cell = std::lower_bound (mItems.begin(), mItems.end(), target, compareItems ()); 00044 } 00045 else { 00046 std::cerr << "HcalRawGains::getValues-> container is not sorted. Please sort it to search effectively" << std::endl; 00047 cell = find (mItems, fId.rawId ()); 00048 } 00049 if (cell == mItems.end() || cell->rawId () != target.rawId ()) 00050 throw cms::Exception ("Conditions not found") << "Unavailable Raw Gains for cell " << HcalGenericDetId(target.rawId()); 00051 return &(*cell); 00052 }
void HcalRawGains::sort | ( | ) |
sort values by channelId
Definition at line 77 of file HcalRawGains.cc.
References mItems, mSorted, and python::multivaluedict::sort().
00077 { 00078 if (!mSorted) { 00079 std::sort (mItems.begin(), mItems.end(), compareItems ()); 00080 mSorted = true; 00081 } 00082 }
bool HcalRawGains::sorted | ( | ) | const [inline] |
check if data are sorted
Definition at line 29 of file HcalRawGains.h.
References mSorted.
Referenced by getValues().
00029 {return mSorted;}
Container HcalRawGains::mItems [private] |
Definition at line 40 of file HcalRawGains.h.
Referenced by addItem(), addValues(), getAllChannels(), getValues(), and sort().
bool HcalRawGains::mSorted [private] |
Definition at line 41 of file HcalRawGains.h.
Referenced by addItem(), addValues(), sort(), and sorted().