#include <CalibFormats/HcalDbProducer/interface/HcalDbProducer.h>
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 35 of file HcalDbProducer.h.
HcalDbProducer::HcalDbProducer | ( | const edm::ParameterSet & | fConfig | ) |
Definition at line 36 of file HcalDbProducer.cc.
References channelQualityCallback(), gather_cfg::cout, edm::eventsetup::dependsOn(), electronicsMapCallback(), gainsCallback(), gainWidthsCallback(), edm::ParameterSet::getUntrackedParameter(), L1triggerObjectsCallback(), LUTCorrsCallback(), lutMetadataCallback(), mDumpRequest, mDumpStream, pedestalsCallback(), pedestalWidthsCallback(), PFCorrsCallback(), QIEDataCallback(), respCorrsCallback(), edm::ESProducer::setWhatProduced(), AlCaHLTBitMon_QueryRunRegistry::string, timeCorrsCallback(), and zsThresholdsCallback().
: ESProducer(), mService (new HcalDbService (fConfig)), mDumpRequest (), mDumpStream(0) { //the following line is needed to tell the framework what data is being produced // comments of dependsOn: // 1) There are two ways one can use 'dependsOn' the first is passing it up to three arguments. // However, one can also extend the dependencies by first calling 'dependsOn() and then using '&' to add additional dependencies. So // dependsOn(&FooProd::func1, &FooProd::func2, &FooProd::func3) // gives the same result as // dependsOn(&FooProd::func1) & (&FooProd::func2) & (&FooProd::func3) // 2) Upon IOV change, all callbacks are called, in the inverse order of their specification below (tested). setWhatProduced (this, (dependsOn (&HcalDbProducer::pedestalsCallback) & &HcalDbProducer::pedestalWidthsCallback & &HcalDbProducer::respCorrsCallback & &HcalDbProducer::gainsCallback & &HcalDbProducer::LUTCorrsCallback & &HcalDbProducer::PFCorrsCallback & &HcalDbProducer::timeCorrsCallback & &HcalDbProducer::QIEDataCallback & &HcalDbProducer::gainWidthsCallback & &HcalDbProducer::channelQualityCallback & &HcalDbProducer::zsThresholdsCallback & &HcalDbProducer::L1triggerObjectsCallback & &HcalDbProducer::electronicsMapCallback & &HcalDbProducer::lutMetadataCallback ) ); //now do what ever other initialization is needed mDumpRequest = fConfig.getUntrackedParameter <std::vector <std::string> > ("dump", std::vector<std::string>()); if (!mDumpRequest.empty()) { std::string otputFile = fConfig.getUntrackedParameter <std::string> ("file", ""); mDumpStream = otputFile.empty () ? &std::cout : new std::ofstream (otputFile.c_str()); } }
HcalDbProducer::~HcalDbProducer | ( | ) |
Definition at line 77 of file HcalDbProducer.cc.
References gather_cfg::cout, and mDumpStream.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) if (mDumpStream != &std::cout) delete mDumpStream; }
void HcalDbProducer::channelQualityCallback | ( | const HcalChannelQualityRcd & | fRecord | ) |
Definition at line 188 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalChannelQuality> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end()) { *mDumpStream << "New HCAL ChannelQuality set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::electronicsMapCallback | ( | const HcalElectronicsMapRcd & | fRecord | ) |
Definition at line 314 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalElectronicsMap> item; fRecord.get (item); mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ElectronicsMap")) != mDumpRequest.end()) { *mDumpStream << "New HCAL Electronics Map set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::gainsCallback | ( | const HcalGainsRcd & | fRecord | ) |
Definition at line 133 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalGains> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end()) { *mDumpStream << "New HCAL Gains set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::gainWidthsCallback | ( | const HcalGainWidthsRcd & | fRecord | ) |
Definition at line 152 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalGainWidths> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end()) { *mDumpStream << "New HCAL GainWidths set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::L1triggerObjectsCallback | ( | const HcalL1TriggerObjectsRcd & | fRecord | ) |
Definition at line 296 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalL1TriggerObjects> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("L1TriggerObjects")) != mDumpRequest.end()) { *mDumpStream << "New HCAL L1TriggerObjects set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::LUTCorrsCallback | ( | const HcalLUTCorrsRcd & | fRecord | ) |
Definition at line 224 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalLUTCorrs> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LUTCorrs")) != mDumpRequest.end()) { *mDumpStream << "New HCAL LUTCorrs set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::lutMetadataCallback | ( | const HcalLutMetadataRcd & | fRecord | ) |
Definition at line 324 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalLutMetadata> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LutMetadata")) != mDumpRequest.end()) { *mDumpStream << "New HCAL LUT Metadata set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::pedestalsCallback | ( | const HcalPedestalsRcd & | fRecord | ) |
Definition at line 96 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalPedestals> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end()) { *mDumpStream << "New HCAL Pedestals set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::pedestalWidthsCallback | ( | const HcalPedestalWidthsRcd & | fRecord | ) |
Definition at line 114 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalPedestalWidths> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end()) { *mDumpStream << "New HCAL PedestalWidths set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::PFCorrsCallback | ( | const HcalPFCorrsRcd & | fRecord | ) |
Definition at line 242 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalPFCorrs> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PFCorrs")) != mDumpRequest.end()) { *mDumpStream << "New HCAL PFCorrs set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
boost::shared_ptr< HcalDbService > HcalDbProducer::produce | ( | const HcalDbRecord & | ) |
void HcalDbProducer::QIEDataCallback | ( | const HcalQIEDataRcd & | fRecord | ) |
Definition at line 170 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalQIEData> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end()) { *mDumpStream << "New HCAL QIEData set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::respCorrsCallback | ( | const HcalRespCorrsRcd & | fRecord | ) |
Definition at line 206 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalRespCorrs> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RespCorrs")) != mDumpRequest.end()) { *mDumpStream << "New HCAL RespCorrs set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::timeCorrsCallback | ( | const HcalTimeCorrsRcd & | fRecord | ) |
Definition at line 260 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalTimeCorrs> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TimeCorrs")) != mDumpRequest.end()) { *mDumpStream << "New HCAL TimeCorrs set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void HcalDbProducer::zsThresholdsCallback | ( | const HcalZSThresholdsRcd & | fRecord | ) |
Definition at line 278 of file HcalDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by HcalDbProducer().
{ edm::ESHandle <HcalZSThresholds> item; fRecord.get (item); if (item->topo()==0) { edm::ESHandle<HcalTopology> htopo; fRecord.getRecord<IdealGeometryRecord>().get(htopo); const HcalTopology* topo=&(*htopo); item->setTopo(topo); } mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ZSThresholds")) != mDumpRequest.end()) { *mDumpStream << "New HCAL ZSThresholds set" << std::endl; HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
std::vector<std::string> HcalDbProducer::mDumpRequest [private] |
Definition at line 61 of file HcalDbProducer.h.
Referenced by channelQualityCallback(), electronicsMapCallback(), gainsCallback(), gainWidthsCallback(), HcalDbProducer(), L1triggerObjectsCallback(), LUTCorrsCallback(), lutMetadataCallback(), pedestalsCallback(), pedestalWidthsCallback(), PFCorrsCallback(), QIEDataCallback(), respCorrsCallback(), timeCorrsCallback(), and zsThresholdsCallback().
std::ostream* HcalDbProducer::mDumpStream [private] |
Definition at line 62 of file HcalDbProducer.h.
Referenced by channelQualityCallback(), electronicsMapCallback(), gainsCallback(), gainWidthsCallback(), HcalDbProducer(), L1triggerObjectsCallback(), LUTCorrsCallback(), lutMetadataCallback(), pedestalsCallback(), pedestalWidthsCallback(), PFCorrsCallback(), QIEDataCallback(), respCorrsCallback(), timeCorrsCallback(), zsThresholdsCallback(), and ~HcalDbProducer().
boost::shared_ptr<HcalDbService> HcalDbProducer::mService [private] |
Definition at line 60 of file HcalDbProducer.h.
Referenced by channelQualityCallback(), electronicsMapCallback(), gainsCallback(), gainWidthsCallback(), L1triggerObjectsCallback(), LUTCorrsCallback(), lutMetadataCallback(), pedestalsCallback(), pedestalWidthsCallback(), PFCorrsCallback(), produce(), QIEDataCallback(), respCorrsCallback(), timeCorrsCallback(), and zsThresholdsCallback().