CMS 3D CMS Logo

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

Public Member Functions

 ConcurrentIOVESSource (edm::ParameterSet const &)
 
std::unique_ptr< IOVTestInfoproduce (ESTestRecordI const &)
 
std::unique_ptr< ESTestDataAproduceA (ESTestRecordA const &)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
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

bool isConcurrentFinder () const override
 
void setIntervalFor (edm::eventsetup::EventSetupRecordKey const &, edm::IOVSyncValue const &, edm::ValidityInterval &) override
 

Private Attributes

const bool concurrentFinder_
 
const bool findForRecordA_
 
const bool iovIsTime_
 
std::set< edm::IOVSyncValuesetOfInvalidIOV_
 
std::set< edm::IOVSyncValuesetOfIOV_
 
const bool testForceESSourceMode_
 
edm::ValidityInterval validityInterval_
 
edm::WallclockTimer wallclockTimer_
 

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::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- 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 35 of file ConcurrentIOVESSource.cc.

Constructor & Destructor Documentation

◆ ConcurrentIOVESSource()

edmtest::ConcurrentIOVESSource::ConcurrentIOVESSource ( edm::ParameterSet const &  pset)

Definition at line 68 of file ConcurrentIOVESSource.cc.

References findForRecordA_, iovIsTime_, produceA(), muonDTDigis_cfi::pset, setOfInvalidIOV_, setOfIOV_, edm::ESProducer::setWhatProduced(), edm::WallclockTimer::start(), groupFilesInBlocks::temp, heppy_batch::val, and wallclockTimer_.

69  : iovIsTime_(!pset.getParameter<bool>("iovIsRunNotTime")),
70  concurrentFinder_(pset.getParameter<bool>("concurrentFinder")),
71  testForceESSourceMode_(pset.getParameter<bool>("testForceESSourceMode")),
72  findForRecordA_(pset.getParameter<bool>("findForRecordA")) {
74 
75  std::vector<unsigned int> temp(pset.getParameter<std::vector<unsigned int>>("firstValidLumis"));
76  for (auto val : temp) {
77  if (iovIsTime_) {
79  } else {
81  }
82  }
83 
84  std::vector<unsigned int> tempInvalid(pset.getParameter<std::vector<unsigned int>>("invalidLumis"));
85  for (auto val : tempInvalid) {
86  if (iovIsTime_) {
88  } else {
90  }
91  }
92  this->findingRecord<ESTestRecordI>();
93  setWhatProduced(this);
94  if (findForRecordA_) {
95  this->findingRecord<ESTestRecordA>();
97  }
98  }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:165
std::unique_ptr< ESTestDataA > produceA(ESTestRecordA const &)
std::set< edm::IOVSyncValue > setOfInvalidIOV_
std::set< edm::IOVSyncValue > setOfIOV_

Member Function Documentation

◆ fillDescriptions()

void edmtest::ConcurrentIOVESSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 140 of file ConcurrentIOVESSource.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

140  {
142  std::vector<unsigned int> emptyVector;
143  desc.add<bool>("iovIsRunNotTime", true);
144  desc.add<bool>("concurrentFinder", true);
145  desc.add<bool>("testForceESSourceMode", false);
146  desc.add<bool>("findForRecordA", false);
147  desc.add<std::vector<unsigned int>>("firstValidLumis", emptyVector);
148  desc.add<std::vector<unsigned int>>("invalidLumis", emptyVector);
149  descriptions.addDefault(desc);
150  }
void addDefault(ParameterSetDescription const &psetDescription)

◆ isConcurrentFinder()

bool edmtest::ConcurrentIOVESSource::isConcurrentFinder ( ) const
inlineoverrideprivatevirtual

Reimplemented from edm::EventSetupRecordIntervalFinder.

Definition at line 49 of file ConcurrentIOVESSource.cc.

References concurrentFinder_.

◆ produce()

std::unique_ptr< IOVTestInfo > edmtest::ConcurrentIOVESSource::produce ( ESTestRecordI const &  record)

Definition at line 100 of file ConcurrentIOVESSource.cc.

References concurrentFinder_, data, Exception, edm::WallclockTimer::realTime(), AlCaHarvesting_cff::record, validityInterval_, and wallclockTimer_.

100  {
101  auto data = std::make_unique<IOVTestInfo>();
102 
103  edm::ValidityInterval iov = record.validityInterval();
104  edm::LogAbsolute("ConcurrentIOVESSource")
105  << "ConcurrentIOVESSource::produce startIOV = " << iov.first().luminosityBlockNumber()
106  << " endIOV = " << iov.last().luminosityBlockNumber() << " IOV index = " << record.iovIndex()
107  << " cache identifier = " << record.cacheIdentifier() << " time = " << wallclockTimer_.realTime();
108 
109  if (!concurrentFinder_) {
110  if (validityInterval_ != iov) {
111  throw cms::Exception("TestError")
112  << "ConcurrentIOVESSource::produce, testing as nonconcurrent finder and IOV changed!";
113  }
114  }
115 
116  data->iovStartRun_ = iov.first().eventID().run();
117  data->iovEndRun_ = iov.last().eventID().run();
118  data->iovStartLumi_ = iov.first().luminosityBlockNumber();
119  data->iovEndLumi_ = iov.last().luminosityBlockNumber();
120  data->iovIndex_ = record.iovIndex();
121  data->cacheIdentifier_ = record.cacheIdentifier();
122  return data;
123  }
double realTime() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
Log< level::System, true > LogAbsolute
edm::ValidityInterval validityInterval_

◆ produceA()

std::unique_ptr< ESTestDataA > edmtest::ConcurrentIOVESSource::produceA ( ESTestRecordA const &  record)

Definition at line 125 of file ConcurrentIOVESSource.cc.

References Exception, edm::ValidityInterval::first(), edm::ValidityInterval::last(), edm::IOVSyncValue::luminosityBlockNumber(), edm::WallclockTimer::realTime(), AlCaHarvesting_cff::record, testForceESSourceMode_, and wallclockTimer_.

Referenced by ConcurrentIOVESSource().

125  {
126  edm::ValidityInterval iov = record.validityInterval();
127  if (!testForceESSourceMode_ && record.iovIndex() != 0) {
128  // This criteria should never fail because the EventSetupRecord class
129  // is hard coded to allow only one IOV at a time.
130  throw cms::Exception("TestError")
131  << "ConcurrentIOVESSource::produce, more than one concurrent IOV for type ESTestRecordA!";
132  }
133  edm::LogAbsolute("ConcurrentIOVESSource")
134  << "ConcurrentIOVESSource::produceA startIOV = " << iov.first().luminosityBlockNumber()
135  << " endIOV = " << iov.last().luminosityBlockNumber() << " IOV index = " << record.iovIndex()
136  << " cache identifier = " << record.cacheIdentifier() << " time = " << wallclockTimer_.realTime();
137  return std::make_unique<ESTestDataA>(0);
138  }
const IOVSyncValue & last() const
LuminosityBlockNumber_t luminosityBlockNumber() const
Definition: IOVSyncValue.h:41
const IOVSyncValue & first() const
double realTime() const
Log< level::System, true > LogAbsolute

◆ setIntervalFor()

void edmtest::ConcurrentIOVESSource::setIntervalFor ( edm::eventsetup::EventSetupRecordKey const &  key,
edm::IOVSyncValue const &  syncValue,
edm::ValidityInterval interval 
)
overrideprivatevirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 152 of file ConcurrentIOVESSource.cc.

References edm::IOVSyncValue::endOfTime(), writeEcalDQMStatus::interval, edm::ValidityInterval::invalidInterval(), iovIsTime_, edm::EventID::maxEventNumber(), setOfInvalidIOV_, setOfIOV_, and validityInterval_.

154  {
157 
158  for (auto const& invalidSyncValue : setOfInvalidIOV_) {
159  if (syncValue == invalidSyncValue) {
160  return;
161  }
162  }
163 
164  //if no intervals given, fail immediately
165  if (setOfIOV_.empty()) {
166  return;
167  }
168 
169  std::pair<std::set<edm::IOVSyncValue>::iterator, std::set<edm::IOVSyncValue>::iterator> itFound =
170  setOfIOV_.equal_range(syncValue);
171 
172  if (itFound.first == itFound.second) {
173  if (itFound.first == setOfIOV_.begin()) {
174  //request is before first valid interval, so fail
175  return;
176  }
177  //go back one step
178  --itFound.first;
179  }
181 
182  if (itFound.second != setOfIOV_.end()) {
183  if (iovIsTime_) {
184  endOfInterval = edm::IOVSyncValue(edm::Timestamp(itFound.second->time().value() - 1));
185  } else {
186  endOfInterval = edm::IOVSyncValue(
187  edm::EventID(1, itFound.second->eventID().luminosityBlock() - 1, edm::EventID::maxEventNumber()));
188  }
189  }
190  interval = edm::ValidityInterval(*(itFound.first), endOfInterval);
192  }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
static EventNumber_t maxEventNumber()
Definition: EventID.h:96
static const ValidityInterval & invalidInterval()
edm::ValidityInterval validityInterval_
std::set< edm::IOVSyncValue > setOfInvalidIOV_
std::set< edm::IOVSyncValue > setOfIOV_

Member Data Documentation

◆ concurrentFinder_

const bool edmtest::ConcurrentIOVESSource::concurrentFinder_
private

Definition at line 56 of file ConcurrentIOVESSource.cc.

Referenced by isConcurrentFinder(), and produce().

◆ findForRecordA_

const bool edmtest::ConcurrentIOVESSource::findForRecordA_
private

Definition at line 58 of file ConcurrentIOVESSource.cc.

Referenced by ConcurrentIOVESSource().

◆ iovIsTime_

const bool edmtest::ConcurrentIOVESSource::iovIsTime_
private

Definition at line 53 of file ConcurrentIOVESSource.cc.

Referenced by ConcurrentIOVESSource(), and setIntervalFor().

◆ setOfInvalidIOV_

std::set<edm::IOVSyncValue> edmtest::ConcurrentIOVESSource::setOfInvalidIOV_
private

Definition at line 55 of file ConcurrentIOVESSource.cc.

Referenced by ConcurrentIOVESSource(), and setIntervalFor().

◆ setOfIOV_

std::set<edm::IOVSyncValue> edmtest::ConcurrentIOVESSource::setOfIOV_
private

Definition at line 54 of file ConcurrentIOVESSource.cc.

Referenced by ConcurrentIOVESSource(), and setIntervalFor().

◆ testForceESSourceMode_

const bool edmtest::ConcurrentIOVESSource::testForceESSourceMode_
private

Definition at line 57 of file ConcurrentIOVESSource.cc.

Referenced by produceA().

◆ validityInterval_

edm::ValidityInterval edmtest::ConcurrentIOVESSource::validityInterval_
private

Definition at line 65 of file ConcurrentIOVESSource.cc.

Referenced by produce(), and setIntervalFor().

◆ wallclockTimer_

edm::WallclockTimer edmtest::ConcurrentIOVESSource::wallclockTimer_
private

Definition at line 59 of file ConcurrentIOVESSource.cc.

Referenced by ConcurrentIOVESSource(), produce(), and produceA().