CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
EcalLaserCorrectionService Class Reference
Inheritance diagram for EcalLaserCorrectionService:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 EcalLaserCorrectionService (const edm::ParameterSet &)
 
std::shared_ptr< EcalLaserDbServiceproduce (const EcalLaserDbRecord &)
 
 ~EcalLaserCorrectionService () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Types

using HostType = edm::ESProductHost< EcalLaserDbService, EcalLaserAlphasRcd, EcalLaserAPDPNRatiosRefRcd, EcalLaserAPDPNRatiosRcd, EcalLinearCorrectionsRcd >
 

Private Attributes

edm::ESGetToken< EcalLaserAlphas, EcalLaserAlphasRcdalphaToken_
 
edm::ESGetToken< EcalLaserAPDPNRatiosRef, EcalLaserAPDPNRatiosRefRcdapdpnRefToken_
 
edm::ESGetToken< EcalLaserAPDPNRatios, EcalLaserAPDPNRatiosRcdapdpnToken_
 
edm::ReusableObjectHolder< HostTypeholder_
 
edm::ESGetToken< EcalLinearCorrections, EcalLinearCorrectionsRcdlinearToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 24 of file EcalLaserCorrectionService.cc.

Member Typedef Documentation

◆ HostType

Definition at line 36 of file EcalLaserCorrectionService.cc.

Constructor & Destructor Documentation

◆ EcalLaserCorrectionService()

EcalLaserCorrectionService::EcalLaserCorrectionService ( const edm::ParameterSet fConfig)

Definition at line 50 of file EcalLaserCorrectionService.cc.

51  : ESProducer()
52 // mDumpRequest (),
53 // mDumpStream(0)
54 {
55  //the following line is needed to tell the framework what
56  // data is being produced
57  // setWhatProduced (this, (dependsOn (&EcalLaserCorrectionService::apdpnCallback)));
58 
59  setWhatProduced(this)
60  .setConsumes(alphaToken_)
61  .setConsumes(apdpnRefToken_)
62  .setConsumes(apdpnToken_)
63  .setConsumes(linearToken_);
64 
65  //now do what ever other initialization is needed
66 
67  // mDumpRequest = fConfig.getUntrackedParameter <std::vector <std::string> > ("dump", std::vector<std::string>());
68  // if (!mDumpRequest.empty()) {
69  // std::string otputFile = fConfig.getUntrackedParameter <std::string> ("file", "");
70  // mDumpStream = otputFile.empty () ? &std::cout : new std::ofstream (otputFile.c_str());
71  // }
72 }

References alphaToken_, apdpnRefToken_, apdpnToken_, linearToken_, and edm::ESProducer::setWhatProduced().

◆ ~EcalLaserCorrectionService()

EcalLaserCorrectionService::~EcalLaserCorrectionService ( )
override

Definition at line 74 of file EcalLaserCorrectionService.cc.

74  {
75  // do anything here that needs to be done at desctruction time
76  // (e.g. close files, deallocate resources etc.)
77  // if (mDumpStream != &std::cout) delete mDumpStream;
78 }

Member Function Documentation

◆ produce()

std::shared_ptr< EcalLaserDbService > EcalLaserCorrectionService::produce ( const EcalLaserDbRecord record)

Definition at line 85 of file EcalLaserCorrectionService.cc.

85  {
86  auto host = holder_.makeOrGet([]() { return new HostType; });
87 
88  host->ifRecordChanges<EcalLinearCorrectionsRcd>(
89  record, [this, h = host.get()](auto const& rec) { h->setLinearCorrectionsData(&rec.get(linearToken_)); });
90 
91  host->ifRecordChanges<EcalLaserAPDPNRatiosRcd>(
92  record, [this, h = host.get()](auto const& rec) { h->setAPDPNData(&rec.get(apdpnToken_)); });
93 
94  host->ifRecordChanges<EcalLaserAPDPNRatiosRefRcd>(
95  record, [this, h = host.get()](auto const& rec) { h->setAPDPNRefData(&rec.get(apdpnRefToken_)); });
96 
97  host->ifRecordChanges<EcalLaserAlphasRcd>(
98  record, [this, h = host.get()](auto const& rec) { h->setAlphaData(&rec.get(alphaToken_)); });
99 
100  return host; // automatically converts to std::shared_ptr<EcalLaserDbService>
101 }

References alphaToken_, apdpnRefToken_, apdpnToken_, holder_, query::host, linearToken_, edm::ReusableObjectHolder< T, Deleter >::makeOrGet(), and GlobalPosition_Frontier_DevDB_cff::record.

Member Data Documentation

◆ alphaToken_

edm::ESGetToken<EcalLaserAlphas, EcalLaserAlphasRcd> EcalLaserCorrectionService::alphaToken_
private

Definition at line 41 of file EcalLaserCorrectionService.cc.

Referenced by EcalLaserCorrectionService(), and produce().

◆ apdpnRefToken_

edm::ESGetToken<EcalLaserAPDPNRatiosRef, EcalLaserAPDPNRatiosRefRcd> EcalLaserCorrectionService::apdpnRefToken_
private

Definition at line 42 of file EcalLaserCorrectionService.cc.

Referenced by EcalLaserCorrectionService(), and produce().

◆ apdpnToken_

edm::ESGetToken<EcalLaserAPDPNRatios, EcalLaserAPDPNRatiosRcd> EcalLaserCorrectionService::apdpnToken_
private

Definition at line 43 of file EcalLaserCorrectionService.cc.

Referenced by EcalLaserCorrectionService(), and produce().

◆ holder_

edm::ReusableObjectHolder<HostType> EcalLaserCorrectionService::holder_
private

Definition at line 39 of file EcalLaserCorrectionService.cc.

Referenced by produce().

◆ linearToken_

edm::ESGetToken<EcalLinearCorrections, EcalLinearCorrectionsRcd> EcalLaserCorrectionService::linearToken_
private

Definition at line 44 of file EcalLaserCorrectionService.cc.

Referenced by EcalLaserCorrectionService(), and produce().

EcalLaserAPDPNRatiosRcd
Definition: EcalLaserAPDPNRatiosRcd.h:24
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
EcalLaserAPDPNRatiosRefRcd
Definition: EcalLaserAPDPNRatiosRefRcd.h:24
query.host
host
Definition: query.py:115
edm::ReusableObjectHolder::makeOrGet
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn't an object already available, creates a new one using iFunc.
Definition: ReusableObjectHolder.h:126
edm::ESProducer::ESProducer
ESProducer()
Definition: ESProducer.cc:30
EcalLaserCorrectionService::alphaToken_
edm::ESGetToken< EcalLaserAlphas, EcalLaserAlphasRcd > alphaToken_
Definition: EcalLaserCorrectionService.cc:41
h
EcalLaserCorrectionService::apdpnToken_
edm::ESGetToken< EcalLaserAPDPNRatios, EcalLaserAPDPNRatiosRcd > apdpnToken_
Definition: EcalLaserCorrectionService.cc:43
EcalLaserAlphasRcd
Definition: EcalLaserAlphasRcd.h:24
EcalLinearCorrectionsRcd
Definition: EcalLinearCorrectionsRcd.h:5
EcalLaserCorrectionService::linearToken_
edm::ESGetToken< EcalLinearCorrections, EcalLinearCorrectionsRcd > linearToken_
Definition: EcalLaserCorrectionService.cc:44
EcalLaserCorrectionService::holder_
edm::ReusableObjectHolder< HostType > holder_
Definition: EcalLaserCorrectionService.cc:39
EcalLaserCorrectionService::apdpnRefToken_
edm::ESGetToken< EcalLaserAPDPNRatiosRef, EcalLaserAPDPNRatiosRefRcd > apdpnRefToken_
Definition: EcalLaserCorrectionService.cc:42
EcalLaserCorrectionService::HostType
edm::ESProductHost< EcalLaserDbService, EcalLaserAlphasRcd, EcalLaserAPDPNRatiosRefRcd, EcalLaserAPDPNRatiosRcd, EcalLinearCorrectionsRcd > HostType
Definition: EcalLaserCorrectionService.cc:36