#include <CastorCondObjectContainer.h>
Public Member Functions | |
bool | addValues (const Item &myItem) |
CastorCondObjectContainer () | |
const bool | exists (DetId fId) const |
std::vector< DetId > | getAllChannels () const |
const Item * | getValues (DetId fId, bool throwOnFail=true) const |
std::string | myname () const |
~CastorCondObjectContainer () | |
Private Member Functions | |
unsigned int | hashed_id (DetId fId) const |
void | initContainer () |
Private Attributes | |
std::vector< Item > | CASTORcontainer |
Definition at line 14 of file CastorCondObjectContainer.h.
CastorCondObjectContainer< Item >::CastorCondObjectContainer | ( | ) |
Definition at line 48 of file CastorCondObjectContainer.h.
{ }
CastorCondObjectContainer< Item >::~CastorCondObjectContainer | ( | ) |
Definition at line 53 of file CastorCondObjectContainer.h.
{ }
bool CastorCondObjectContainer< Item >::addValues | ( | const Item & | myItem | ) |
Definition at line 106 of file CastorCondObjectContainer.h.
References Exception, getHLTprescales::index, and summarizeEdmComparisonLogfiles::success.
Referenced by CastorPedestalAnalysis::CastorPedVal(), CastorDbXml::dumpObject(), HcalPedestalAnalysis::GetPedConst(), and CastorPedestalsAnalysis::~CastorPedestalsAnalysis().
{ unsigned long myRawId = myItem.rawId(); HcalCastorDetId myId(myRawId); unsigned int index = hashed_id(myId); bool success = false; if (CASTORcontainer.empty() ) initContainer(); if (index < CASTORcontainer.size()) { CASTORcontainer.at(index) = myItem; success = true; } if (!success) throw cms::Exception ("Filling of conditions failed") << " no valid filling possible for Conditions of type " << myname() << " for DetId " << myId; return success; }
const bool CastorCondObjectContainer< Item >::exists | ( | DetId | fId | ) | const |
Definition at line 95 of file CastorCondObjectContainer.h.
{ const Item* cell = getValues(fId,false); if (cell) // if (cell->rawId() != emptyItem.rawId() ) if (cell->rawId() == fId ) return true; return false; }
std::vector< DetId > CastorCondObjectContainer< Item >::getAllChannels | ( | ) | const |
Definition at line 130 of file CastorCondObjectContainer.h.
References i.
Referenced by CastorDbService::buildCalibrations(), CastorDbService::buildCalibWidths(), CastorPedestalAnalysis::CastorPedVal(), and CastorDbXml::dumpObject().
{ std::vector<DetId> channels; Item emptyItem; for (unsigned int i=0; i<CASTORcontainer.size(); i++) { if (emptyItem.rawId() != CASTORcontainer.at(i).rawId() ) channels.push_back( DetId(CASTORcontainer.at(i).rawId()) ); } return channels; }
const Item * CastorCondObjectContainer< Item >::getValues | ( | DetId | fId, |
bool | throwOnFail = true |
||
) | const |
Definition at line 70 of file CastorCondObjectContainer.h.
References DetId::Calo, DetId::det(), Exception, getHLTprescales::index, NULL, HcalCastorDetId::SubdetectorId, and DetId::subdetId().
Referenced by CastorPedestalAnalysis::CastorPedVal(), CastorDbXml::dumpObject(), CastorDbService::getCastorChannelStatus(), CastorDbService::getGain(), CastorDbService::getGainWidth(), CastorDbService::getPedestal(), and CastorDbService::getPedestalWidth().
{ const Item* cell = NULL; HcalCastorDetId myId(fId); if (fId.det()==DetId::Calo && fId.subdetId()==HcalCastorDetId::SubdetectorId) { unsigned int index = hashed_id(fId); if (index < CASTORcontainer.size()) cell = &(CASTORcontainer.at(index) ); } if ((!cell) || (cell->rawId() != fId ) ) { if (throwOnFail) { throw cms::Exception ("Conditions not found") << "Unavailable Conditions of type " << myname() << " for cell " << myId; } else { cell=0; } } return cell; }
unsigned int CastorCondObjectContainer< Item >::hashed_id | ( | DetId | fId | ) | const [private] |
Definition at line 145 of file CastorCondObjectContainer.h.
References getHLTprescales::index, HcalCastorDetId::module(), HcalCastorDetId::sector(), and HcalCastorDetId::zside().
{ // the historical packing from HcalGeneric is different from HcalCastorDetId, so we clone the old packing here. HcalCastorDetId tid(fId); int zside = tid.zside(); int sector = tid.sector(); int module = tid.module(); static const int CASTORhalf=224; int index = 14*(sector-1) + (module-1); if (zside == -1) index += CASTORhalf; return index; }
void CastorCondObjectContainer< Item >::initContainer | ( | ) | [private] |
Definition at line 58 of file CastorCondObjectContainer.h.
References i, and HcalCastorDetId::kSizeForDenseIndexing.
{ Item emptyItem; if (CASTORcontainer.empty()) for (int i=0; i<HcalCastorDetId:: kSizeForDenseIndexing; i++) CASTORcontainer.push_back(emptyItem); }
std::string CastorCondObjectContainer< Item >::myname | ( | ) | const [inline] |
Reimplemented in CastorChannelQuality, CastorGains, CastorGainWidths, CastorQIEData, CastorRecoParams, and CastorSaturationCorrs.
Definition at line 36 of file CastorCondObjectContainer.h.
{return (std::string)"Castor Undefined";}
std::vector<Item> CastorCondObjectContainer< Item >::CASTORcontainer [private] |
Definition at line 42 of file CastorCondObjectContainer.h.