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, boost::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 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().

38  : ESProducer(),
39  mService (new CastorDbService (fConfig)),
40  mDumpRequest (),
41  mDumpStream(0)
42 {
43  //the following line is needed to tell the framework what
44  // data is being produced
52  )
53  );
54 
55  //now do what ever other initialization is needed
56 
57  mDumpRequest = fConfig.getUntrackedParameter <std::vector <std::string> > ("dump", std::vector<std::string>());
58  if (!mDumpRequest.empty()) {
59  std::string otputFile = fConfig.getUntrackedParameter <std::string> ("file", "");
60  mDumpStream = otputFile.empty () ? &std::cout : new std::ofstream (otputFile.c_str());
61  }
62 }
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:121
std::ostream * mDumpStream
void gainsCallback(const CastorGainsRcd &fRecord)
void pedestalWidthsCallback(const CastorPedestalWidthsRcd &fRecord)
CastorDbProducer::~CastorDbProducer ( )

Definition at line 65 of file CastorDbProducer.cc.

References gather_cfg::cout, and mDumpStream.

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

Member Function Documentation

void CastorDbProducer::channelQualityCallback ( const CastorChannelQualityRcd fRecord)

Definition at line 138 of file CastorDbProducer.cc.

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

Referenced by CastorDbProducer().

138  {
140  fRecord.get (item);
141  mService->setData (item.product ());
142  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end()) {
143  *mDumpStream << "New HCAL/CASTOR ChannelQuality set" << std::endl;
145  }
146 }
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:62
std::ostream * mDumpStream
void CastorDbProducer::electronicsMapCallback ( const CastorElectronicsMapRcd fRecord)

Definition at line 148 of file CastorDbProducer.cc.

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

Referenced by CastorDbProducer().

148  {
150  fRecord.get (item);
151  mService->setData (item.product ());
152  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ElectronicsMap")) != mDumpRequest.end()) {
153  *mDumpStream << "New HCAL/CASTOR Electronics Map set" << std::endl;
155  }
156 }
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:62
std::ostream * mDumpStream
void CastorDbProducer::gainsCallback ( const CastorGainsRcd fRecord)

Definition at line 107 of file CastorDbProducer.cc.

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

Referenced by CastorDbProducer().

107  {
109  fRecord.get (item);
110  mService->setData (item.product ());
111  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end()) {
112  *mDumpStream << "New HCAL/CASTOR Gains set" << std::endl;
114  }
115 }
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:62
std::ostream * mDumpStream
void CastorDbProducer::gainWidthsCallback ( const CastorGainWidthsRcd fRecord)

Definition at line 118 of file CastorDbProducer.cc.

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

Referenced by CastorDbProducer().

118  {
120  fRecord.get (item);
121  mService->setData (item.product ());
122  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end()) {
123  *mDumpStream << "New HCAL/CASTOR GainWidths set" << std::endl;
125  }
126 }
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:62
std::ostream * mDumpStream
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< class >::product().

Referenced by CastorDbProducer().

84  {
85 
87  fRecord.get (item);
88 
89  mService->setData (item.product ());
90  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end()) {
91  *mDumpStream << "New HCAL/CASTOR Pedestals set" << std::endl;
93  }
94 }
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:62
std::ostream * mDumpStream
void CastorDbProducer::pedestalWidthsCallback ( const CastorPedestalWidthsRcd fRecord)

Definition at line 96 of file CastorDbProducer.cc.

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

Referenced by CastorDbProducer().

96  {
98  fRecord.get (item);
99  mService->setData (item.product ());
100  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end()) {
101  *mDumpStream << "New HCAL/CASTOR Pedestals set" << std::endl;
103  }
104 }
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:62
std::ostream * mDumpStream
boost::shared_ptr< CastorDbService > CastorDbProducer::produce ( const CastorDbRecord )

Definition at line 79 of file CastorDbProducer.cc.

References mService.

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

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

Definition at line 128 of file CastorDbProducer.cc.

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

Referenced by CastorDbProducer().

128  {
130  fRecord.get (item);
131  mService->setData (item.product ());
132  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end()) {
133  *mDumpStream << "New HCAL/CASTOR QIEData set" << std::endl;
135  }
136 }
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:62
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