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
 
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
 
ESProducer const & operator= (const 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
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 >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &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:163
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 138 of file ConcurrentIOVESSource.cc.

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

138  {
140  std::vector<unsigned int> emptyVector;
141  desc.add<bool>("iovIsRunNotTime", true);
142  desc.add<bool>("concurrentFinder", true);
143  desc.add<bool>("testForceESSourceMode", false);
144  desc.add<bool>("findForRecordA", false);
145  desc.add<std::vector<unsigned int>>("firstValidLumis", emptyVector);
146  desc.add<std::vector<unsigned int>>("invalidLumis", emptyVector);
147  descriptions.addDefault(desc);
148  }
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->iovStartLumi_ = iov.first().luminosityBlockNumber();
117  data->iovEndLumi_ = iov.last().luminosityBlockNumber();
118  data->iovIndex_ = record.iovIndex();
119  data->cacheIdentifier_ = record.cacheIdentifier();
120  return data;
121  }
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 123 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().

123  {
124  edm::ValidityInterval iov = record.validityInterval();
125  if (!testForceESSourceMode_ && record.iovIndex() != 0) {
126  // This criteria should never fail because the EventSetupRecord class
127  // is hard coded to allow only one IOV at a time.
128  throw cms::Exception("TestError")
129  << "ConcurrentIOVESSource::produce, more than one concurrent IOV for type ESTestRecordA!";
130  }
131  edm::LogAbsolute("ConcurrentIOVESSource")
132  << "ConcurrentIOVESSource::produceA startIOV = " << iov.first().luminosityBlockNumber()
133  << " endIOV = " << iov.last().luminosityBlockNumber() << " IOV index = " << record.iovIndex()
134  << " cache identifier = " << record.cacheIdentifier() << " time = " << wallclockTimer_.realTime();
135  return std::make_unique<ESTestDataA>(0);
136  }
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 150 of file ConcurrentIOVESSource.cc.

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

152  {
155 
156  for (auto const& invalidSyncValue : setOfInvalidIOV_) {
157  if (syncValue == invalidSyncValue) {
158  return;
159  }
160  }
161 
162  //if no intervals given, fail immediately
163  if (setOfIOV_.empty()) {
164  return;
165  }
166 
167  std::pair<std::set<edm::IOVSyncValue>::iterator, std::set<edm::IOVSyncValue>::iterator> itFound =
168  setOfIOV_.equal_range(syncValue);
169 
170  if (itFound.first == itFound.second) {
171  if (itFound.first == setOfIOV_.begin()) {
172  //request is before first valid interval, so fail
173  return;
174  }
175  //go back one step
176  --itFound.first;
177  }
179 
180  if (itFound.second != setOfIOV_.end()) {
181  if (iovIsTime_) {
182  endOfInterval = edm::IOVSyncValue(edm::Timestamp(itFound.second->time().value() - 1));
183  } else {
184  endOfInterval = edm::IOVSyncValue(
185  edm::EventID(1, itFound.second->eventID().luminosityBlock() - 1, edm::EventID::maxEventNumber()));
186  }
187  }
188  interval = edm::ValidityInterval(*(itFound.first), endOfInterval);
190  }
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().