test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
boost::shared_ptr
< CastorDbService
produce (const CastorDbRecord &)
 
void QIEDataCallback (const CastorQIEDataRcd &fRecord)
 
 ~CastorDbProducer ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Private Attributes

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

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
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- 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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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 20 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(0)
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
boost::shared_ptr< CastorDbService > mService
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)
void electronicsMapCallback(const CastorElectronicsMapRcd &fRecord)
tuple cout
Definition: gather_cfg.py:145
std::ostream * mDumpStream
void gainsCallback(const CastorGainsRcd &fRecord)
void pedestalWidthsCallback(const CastorPedestalWidthsRcd &fRecord)
CastorDbProducer::~CastorDbProducer ( )

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 }
tuple cout
Definition: gather_cfg.py:145
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< class >::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
boost::shared_ptr< CastorDbService > mService
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
T const * product() const
Definition: ESHandle.h:86
std::ostream * mDumpStream
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< class >::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
boost::shared_ptr< CastorDbService > mService
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
T const * product() const
Definition: ESHandle.h:86
std::ostream * mDumpStream
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< class >::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
boost::shared_ptr< CastorDbService > mService
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
T const * product() const
Definition: ESHandle.h:86
std::ostream * mDumpStream
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< class >::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
boost::shared_ptr< CastorDbService > mService
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
T const * product() const
Definition: ESHandle.h:86
std::ostream * mDumpStream
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< class >::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
boost::shared_ptr< CastorDbService > mService
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
T const * product() const
Definition: ESHandle.h:86
std::ostream * mDumpStream
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< class >::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
boost::shared_ptr< CastorDbService > mService
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
T const * product() const
Definition: ESHandle.h:86
std::ostream * mDumpStream
boost::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 }
boost::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< class >::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
boost::shared_ptr< CastorDbService > mService
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void get(HolderT &iHolder) const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
T const * product() const
Definition: ESHandle.h:86
std::ostream * mDumpStream

Member Data Documentation

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