#include <CondFormats/CastorObjects/interface/CastorPedestalWidths.h>
Public Types | |
typedef CastorPedestalWidth | Item |
Public Member Functions | |
CastorPedestalWidths () | |
std::vector< DetId > | getAllChannels () const |
get list of all available channels | |
float | getSigma (DetId fId, int fCapId1, int fCapId2) const |
get correlation for given capId1/2 = 0..3 | |
const CastorPedestalWidth * | getValues (DetId fId) const |
get all values | |
float | getWidth (DetId fId, int fCapId) const |
get value for given capId = 0..3 | |
void | setWidth (const CastorPedestalWidth &fItem) |
add new (empty) item | |
CastorPedestalWidth * | setWidth (DetId fId) |
add new (empty) item | |
void | sort () |
sort values by channelId | |
bool | sorted () const |
check if data are sorted | |
~CastorPedestalWidths () | |
Private Attributes | |
std::vector< CastorPedestalWidth > | mItems |
bool | mSorted |
Definition at line 19 of file CastorPedestalWidths.h.
Definition at line 40 of file CastorPedestalWidths.h.
CastorPedestalWidths::CastorPedestalWidths | ( | ) |
CastorPedestalWidths::~CastorPedestalWidths | ( | ) |
std::vector< DetId > CastorPedestalWidths::getAllChannels | ( | ) | const |
get list of all available channels
Definition at line 87 of file CastorPedestalWidths.cc.
References mItems, and HLT_VtxMuL3::result.
00087 { 00088 std::vector<DetId> result; 00089 for (std::vector<Item>::const_iterator item = mItems.begin (); item != mItems.end (); item++) { 00090 result.push_back (DetId (item->rawId ())); 00091 } 00092 return result; 00093 }
get correlation for given capId1/2 = 0..3
Definition at line 63 of file CastorPedestalWidths.cc.
References TestMuL1L2Filter_cff::cerr, lat::endl(), CastorPedestalWidth::getSigma(), getValues(), and values.
Referenced by CastorPedestalAnalysis::CastorPedVal().
00063 { 00064 const CastorPedestalWidth* values; 00065 if (fCapId1 >= 0 && fCapId1 < 4 && fCapId2 >= 0 && fCapId2 < 4) { 00066 values = getValues (fId); 00067 if (values) return values->getSigma (fCapId1, fCapId2); 00068 } 00069 else { 00070 std::cerr << "CastorPedestalWidths::getSigma-> capId " << fCapId1 << " or " << fCapId2 << " is out of range [0..3]" << std::endl; 00071 } 00072 return -1; 00073 }
const CastorPedestalWidth * CastorPedestalWidths::getValues | ( | DetId | fId | ) | const |
get all values
Definition at line 36 of file CastorPedestalWidths.cc.
References TestMuL1L2Filter_cff::cerr, lat::endl(), find(), mItems, DetId::rawId(), sorted(), and target.
Referenced by CastorDbService::getPedestalWidth(), getSigma(), and getWidth().
00036 { 00037 CastorPedestalWidth target (fId.rawId ()); 00038 std::vector<Item>::const_iterator cell; 00039 if (sorted ()) { 00040 cell = std::lower_bound (mItems.begin(), mItems.end(), target, compareItems ()); 00041 } 00042 else { 00043 std::cerr << "CastorPedestalWidths::getValues-> container is not sorted. Please sort it to search effectively" << std::endl; 00044 cell = find (mItems, fId.rawId ()); 00045 } 00046 if (cell == mItems.end() || cell->rawId () != target.rawId ()) 00047 throw cms::Exception ("Conditions not found") << "Unavailable PedestalWidth for cell " << HcalGenericDetId(fId); 00048 return &(*cell); 00049 }
get value for given capId = 0..3
Definition at line 51 of file CastorPedestalWidths.cc.
References TestMuL1L2Filter_cff::cerr, lat::endl(), getValues(), CastorPedestalWidth::getWidth(), and values.
00051 { 00052 const CastorPedestalWidth* values; 00053 if (fCapId >= 0 && fCapId < 4) { 00054 values = getValues (fId); 00055 if (values) return values->getWidth (fCapId); 00056 } 00057 else { 00058 std::cerr << "CastorPedestalWidths::getWidth-> capId " << fCapId << " is out of range [0..3]" << std::endl; 00059 } 00060 return -1; 00061 }
void CastorPedestalWidths::setWidth | ( | const CastorPedestalWidth & | fItem | ) |
CastorPedestalWidth * CastorPedestalWidths::setWidth | ( | DetId | fId | ) |
add new (empty) item
Definition at line 75 of file CastorPedestalWidths.cc.
References mItems, mSorted, and DetId::rawId().
Referenced by CastorPedestalAnalysis::CastorPedVal().
00075 { 00076 CastorPedestalWidth item (fId.rawId ()); 00077 mItems.push_back (item); 00078 mSorted = false; 00079 return &(mItems.back ()); 00080 }
void CastorPedestalWidths::sort | ( | ) |
sort values by channelId
Definition at line 96 of file CastorPedestalWidths.cc.
References mItems, mSorted, and python::multivaluedict::sort().
Referenced by CastorPedestalAnalysis::done().
00096 { 00097 if (!mSorted) { 00098 std::sort (mItems.begin(), mItems.end(), compareItems ()); 00099 mSorted = true; 00100 } 00101 }
bool CastorPedestalWidths::sorted | ( | ) | const [inline] |
check if data are sorted
Definition at line 33 of file CastorPedestalWidths.h.
References mSorted.
Referenced by getValues().
00033 {return mSorted;}
std::vector<CastorPedestalWidth> CastorPedestalWidths::mItems [private] |
Definition at line 42 of file CastorPedestalWidths.h.
Referenced by getAllChannels(), getValues(), setWidth(), and sort().
bool CastorPedestalWidths::mSorted [private] |
Definition at line 43 of file CastorPedestalWidths.h.
Referenced by setWidth(), sort(), and sorted().