CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
HBHEDarkeningEP Class Reference

#include <HBHEDarkeningEP.h>

Inheritance diagram for HBHEDarkeningEP:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::unique_ptr< HBHEDarkeningReturnType
 
- 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
 

Public Member Functions

 HBHEDarkeningEP (const edm::ParameterSet &)
 
ReturnType produce (const HBHEDarkeningRecord &)
 
 ~HBHEDarkeningEP () 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)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 
- 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 &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Attributes

const edm::ParameterSetpset_
 

Detailed Description

Definition at line 19 of file HBHEDarkeningEP.h.

Member Typedef Documentation

typedef std::unique_ptr<HBHEDarkening> HBHEDarkeningEP::ReturnType

Definition at line 24 of file HBHEDarkeningEP.h.

Constructor & Destructor Documentation

HBHEDarkeningEP::HBHEDarkeningEP ( const edm::ParameterSet pset)

Definition at line 11 of file HBHEDarkeningEP.cc.

References edm::ESProducer::setWhatProduced().

11  : pset_(pset)
12 {
13  setWhatProduced(this);
14  findingRecord<HBHEDarkeningRecord>();
15 }
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
const edm::ParameterSet & pset_
HBHEDarkeningEP::~HBHEDarkeningEP ( )
override

Definition at line 17 of file HBHEDarkeningEP.cc.

18 {}

Member Function Documentation

void HBHEDarkeningEP::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 24 of file HBHEDarkeningEP.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addVPSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

24  {
26  desc.add<int>("ieta_shift");
27  desc.add<double>("drdA");
28  desc.add<double>("drdB");
29  edm::ParameterSetDescription desc_dosemaps;
30  desc_dosemaps.add<int>("energy");
31  desc_dosemaps.add<edm::FileInPath>("file");
32  std::vector<edm::ParameterSet> default_dosemap(1);
33  desc.addVPSet("dosemaps",desc_dosemaps,default_dosemap);
35  desc_years.add<std::string>("year");
36  desc_years.add<double>("intlumi");
37  desc_years.add<double>("lumirate");
38  desc_years.add<int>("energy");
39  std::vector<edm::ParameterSet> default_year(1);
40  desc.addVPSet("years",desc_years,default_year);
41 
42  descriptions.addDefault(desc);
43 }
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
HBHEDarkeningEP::ReturnType HBHEDarkeningEP::produce ( const HBHEDarkeningRecord iRecord)

Definition at line 47 of file HBHEDarkeningEP.cc.

References DEFINE_FWK_EVENTSETUP_SOURCE, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), pset_, HBHEDarkening::readDoseMap(), AlCaHLTBitMon_QueryRunRegistry::string, and create_public_lumi_plots::years.

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

47  {
48  //initialize dose maps
49  std::vector<edm::ParameterSet> p_dosemaps = pset_.getParameter<std::vector<edm::ParameterSet>>("dosemaps");
50  std::map<int,std::vector<std::vector<float>>> dosemaps;
51  for(const auto& p_dosemap : p_dosemaps){
52  edm::FileInPath fp = p_dosemap.getParameter<edm::FileInPath>("file");
53  int file_energy = p_dosemap.getParameter<int>("energy");
54  dosemaps.emplace(file_energy,HBHEDarkening::readDoseMap(fp.fullPath()));
55  }
56 
57  //initialize years
58  std::vector<edm::ParameterSet> p_years = pset_.getParameter<std::vector<edm::ParameterSet>>("years");
59  std::vector<HBHEDarkening::LumiYear> years;
60  years.reserve(p_years.size());
61  for(const auto& p_year : p_years){
62  years.emplace_back(
63  p_year.getParameter<std::string>("year"),
64  p_year.getParameter<double>("intlumi"),
65  p_year.getParameter<double>("lumirate"),
66  p_year.getParameter<int>("energy")
67  );
68  }
69 
70  return std::make_unique<HBHEDarkening>(
71  pset_.getParameter<int>("ieta_shift"),
72  pset_.getParameter<double>("drdA"),
73  pset_.getParameter<double>("drdB"),
74  dosemaps,
75  years
76  );
77 
78 }
T getParameter(std::string const &) const
const edm::ParameterSet & pset_
static std::vector< std::vector< float > > readDoseMap(const std::string &fullpath)
std::string fullPath() const
Definition: FileInPath.cc:197
void HBHEDarkeningEP::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey iKey,
const edm::IOVSyncValue iTime,
edm::ValidityInterval oInterval 
)
overrideprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 20 of file HBHEDarkeningEP.cc.

References edm::IOVSyncValue::beginOfTime(), and edm::IOVSyncValue::endOfTime().

20  {
22 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
static const IOVSyncValue & beginOfTime()

Member Data Documentation

const edm::ParameterSet& HBHEDarkeningEP::pset_
private

Definition at line 34 of file HBHEDarkeningEP.h.

Referenced by produce().