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

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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 35 of file RunInfoTestESProducer.cc.

Member Typedef Documentation

◆ ReturnType

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

Definition at line 39 of file RunInfoTestESProducer.cc.

Constructor & Destructor Documentation

◆ RunInfoTestESProducer()

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

Definition at line 65 of file RunInfoTestESProducer.cc.

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 }

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 120 of file RunInfoTestESProducer.cc.

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 }

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

◆ makeRunInfo()

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

Definition at line 92 of file RunInfoTestESProducer.cc.

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 }

References fileCollector::convert(), filterCSVwithJSON::copy, f, 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, muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by RunInfoTestESProducer().

◆ produce()

RunInfoTestESProducer::ReturnType RunInfoTestESProducer::produce ( const RunInfoRcd iRecord)

Definition at line 81 of file RunInfoTestESProducer.cc.

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 }

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

Member Data Documentation

◆ runInfos_

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

Definition at line 48 of file RunInfoTestESProducer.cc.

Referenced by produce(), and RunInfoTestESProducer().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
RunInfo::m_max_current
float m_max_current
Definition: RunInfo.h:29
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ValidityInterval::first
const IOVSyncValue & first() const
Definition: ValidityInterval.h:37
RunInfo::m_fed_in
std::vector< int > m_fed_in
Definition: RunInfo.h:25
RunInfo::m_times_of_currents
std::vector< float > m_times_of_currents
Definition: RunInfo.h:33
RunInfoTestESProducer::makeRunInfo
RunInfo makeRunInfo(edm::ParameterSet const &pset) const
Definition: RunInfoTestESProducer.cc:92
RunInfo::m_stop_current
float m_stop_current
Definition: RunInfo.h:27
RunInfo
Definition: RunInfo.h:18
RunInfoTestESProducer::runInfos_
std::vector< RunInfo > runInfos_
Definition: RunInfoTestESProducer.cc:48
RunInfo::m_run_intervall_micros
float m_run_intervall_micros
Definition: RunInfo.h:31
cuda_std::lower_bound
__host__ constexpr __device__ RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
Definition: cudastdAlgorithm.h:27
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
RunInfo::m_stop_time_ll
long long m_stop_time_ll
Definition: RunInfo.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
fileCollector.convert
def convert(infile, ofile)
Definition: fileCollector.py:47
edm::IOVSyncValue::eventID
const EventID & eventID() const
Definition: IOVSyncValue.h:40
edm::ParameterSetDescription::addVPSet
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
Definition: ParameterSetDescription.h:149
RunInfo::m_start_current
float m_start_current
Definition: RunInfo.h:26
RunInfo::m_current
std::vector< float > m_current
Definition: RunInfo.h:32
RunInfo::m_start_time_str
std::string m_start_time_str
Definition: RunInfo.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
writedatasetfile.run
run
Definition: writedatasetfile.py:27
RunInfo::m_min_current
float m_min_current
Definition: RunInfo.h:30
or
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
RunInfo::m_avg_current
float m_avg_current
Definition: RunInfo.h:28
edm::eventsetup::EventSetupRecord::validityInterval
ValidityInterval validityInterval() const
Definition: EventSetupRecord.h:93
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
RunInfo::m_run
int m_run
Definition: RunInfo.h:20
RunInfo::m_stop_time_str
std::string m_stop_time_str
Definition: RunInfo.h:24
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
RunInfo::m_start_time_ll
long long m_start_time_ll
Definition: RunInfo.h:21