CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CastorDbProducer Class Reference

#include <CalibFormats/CastorDbProducer/interface/CastorDbProducer.h>

Inheritance diagram for CastorDbProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

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)
 
std::shared_ptr< CastorDbServiceproduce (const CastorDbRecord &)
 
void QIEDataCallback (const CastorQIEDataRcd &fRecord)
 
 ~CastorDbProducer () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

std::vector< std::string > mDumpRequest
 
std::ostream * mDumpStream
 
std::shared_ptr< CastorDbServicemService
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 19 of file CastorDbProducer.h.

Constructor & Destructor Documentation

CastorDbProducer::CastorDbProducer ( const edm::ParameterSet fConfig)

Definition at line 36 of file CastorDbProducer.cc.

References channelQualityCallback(), gather_cfg::cout, edm::eventsetup::dependsOn(), electronicsMapCallback(), gainsCallback(), gainWidthsCallback(), edm::ParameterSet::getUntrackedParameter(), mDumpRequest, mDumpStream, pedestalsCallback(), pedestalWidthsCallback(), QIEDataCallback(), edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

37  : ESProducer(),
38  mService (new CastorDbService (fConfig)),
39  mDumpRequest (),
40  mDumpStream(nullptr)
41 {
42  //the following line is needed to tell the framework what
43  // data is being produced
51  )
52  );
53 
54  //now do what ever other initialization is needed
55 
56  mDumpRequest = fConfig.getUntrackedParameter <std::vector <std::string> > ("dump", std::vector<std::string>());
57  if (!mDumpRequest.empty()) {
58  std::string otputFile = fConfig.getUntrackedParameter <std::string> ("file", "");
59  mDumpStream = otputFile.empty () ? &std::cout : new std::ofstream (otputFile.c_str());
60  }
61 }
T getUntrackedParameter(std::string const &, T const &) const
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
void QIEDataCallback(const CastorQIEDataRcd &fRecord)
std::vector< std::string > mDumpRequest
void gainWidthsCallback(const CastorGainWidthsRcd &fRecord)
void pedestalsCallback(const CastorPedestalsRcd &fRecord)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void channelQualityCallback(const CastorChannelQualityRcd &fRecord)
std::shared_ptr< CastorDbService > mService
void electronicsMapCallback(const CastorElectronicsMapRcd &fRecord)
std::ostream * mDumpStream
void gainsCallback(const CastorGainsRcd &fRecord)
void pedestalWidthsCallback(const CastorPedestalWidthsRcd &fRecord)
CastorDbProducer::~CastorDbProducer ( )
override

Definition at line 64 of file CastorDbProducer.cc.

References gather_cfg::cout, and mDumpStream.

65 {
66 
67  // do anything here that needs to be done at desctruction time
68  // (e.g. close files, deallocate resources etc.)
69  if (mDumpStream != &std::cout) delete mDumpStream;
70 }
std::ostream * mDumpStream

Member Function Documentation

void CastorDbProducer::channelQualityCallback ( const CastorChannelQualityRcd fRecord)

Definition at line 137 of file CastorDbProducer.cc.

References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CastorDbProducer().

137  {
139  fRecord.get (item);
140  mService->setData (item.product ());
141  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end()) {
142  *mDumpStream << "New HCAL/CASTOR ChannelQuality set" << std::endl;
144  }
145 }
std::vector< std::string > mDumpRequest
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
std::shared_ptr< CastorDbService > mService
std::ostream * mDumpStream
T const * product() const
Definition: ESHandle.h:86
void CastorDbProducer::electronicsMapCallback ( const CastorElectronicsMapRcd fRecord)

Definition at line 147 of file CastorDbProducer.cc.

References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CastorDbProducer().

147  {
149  fRecord.get (item);
150  mService->setData (item.product ());
151  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ElectronicsMap")) != mDumpRequest.end()) {
152  *mDumpStream << "New HCAL/CASTOR Electronics Map set" << std::endl;
154  }
155 }
std::vector< std::string > mDumpRequest
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
std::shared_ptr< CastorDbService > mService
std::ostream * mDumpStream
T const * product() const
Definition: ESHandle.h:86
void CastorDbProducer::gainsCallback ( const CastorGainsRcd fRecord)

Definition at line 106 of file CastorDbProducer.cc.

References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CastorDbProducer().

106  {
108  fRecord.get (item);
109  mService->setData (item.product ());
110  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end()) {
111  *mDumpStream << "New HCAL/CASTOR Gains set" << std::endl;
113  }
114 }
std::vector< std::string > mDumpRequest
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
std::shared_ptr< CastorDbService > mService
std::ostream * mDumpStream
T const * product() const
Definition: ESHandle.h:86
void CastorDbProducer::gainWidthsCallback ( const CastorGainWidthsRcd fRecord)

Definition at line 117 of file CastorDbProducer.cc.

References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CastorDbProducer().

117  {
119  fRecord.get (item);
120  mService->setData (item.product ());
121  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end()) {
122  *mDumpStream << "New HCAL/CASTOR GainWidths set" << std::endl;
124  }
125 }
std::vector< std::string > mDumpRequest
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
std::shared_ptr< CastorDbService > mService
std::ostream * mDumpStream
T const * product() const
Definition: ESHandle.h:86
void CastorDbProducer::pedestalsCallback ( const CastorPedestalsRcd fRecord)

Definition at line 83 of file CastorDbProducer.cc.

References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CastorDbProducer().

83  {
84 
86  fRecord.get (item);
87 
88  mService->setData (item.product ());
89  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end()) {
90  *mDumpStream << "New HCAL/CASTOR Pedestals set" << std::endl;
92  }
93 }
std::vector< std::string > mDumpRequest
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
std::shared_ptr< CastorDbService > mService
std::ostream * mDumpStream
T const * product() const
Definition: ESHandle.h:86
void CastorDbProducer::pedestalWidthsCallback ( const CastorPedestalWidthsRcd fRecord)

Definition at line 95 of file CastorDbProducer.cc.

References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CastorDbProducer().

95  {
97  fRecord.get (item);
98  mService->setData (item.product ());
99  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end()) {
100  *mDumpStream << "New HCAL/CASTOR Pedestals set" << std::endl;
102  }
103 }
std::vector< std::string > mDumpRequest
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
std::shared_ptr< CastorDbService > mService
std::ostream * mDumpStream
T const * product() const
Definition: ESHandle.h:86
std::shared_ptr< CastorDbService > CastorDbProducer::produce ( const CastorDbRecord )

Definition at line 78 of file CastorDbProducer.cc.

References mService.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

79 {
80  return mService;
81 }
std::shared_ptr< CastorDbService > mService
void CastorDbProducer::QIEDataCallback ( const CastorQIEDataRcd fRecord)

Definition at line 127 of file CastorDbProducer.cc.

References CastorDbASCIIIO::dumpObject(), spr::find(), edm::eventsetup::EventSetupRecord::get(), mDumpRequest, mDumpStream, mService, edm::ESHandle< T >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CastorDbProducer().

127  {
129  fRecord.get (item);
130  mService->setData (item.product ());
131  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end()) {
132  *mDumpStream << "New HCAL/CASTOR QIEData set" << std::endl;
134  }
135 }
std::vector< std::string > mDumpRequest
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
std::shared_ptr< CastorDbService > mService
std::ostream * mDumpStream
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

std::vector<std::string> CastorDbProducer::mDumpRequest
private
std::ostream* CastorDbProducer::mDumpStream
private
std::shared_ptr<CastorDbService> CastorDbProducer::mService
private