#include <HcalCondObjectContainer.h>
Public Types | |
typedef std::vector< tHcalCont > | tAllContWithNames |
typedef std::pair< std::string, std::vector< Item > > | tHcalCont |
Public Member Functions | |
bool | addValues (const Item &myItem) |
const bool | exists (DetId fId) const |
std::vector< DetId > | getAllChannels () const |
const tAllContWithNames | getAllContainers () const |
const Item * | getValues (DetId fId, bool throwOnFail=true) const |
HcalCondObjectContainer (const HcalTopology *topo) | |
virtual std::string | myname () const |
virtual | ~HcalCondObjectContainer () |
Private Member Functions | |
void | initContainer (DetId container) |
Private Attributes | |
std::vector< Item > | CALIBcontainer |
std::vector< Item > | CASTORcontainer |
std::vector< Item > | HBcontainer |
std::vector< Item > | HEcontainer |
std::vector< Item > | HFcontainer |
std::vector< Item > | HOcontainer |
std::vector< Item > | HTcontainer |
std::vector< Item > | ZDCcontainer |
Definition at line 33 of file HcalCondObjectContainer.h.
typedef std::vector< tHcalCont > HcalCondObjectContainer< Item >::tAllContWithNames |
Definition at line 57 of file HcalCondObjectContainer.h.
typedef std::pair< std::string, std::vector<Item> > HcalCondObjectContainer< Item >::tHcalCont |
Definition at line 56 of file HcalCondObjectContainer.h.
HcalCondObjectContainer< Item >::HcalCondObjectContainer | ( | const HcalTopology * | topo | ) | [inline] |
Definition at line 36 of file HcalCondObjectContainer.h.
: HcalCondObjectContainerBase(topo) { }
HcalCondObjectContainer< Item >::~HcalCondObjectContainer | ( | ) | [virtual] |
Definition at line 91 of file HcalCondObjectContainer.h.
{ }
bool HcalCondObjectContainer< Item >::addValues | ( | const Item & | myItem | ) |
Definition at line 182 of file HcalCondObjectContainer.h.
References DetId::Calo, Exception, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, getHLTprescales::index, NULL, HcalCastorDetId::SubdetectorId, HcalZDCDetId::SubdetectorId, and summarizeEdmComparisonLogfiles::success.
Referenced by HcalPedestalsCheck::analyze(), HcalGainsCheck::analyze(), cms::HcalConstantsASCIIWriter::analyze(), HcalPedestalsAnalysis::endJob(), HcalDbOnline::getObject(), HcalPedestalAnalysis::HcalPedVal(), main(), and HcalMonitorClient::writeChannelStatus().
{ bool success = false; DetId fId(myItem.rawId()); unsigned int index=indexFor(fId); Item* cell = NULL; if (index<0xFFFFFFFu) { if (fId.det()==DetId::Hcal) { switch (HcalSubdetector(fId.subdetId())) { case(HcalBarrel) : if (!HBcontainer.size() ) initContainer(fId); if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) ); break; case(HcalEndcap) : if (!HEcontainer.size() ) initContainer(fId); if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) ); break; case(HcalForward) : if (!HFcontainer.size() ) initContainer(fId); if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) ); break; case(HcalOuter) : if (!HOcontainer.size() ) initContainer(fId); if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) ); break; case(HcalTriggerTower) : if (!HTcontainer.size() ) initContainer(fId); if (index < HTcontainer.size()) cell = &(HTcontainer.at(index) ); break; case(HcalOther) : if (extractOther(fId)==HcalCalibration) { if (!CALIBcontainer.size() ) initContainer(fId); if (index < CALIBcontainer.size()) cell = &(CALIBcontainer.at(index) ); } break; default: break; } } else if (fId.det()==DetId::Calo) { if (fId.subdetId()==HcalCastorDetId::SubdetectorId) { if (!CASTORcontainer.size() ) initContainer(fId); if (index < CASTORcontainer.size()) cell = &(CASTORcontainer.at(index) ); } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) { if (!ZDCcontainer.size() ) initContainer(fId); if (index < ZDCcontainer.size()) cell = &(ZDCcontainer.at(index) ); } } } if (cell!=0) { (*cell)=myItem; success=true; } if (!success) throw cms::Exception ("Filling of conditions failed") << " no valid filling possible for Conditions of type " << myname() << " for DetId " << textForId(fId); return success; }
const bool HcalCondObjectContainer< Item >::exists | ( | DetId | fId | ) | const |
Definition at line 170 of file HcalCondObjectContainer.h.
Referenced by HcalCondXML::dumpObject(), HcalDbOnline::getObject(), main(), and cms::HitReCalibrator::produce().
{ const Item* cell = getValues(fId,false); if (cell) if (cell->rawId() == fId ) return true; return false; }
std::vector< DetId > HcalCondObjectContainer< Item >::getAllChannels | ( | ) | const |
Definition at line 233 of file HcalCondObjectContainer.h.
References i.
Referenced by HcalQIEDataCheck::analyze(), HcalAutoPedestalValidator::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), HcalGainsCheck::analyze(), HcalDetDiagLEDMonitor::beginRun(), HcalDetDiagPedestalMonitor::beginRun(), HcalDigiMonitor::beginRun(), HcalBeamMonitor::beginRun(), HcalMonitorClient::beginRun(), HcalDeadCellMonitor::beginRun(), HcalDetDiagLaserMonitor::beginRun(), HcalDbService::buildCalibrations(), HcalDbService::buildCalibWidths(), HcalDbXml::dumpObject(), HcalCondXML::dumpObject(), HcalPedestalAnalysis::HcalPedVal(), main(), CaloTowersCreationAlgo::makeHcalDropChMap(), and HcalMonitorClient::writeChannelStatus().
{ std::vector<DetId> channels; Item emptyItem; for (unsigned int i=0; i<HBcontainer.size(); i++) { if (emptyItem.rawId() != HBcontainer.at(i).rawId() ) channels.push_back( DetId(HBcontainer.at(i).rawId()) ); } for (unsigned int i=0; i<HEcontainer.size(); i++) { if (emptyItem.rawId() != HEcontainer.at(i).rawId() ) channels.push_back( DetId(HEcontainer.at(i).rawId()) ); } for (unsigned int i=0; i<HOcontainer.size(); i++) { if (emptyItem.rawId() != HOcontainer.at(i).rawId() ) channels.push_back( DetId(HOcontainer.at(i).rawId()) ); } for (unsigned int i=0; i<HFcontainer.size(); i++) { if (emptyItem.rawId() != HFcontainer.at(i).rawId() ) channels.push_back( DetId(HFcontainer.at(i).rawId()) ); } for (unsigned int i=0; i<HTcontainer.size(); i++) { if (emptyItem.rawId() != HTcontainer.at(i).rawId() ) channels.push_back( DetId(HTcontainer.at(i).rawId()) ); } for (unsigned int i=0; i<ZDCcontainer.size(); i++) { if (emptyItem.rawId() != ZDCcontainer.at(i).rawId() ) channels.push_back( DetId(ZDCcontainer.at(i).rawId()) ); } for (unsigned int i=0; i<CALIBcontainer.size(); i++) { if (emptyItem.rawId() != CALIBcontainer.at(i).rawId() ) channels.push_back( DetId(CALIBcontainer.at(i).rawId()) ); } 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 tAllContWithNames HcalCondObjectContainer< Item >::getAllContainers | ( | ) | const [inline] |
Definition at line 59 of file HcalCondObjectContainer.h.
{ tAllContWithNames allContainers; allContainers.push_back(tHcalCont("HB",HBcontainer)); allContainers.push_back(tHcalCont("HE",HEcontainer)); allContainers.push_back(tHcalCont("HO",HOcontainer)); allContainers.push_back(tHcalCont("HF",HFcontainer)); allContainers.push_back(tHcalCont("HT",HTcontainer)); allContainers.push_back(tHcalCont("ZDC",ZDCcontainer)); allContainers.push_back(tHcalCont("CALIB",CALIBcontainer)); allContainers.push_back(tHcalCont("CASTOR",CASTORcontainer)); return allContainers; }
const Item * HcalCondObjectContainer< Item >::getValues | ( | DetId | fId, |
bool | throwOnFail = true |
||
) | const |
Definition at line 123 of file HcalCondObjectContainer.h.
References DetId::Calo, DetId::det(), Exception, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, getHLTprescales::index, NULL, HcalCastorDetId::SubdetectorId, HcalZDCDetId::SubdetectorId, and DetId::subdetId().
Referenced by HcalAmplifier::addPedestals(), cms::HcalConstantsASCIIWriter::analyze(), HcalDetDiagLEDMonitor::beginRun(), HcalDetDiagPedestalMonitor::beginRun(), HcalDigiMonitor::beginRun(), HcalBeamMonitor::beginRun(), HcalMonitorClient::beginRun(), HcalDeadCellMonitor::beginRun(), HcalDetDiagLaserMonitor::beginRun(), HcalDbXml::dumpObject(), HcalCondXML::dumpObject(), reco::HcalNoiseInfoProducer::filldigis(), reco::HcalNoiseInfoProducer::fillrechits(), HcalDbService::getGain(), HcalDbService::getGainWidth(), HcalDbService::getHcalChannelStatus(), HcalDbService::getHcalL1TriggerObject(), HcalDbService::getHcalLUTCorr(), HcalDbService::getHcalPFCorr(), HcalDbService::getHcalRespCorr(), HcalDbService::getHcalTimeCorr(), HcalDbService::getHcalZSThreshold(), HcalDbService::getPedestal(), HcalDbService::getPedestalWidth(), CaloTowersCreationAlgo::hcalChanStatusForCaloTower(), HcalPedestalAnalysis::HcalPedVal(), HcalRecHitsAnalyzer::hcalSevLvl(), HcalRecHitsValidation::hcalSevLvl(), HcalHF_PETalgorithm::HFSetFlagFromPET(), HcalHFStatusBitFromRecHits::hfSetFlagFromRecHits(), HcalHF_S9S1algorithm::HFSetFlagFromS9S1(), MuonHOAcceptance::initIds(), HcalRecHitsMaker::loadHcalRecHits(), main(), CaloTowersCreationAlgo::makeHcalDropChMap(), EgammaHLTHcalIsolation::passCleaning_(), HcalSimpleReconstructor::process(), ZdcHitReconstructor::produce(), HcalHitReconstructor::produce(), cms::HitReCalibrator::produce(), ZdcSimpleReconstructor::produce(), HcalShapes::shape(), HcalPulseShapes::shape(), HcalPulseShapes::shapeForReco(), HcaluLUTTPGCoder::update(), ObjectValidator::validHit(), and HcalMonitorClient::writeChannelStatus().
{ unsigned int index=indexFor(fId); const Item* cell = NULL; if (index<0xFFFFFFFu) { if (fId.det()==DetId::Hcal) { switch (HcalSubdetector(fId.subdetId())) { case(HcalBarrel) : if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) ); break; case(HcalEndcap) : if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) ); break; case(HcalForward) : if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) ); break; case(HcalOuter) : if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) ); break; case(HcalTriggerTower) : if (index < HTcontainer.size()) cell = &(HTcontainer.at(index) ); break; case(HcalOther) : if (extractOther(fId)==HcalCalibration) if (index < CALIBcontainer.size()) cell = &(CALIBcontainer.at(index) ); break; default: break; } } else if (fId.det()==DetId::Calo) { if (fId.subdetId()==HcalCastorDetId::SubdetectorId) { if (index < CASTORcontainer.size()) cell = &(CASTORcontainer.at(index) ); } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) { if (index < ZDCcontainer.size()) cell = &(ZDCcontainer.at(index) ); } } } // Item emptyItem; // if (cell->rawId() == emptyItem.rawId() ) if ((!cell)) { if (throwOnFail) { throw cms::Exception ("Conditions not found") << "Unavailable Conditions of type " << myname() << " for cell " << textForId(fId); } } else if (cell->rawId() != fId) { if (throwOnFail) { throw cms::Exception ("Conditions mismatch") << "Requested conditions of type " << myname() << " for cell " << textForId(fId) << " got conditions for cell " << textForId(DetId(cell->rawId())); } cell=0; } return cell; }
void HcalCondObjectContainer< Item >::initContainer | ( | DetId | container | ) | [private] |
Definition at line 96 of file HcalCondObjectContainer.h.
References DetId::Calo, DetId::det(), DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, i, HcalCastorDetId::SubdetectorId, HcalZDCDetId::SubdetectorId, and DetId::subdetId().
{ Item emptyItem; if (fId.det()==DetId::Hcal) { switch (HcalSubdetector(fId.subdetId())) { case(HcalBarrel) : for (unsigned int i=0; i<sizeFor(fId); i++) HBcontainer.push_back(emptyItem); break; case(HcalEndcap) : for (unsigned int i=0; i<sizeFor(fId); i++) HEcontainer.push_back(emptyItem); break; case(HcalOuter) : for (unsigned int i=0; i<sizeFor(fId); i++) HOcontainer.push_back(emptyItem); break; case(HcalForward) : for (unsigned int i=0; i<sizeFor(fId); i++) HFcontainer.push_back(emptyItem); break; case(HcalTriggerTower) : for (unsigned int i=0; i<sizeFor(fId); i++) HTcontainer.push_back(emptyItem); break; case(HcalOther) : if (extractOther(fId)==HcalCalibration) for (unsigned int i=0; i<sizeFor(fId); i++) CALIBcontainer.push_back(emptyItem); break; break; default: break; } } else if (fId.det()==DetId::Calo) { if (fId.subdetId()==HcalCastorDetId::SubdetectorId) { for (unsigned int i=0; i<sizeFor(fId); i++) CASTORcontainer.push_back(emptyItem); } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) { for (unsigned int i=0; i<sizeFor(fId); i++) ZDCcontainer.push_back(emptyItem); } } }
virtual std::string HcalCondObjectContainer< Item >::myname | ( | ) | const [inline, virtual] |
Reimplemented in HcalChannelQuality, HcalFlagHFDigiTimeParams, HcalGains, HcalGainWidths, HcalL1TriggerObjects, HcalLongRecoParams, HcalLUTCorrs, HcalLutMetadata, HcalMCParams, HcalPedestals, HcalPFCorrs, HcalQIEData, HcalRecoParams, HcalRespCorrs, HcalTimeCorrs, HcalTimingParams, HcalValidationCorrs, and HcalZSThresholds.
Definition at line 53 of file HcalCondObjectContainer.h.
{return (std::string)"Hcal Undefined";}
std::vector<Item> HcalCondObjectContainer< Item >::CALIBcontainer [private] |
Definition at line 81 of file HcalCondObjectContainer.h.
Referenced by HcalCondObjectContainer< HcalPedestalWidth >::getAllContainers().
std::vector<Item> HcalCondObjectContainer< Item >::CASTORcontainer [private] |
Definition at line 82 of file HcalCondObjectContainer.h.
Referenced by HcalCondObjectContainer< HcalPedestalWidth >::getAllContainers().
std::vector<Item> HcalCondObjectContainer< Item >::HBcontainer [private] |
Definition at line 75 of file HcalCondObjectContainer.h.
Referenced by HcalCondObjectContainer< HcalPedestalWidth >::getAllContainers().
std::vector<Item> HcalCondObjectContainer< Item >::HEcontainer [private] |
Definition at line 76 of file HcalCondObjectContainer.h.
Referenced by HcalCondObjectContainer< HcalPedestalWidth >::getAllContainers().
std::vector<Item> HcalCondObjectContainer< Item >::HFcontainer [private] |
Definition at line 78 of file HcalCondObjectContainer.h.
Referenced by HcalCondObjectContainer< HcalPedestalWidth >::getAllContainers().
std::vector<Item> HcalCondObjectContainer< Item >::HOcontainer [private] |
Definition at line 77 of file HcalCondObjectContainer.h.
Referenced by HcalCondObjectContainer< HcalPedestalWidth >::getAllContainers().
std::vector<Item> HcalCondObjectContainer< Item >::HTcontainer [private] |
Definition at line 79 of file HcalCondObjectContainer.h.
Referenced by HcalCondObjectContainer< HcalPedestalWidth >::getAllContainers().
std::vector<Item> HcalCondObjectContainer< Item >::ZDCcontainer [private] |
Definition at line 80 of file HcalCondObjectContainer.h.
Referenced by HcalCondObjectContainer< HcalPedestalWidth >::getAllContainers().