#include <CalibFormats/CastorDbProducer/interface/CastorDbProducer.h>
Public Member Functions | |
CastorDbProducer (const edm::ParameterSet &) | |
void | channelQualityCallback (const CastorChannelQualityRcd &fRecord) |
void | electronicsMapCallback (const CastorElectronicsMapRcd &fRecord) |
void | gainsCallback (const CastorGainsRcd &fRecord) |
void | gainWidthsCallback (const CastorGainWidthsRcd &fRecord) |
void | pedestalsCallback (const CastorPedestalsRcd &fRecord) |
void | pedestalWidthsCallback (const CastorPedestalWidthsRcd &fRecord) |
boost::shared_ptr < CastorDbService > | produce (const CastorDbRecord &) |
void | QIEDataCallback (const CastorQIEDataRcd &fRecord) |
~CastorDbProducer () | |
Private Attributes | |
std::vector< std::string > | mDumpRequest |
std::ostream * | mDumpStream |
boost::shared_ptr < CastorDbService > | mService |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 20 of file CastorDbProducer.h.
CastorDbProducer::CastorDbProducer | ( | const edm::ParameterSet & | fConfig | ) |
Definition at line 37 of file CastorDbProducer.cc.
References channelQualityCallback(), gather_cfg::cout, edm::eventsetup::dependsOn(), electronicsMapCallback(), gainsCallback(), gainWidthsCallback(), edm::ParameterSet::getUntrackedParameter(), mDumpRequest, mDumpStream, pedestalsCallback(), pedestalWidthsCallback(), QIEDataCallback(), and edm::ESProducer::setWhatProduced().
: ESProducer(), mService (new CastorDbService (fConfig)), mDumpRequest (), mDumpStream(0) { //the following line is needed to tell the framework what // data is being produced setWhatProduced (this, (dependsOn (&CastorDbProducer::pedestalsCallback, &CastorDbProducer::gainsCallback) & &CastorDbProducer::pedestalWidthsCallback & &CastorDbProducer::QIEDataCallback & &CastorDbProducer::gainWidthsCallback & &CastorDbProducer::channelQualityCallback & &CastorDbProducer::electronicsMapCallback ) ); //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()); } }
CastorDbProducer::~CastorDbProducer | ( | ) |
Definition at line 65 of file CastorDbProducer.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 CastorDbProducer::channelQualityCallback | ( | const CastorChannelQualityRcd & | fRecord | ) |
Definition at line 136 of file CastorDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, and edm::ESHandle< T >::product().
Referenced by CastorDbProducer().
{ edm::ESHandle <CastorChannelQuality> item; fRecord.get (item); mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end()) { *mDumpStream << "New HCAL/CASTOR ChannelQuality set" << std::endl; CastorDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void CastorDbProducer::electronicsMapCallback | ( | const CastorElectronicsMapRcd & | fRecord | ) |
Definition at line 146 of file CastorDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, and edm::ESHandle< T >::product().
Referenced by CastorDbProducer().
{ edm::ESHandle <CastorElectronicsMap> item; fRecord.get (item); mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ElectronicsMap")) != mDumpRequest.end()) { *mDumpStream << "New HCAL/CASTOR Electronics Map set" << std::endl; CastorDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void CastorDbProducer::gainsCallback | ( | const CastorGainsRcd & | fRecord | ) |
Definition at line 105 of file CastorDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, and edm::ESHandle< T >::product().
Referenced by CastorDbProducer().
{ edm::ESHandle <CastorGains> item; fRecord.get (item); mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end()) { *mDumpStream << "New HCAL/CASTOR Gains set" << std::endl; CastorDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void CastorDbProducer::gainWidthsCallback | ( | const CastorGainWidthsRcd & | fRecord | ) |
Definition at line 116 of file CastorDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, and edm::ESHandle< T >::product().
Referenced by CastorDbProducer().
{ edm::ESHandle <CastorGainWidths> item; fRecord.get (item); mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end()) { *mDumpStream << "New HCAL/CASTOR GainWidths set" << std::endl; CastorDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void CastorDbProducer::pedestalsCallback | ( | const CastorPedestalsRcd & | fRecord | ) |
Definition at line 84 of file CastorDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, and edm::ESHandle< T >::product().
Referenced by CastorDbProducer().
{ edm::ESHandle <CastorPedestals> item; fRecord.get (item); mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end()) { *mDumpStream << "New HCAL/CASTOR Pedestals set" << std::endl; CastorDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
void CastorDbProducer::pedestalWidthsCallback | ( | const CastorPedestalWidthsRcd & | fRecord | ) |
Definition at line 94 of file CastorDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, and edm::ESHandle< T >::product().
Referenced by CastorDbProducer().
{ edm::ESHandle <CastorPedestalWidths> item; fRecord.get (item); mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end()) { *mDumpStream << "New HCAL/CASTOR Pedestals set" << std::endl; CastorDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
boost::shared_ptr< CastorDbService > CastorDbProducer::produce | ( | const CastorDbRecord & | ) |
void CastorDbProducer::QIEDataCallback | ( | const CastorQIEDataRcd & | fRecord | ) |
Definition at line 126 of file CastorDbProducer.cc.
References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, and edm::ESHandle< T >::product().
Referenced by CastorDbProducer().
{ edm::ESHandle <CastorQIEData> item; fRecord.get (item); mService->setData (item.product ()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end()) { *mDumpStream << "New HCAL/CASTOR QIEData set" << std::endl; CastorDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); } }
std::vector<std::string> CastorDbProducer::mDumpRequest [private] |
Definition at line 39 of file CastorDbProducer.h.
Referenced by CastorDbProducer(), channelQualityCallback(), electronicsMapCallback(), gainsCallback(), gainWidthsCallback(), pedestalsCallback(), pedestalWidthsCallback(), and QIEDataCallback().
std::ostream* CastorDbProducer::mDumpStream [private] |
Definition at line 40 of file CastorDbProducer.h.
Referenced by CastorDbProducer(), channelQualityCallback(), electronicsMapCallback(), gainsCallback(), gainWidthsCallback(), pedestalsCallback(), pedestalWidthsCallback(), QIEDataCallback(), and ~CastorDbProducer().
boost::shared_ptr<CastorDbService> CastorDbProducer::mService [private] |
Definition at line 38 of file CastorDbProducer.h.
Referenced by channelQualityCallback(), electronicsMapCallback(), gainsCallback(), gainWidthsCallback(), pedestalsCallback(), pedestalWidthsCallback(), produce(), and QIEDataCallback().