CMS 3D CMS Logo

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

#include <EcalLaserCorrectionService.h>

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 ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~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 Types

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

Private Member Functions

void setupAlpha (const EcalLaserAlphasRcd &fRecord, EcalLaserDbService &service)
 
void setupApdpn (const EcalLaserAPDPNRatiosRcd &fRecord, EcalLaserDbService &service)
 
void setupApdpnRef (const EcalLaserAPDPNRatiosRefRcd &fRecord, EcalLaserDbService &service)
 
void setupLinear (const EcalLinearCorrectionsRcd &fRecord, EcalLaserDbService &service)
 

Private Attributes

edm::ReusableObjectHolder< HostTypeholder_
 

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
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *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 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

Definition at line 23 of file EcalLaserCorrectionService.h.

Member Typedef Documentation

Definition at line 36 of file EcalLaserCorrectionService.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file EcalLaserCorrectionService.cc.

References edm::ESProducer::setWhatProduced().

18  : ESProducer()
19  // mDumpRequest (),
20  // mDumpStream(0)
21 {
22  //the following line is needed to tell the framework what
23  // data is being produced
24  // setWhatProduced (this, (dependsOn (&EcalLaserCorrectionService::apdpnCallback)));
25 
26  setWhatProduced (this);
27 
28  //now do what ever other initialization is needed
29 
30  // mDumpRequest = fConfig.getUntrackedParameter <std::vector <std::string> > ("dump", std::vector<std::string>());
31  // if (!mDumpRequest.empty()) {
32  // std::string otputFile = fConfig.getUntrackedParameter <std::string> ("file", "");
33  // mDumpStream = otputFile.empty () ? &std::cout : new std::ofstream (otputFile.c_str());
34  // }
35 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
EcalLaserCorrectionService::~EcalLaserCorrectionService ( )
override

Definition at line 38 of file EcalLaserCorrectionService.cc.

39 {
40 
41  // do anything here that needs to be done at desctruction time
42  // (e.g. close files, deallocate resources etc.)
43  // if (mDumpStream != &std::cout) delete mDumpStream;
44 }

Member Function Documentation

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

Definition at line 52 of file EcalLaserCorrectionService.cc.

References h, holder_, query::host, edm::ReusableObjectHolder< T >::makeOrGet(), record, setupAlpha(), setupApdpn(), setupApdpnRef(), and setupLinear().

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

53 {
54  auto host = holder_.makeOrGet([]() {
55  return new HostType;
56  });
57 
58  host->ifRecordChanges<EcalLinearCorrectionsRcd>(record,
59  [this,h=host.get()](auto const& rec) {
60  setupLinear(rec, *h);
61  });
62 
63  host->ifRecordChanges<EcalLaserAPDPNRatiosRcd>(record,
64  [this,h=host.get()](auto const& rec) {
65  setupApdpn(rec, *h);
66  });
67 
68  host->ifRecordChanges<EcalLaserAPDPNRatiosRefRcd>(record,
69  [this,h=host.get()](auto const& rec) {
70  setupApdpnRef(rec, *h);
71  });
72 
73  host->ifRecordChanges<EcalLaserAlphasRcd>(record,
74  [this,h=host.get()](auto const& rec) {
75  setupAlpha(rec, *h);
76  });
77 
78  return host; // automatically converts to std::shared_ptr<EcalLaserDbService>
79 }
host
Definition: query.py:115
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
JetCorrectorParameters::Record record
Definition: classes.h:7
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn&#39;t an object already available, creates a new one using iFunc.
void setupLinear(const EcalLinearCorrectionsRcd &fRecord, EcalLaserDbService &service)
edm::ESProductHost< EcalLaserDbService, EcalLaserAlphasRcd, EcalLaserAPDPNRatiosRefRcd, EcalLaserAPDPNRatiosRcd, EcalLinearCorrectionsRcd > HostType
void setupAlpha(const EcalLaserAlphasRcd &fRecord, EcalLaserDbService &service)
edm::ReusableObjectHolder< HostType > holder_
void setupApdpnRef(const EcalLaserAPDPNRatiosRefRcd &fRecord, EcalLaserDbService &service)
void setupApdpn(const EcalLaserAPDPNRatiosRcd &fRecord, EcalLaserDbService &service)
void EcalLaserCorrectionService::setupAlpha ( const EcalLaserAlphasRcd fRecord,
EcalLaserDbService service 
)
private

Definition at line 81 of file EcalLaserCorrectionService.cc.

References edm::eventsetup::EventSetupRecordImplementation< T >::get(), edm::ESHandle< T >::product(), and EcalLaserDbService::setAlphaData().

Referenced by produce().

82  {
84  fRecord.get (item);
85  service.setAlphaData (item.product ());
86 }
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void setAlphaData(const EcalLaserAlphas *fItem)
T const * product() const
Definition: ESHandle.h:86
void EcalLaserCorrectionService::setupApdpn ( const EcalLaserAPDPNRatiosRcd fRecord,
EcalLaserDbService service 
)
private

Definition at line 95 of file EcalLaserCorrectionService.cc.

References edm::eventsetup::EventSetupRecordImplementation< T >::get(), edm::ESHandle< T >::product(), and EcalLaserDbService::setAPDPNData().

Referenced by produce().

96  {
98  fRecord.get (item);
99  service.setAPDPNData (item.product ());
100 }
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void setAPDPNData(const EcalLaserAPDPNRatios *fItem)
T const * product() const
Definition: ESHandle.h:86
void EcalLaserCorrectionService::setupApdpnRef ( const EcalLaserAPDPNRatiosRefRcd fRecord,
EcalLaserDbService service 
)
private

Definition at line 88 of file EcalLaserCorrectionService.cc.

References edm::eventsetup::EventSetupRecordImplementation< T >::get(), edm::ESHandle< T >::product(), and EcalLaserDbService::setAPDPNRefData().

Referenced by produce().

89  {
91  fRecord.get (item);
92  service.setAPDPNRefData (item.product ());
93 }
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void setAPDPNRefData(const EcalLaserAPDPNRatiosRef *fItem)
T const * product() const
Definition: ESHandle.h:86
void EcalLaserCorrectionService::setupLinear ( const EcalLinearCorrectionsRcd fRecord,
EcalLaserDbService service 
)
private

Definition at line 102 of file EcalLaserCorrectionService.cc.

References edm::eventsetup::EventSetupRecordImplementation< T >::get(), edm::ESHandle< T >::product(), and EcalLaserDbService::setLinearCorrectionsData().

Referenced by produce().

103  {
105  fRecord.get (item);
106  service.setLinearCorrectionsData (item.product ());
107 }
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void setLinearCorrectionsData(const EcalLinearCorrections *fItem)
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

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

Definition at line 48 of file EcalLaserCorrectionService.h.

Referenced by produce().