CMS 3D CMS Logo

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

Public Types

using ReturnType = std::unique_ptr< RunInfo >
 

Public Member Functions

ReturnType produce (const RunInfoRcd &)
 
 RunInfoTestESProducer (const edm::ParameterSet &)
 
- 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 ()(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)
 

Static Public Member Functions

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

Private Member Functions

RunInfo makeRunInfo (edm::ParameterSet const &pset) const
 

Private Attributes

std::vector< RunInforunInfos_
 

Additional Inherited Members

- 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 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 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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 35 of file RunInfoTestESProducer.cc.

Member Typedef Documentation

using RunInfoTestESProducer::ReturnType = std::unique_ptr<RunInfo>

Definition at line 39 of file RunInfoTestESProducer.cc.

Constructor & Destructor Documentation

RunInfoTestESProducer::RunInfoTestESProducer ( const edm::ParameterSet iConfig)

Definition at line 65 of file RunInfoTestESProducer.cc.

References edm::ParameterSet::getParameter(), makeRunInfo(), muonDTDigis_cfi::pset, runInfos_, and edm::ESProducer::setWhatProduced().

65  {
66  std::vector<edm::ParameterSet> const& runInfos = iConfig.getParameter<std::vector<edm::ParameterSet>>("runInfos");
67  runInfos_.reserve(runInfos.size());
68  for (auto const& pset : runInfos) {
69  runInfos_.emplace_back(makeRunInfo(pset));
70  }
71  std::sort(runInfos_.begin(), runInfos_.end(), ri_less);
72 
73  setWhatProduced(this);
74 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
std::vector< RunInfo > runInfos_
RunInfo makeRunInfo(edm::ParameterSet const &pset) const

Member Function Documentation

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

Definition at line 120 of file RunInfoTestESProducer.cc.

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

120  {
121  edm::ParameterSetDescription runInfoDesc;
122  runInfoDesc.add<int>("run");
123  runInfoDesc.add<long long>("start_time", 0);
124  runInfoDesc.add<std::string>("start_time_str", "");
125  runInfoDesc.add<long long>("stop_time", 0);
126  runInfoDesc.add<std::string>("stop_time_str", "");
127  runInfoDesc.add<std::vector<int>>("fed_in", {});
128  runInfoDesc.add<double>("start_current", 0);
129  runInfoDesc.add<double>("stop_current", 0);
130  runInfoDesc.add<double>("avg_current", 0);
131  runInfoDesc.add<double>("min_current", 0);
132  runInfoDesc.add<double>("max_current", 0);
133  runInfoDesc.add<double>("run_intervall_micros", 0);
134  runInfoDesc.add<std::vector<double>>("current", {});
135  runInfoDesc.add<std::vector<double>>("times_of_currents", {});
136 
138  desc.addVPSet("runInfos", runInfoDesc, {});
139 
140  descriptions.addDefault(desc);
141 }
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)
RunInfo RunInfoTestESProducer::makeRunInfo ( edm::ParameterSet const &  pset) const
private

Definition at line 92 of file RunInfoTestESProducer.cc.

References fileCollector::convert(), filterCSVwithJSON::copy, f, edm::ParameterSet::getParameter(), RunInfo::m_avg_current, RunInfo::m_current, RunInfo::m_fed_in, RunInfo::m_max_current, RunInfo::m_min_current, RunInfo::m_run, RunInfo::m_run_intervall_micros, RunInfo::m_start_current, RunInfo::m_start_time_ll, RunInfo::m_start_time_str, RunInfo::m_stop_current, RunInfo::m_stop_time_ll, RunInfo::m_stop_time_str, RunInfo::m_times_of_currents, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by RunInfoTestESProducer().

92  {
93  RunInfo retValue;
94  retValue.m_run = pset.getParameter<int>("run");
95  retValue.m_start_time_ll = pset.getParameter<long long>("start_time");
96  retValue.m_start_time_str = pset.getParameter<std::string>("start_time_str");
97  retValue.m_stop_time_ll = pset.getParameter<long long>("stop_time");
98  retValue.m_stop_time_str = pset.getParameter<std::string>("stop_time_str");
99  retValue.m_fed_in = pset.getParameter<std::vector<int>>("fed_in");
100  retValue.m_start_current = pset.getParameter<double>("start_current");
101  retValue.m_stop_current = pset.getParameter<double>("stop_current");
102  retValue.m_avg_current = pset.getParameter<double>("avg_current");
103  retValue.m_min_current = pset.getParameter<double>("min_current");
104  retValue.m_max_current = pset.getParameter<double>("max_current");
105  retValue.m_run_intervall_micros = pset.getParameter<double>("run_intervall_micros");
106 
107  auto convert = [](std::vector<double> const& iIn) {
108  std::vector<float> f;
109  f.reserve(iIn.size());
110  std::copy(iIn.begin(), iIn.end(), std::back_inserter(f));
111  return f;
112  };
113 
114  retValue.m_current = convert(pset.getParameter<std::vector<double>>("current"));
115  retValue.m_times_of_currents = convert(pset.getParameter<std::vector<double>>("times_of_currents"));
116 
117  return retValue;
118 }
std::vector< int > m_fed_in
Definition: RunInfo.h:25
std::string m_start_time_str
Definition: RunInfo.h:22
double f[11][100]
std::vector< float > m_current
Definition: RunInfo.h:32
def convert(infile, ofile)
float m_stop_current
Definition: RunInfo.h:27
long long m_stop_time_ll
Definition: RunInfo.h:23
float m_min_current
Definition: RunInfo.h:30
float m_avg_current
Definition: RunInfo.h:28
float m_run_intervall_micros
Definition: RunInfo.h:31
float m_max_current
Definition: RunInfo.h:29
float m_start_current
Definition: RunInfo.h:26
std::string m_stop_time_str
Definition: RunInfo.h:24
int m_run
Definition: RunInfo.h:20
std::vector< float > m_times_of_currents
Definition: RunInfo.h:33
long long m_start_time_ll
Definition: RunInfo.h:21
RunInfoTestESProducer::ReturnType RunInfoTestESProducer::produce ( const RunInfoRcd iRecord)

Definition at line 81 of file RunInfoTestESProducer.cc.

References edm::IOVSyncValue::eventID(), edm::ValidityInterval::first(), RunInfo::m_run, or, writedatasetfile::run, edm::EventID::run(), runInfos_, and edm::eventsetup::EventSetupRecord::validityInterval().

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

81  {
82  const int run = iRecord.validityInterval().first().eventID().run();
83  RunInfo toFind;
84  toFind.m_run = run;
85  auto itFound = std::lower_bound(runInfos_.begin(), runInfos_.end(), toFind, ri_less);
86  if (itFound == runInfos_.end() or itFound->m_run != run) {
87  return nullptr;
88  }
89  return std::make_unique<RunInfo>(*itFound);
90 }
RunNumber_t run() const
Definition: EventID.h:38
const EventID & eventID() const
Definition: IOVSyncValue.h:40
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< RunInfo > runInfos_
ValidityInterval validityInterval() const
const IOVSyncValue & first() const
int m_run
Definition: RunInfo.h:20

Member Data Documentation

std::vector<RunInfo> RunInfoTestESProducer::runInfos_
private

Definition at line 48 of file RunInfoTestESProducer.cc.

Referenced by produce(), and RunInfoTestESProducer().