CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
edm::eventsetup::EventSetupProvider Class Reference

#include <EventSetupProvider.h>

Public Types

typedef std::pair< DataType,
DataLabel
DataKeyInfo
 
typedef std::string DataLabel
 
typedef std::string DataType
 
typedef std::map
< ComponentDescription,
RecordToDataMap
PreferredProviderInfo
 
typedef std::string RecordName
 
typedef std::multimap
< RecordName, DataKeyInfo
RecordToDataMap
 

Public Member Functions

void add (std::shared_ptr< DataProxyProvider >)
 
void add (std::shared_ptr< EventSetupRecordIntervalFinder >)
 
void addRecord (const EventSetupRecordKey &iKey)
 Intended for use only in tests. More...
 
void checkESProducerSharing (EventSetupProvider &precedingESProvider, std::set< ParameterSetIDHolder > &sharingCheckDone, std::map< EventSetupRecordKey, std::vector< ComponentDescription const * >> &referencedESProducers, EventSetupsController &esController)
 
void clearInitializationData ()
 
bool doRecordsMatch (EventSetupProvider &precedingESProvider, EventSetupRecordKey const &eventSetupRecordKey, std::map< EventSetupRecordKey, bool > &allComponentsMatch, EventSetupsController const &esController)
 
bool doWeNeedToWaitForIOVsToFinish (IOVSyncValue const &) const
 
std::shared_ptr< const
EventSetupImpl
eventSetupForInstance (IOVSyncValue const &, bool &newEventSetupImpl)
 
EventSetupImpl const & eventSetupImpl () const
 
 EventSetupProvider (ActivityRegistry const *, unsigned subProcessIndex=0U, PreferredProviderInfo const *iInfo=nullptr)
 
 EventSetupProvider (EventSetupProvider const &)=delete
 
void fillKeys (std::set< EventSetupRecordKey > &keys) const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
void fillReferencedDataKeys (EventSetupRecordKey const &eventSetupRecordKey)
 
void finishConfiguration (NumberOfConcurrentIOVs const &, bool &hasNonconcurrentFinder)
 
void forceCacheClear ()
 Used when testing that all code properly updates on IOV changes of all Records. More...
 
EventSetupProvider const & operator= (EventSetupProvider const &)=delete
 
std::set< ComponentDescriptionproxyProviderDescriptions () const
 
ESRecordsToProxyIndices recordsToProxyIndices () const
 
void replaceExisting (std::shared_ptr< DataProxyProvider >)
 
void resetRecordPlusDependentRecords (EventSetupRecordKey const &)
 Used when we need to force a Record to reset all its proxies. More...
 
void resetRecordToProxyPointers ()
 
void setAllValidityIntervals (const IOVSyncValue &iValue)
 Set the validity intervals in all EventSetupRecordProviders. More...
 
void setPreferredProviderInfo (PreferredProviderInfo const &iInfo)
 
unsigned subProcessIndex () const
 
EventSetupRecordProvidertryToGetRecordProvider (const EventSetupRecordKey &iKey)
 
 ~EventSetupProvider ()
 

Static Public Member Functions

static void logInfoWhenSharing (ParameterSet const &iConfiguration)
 

Private Types

using RecordKeys = std::vector< EventSetupRecordKey >
 
using RecordProviders = std::vector< std::shared_ptr< EventSetupRecordProvider >>
 

Private Member Functions

void determinePreferred ()
 
void insert (EventSetupRecordKey const &, std::unique_ptr< EventSetupRecordProvider >)
 
std::shared_ptr
< EventSetupRecordProvider > & 
recordProvider (const EventSetupRecordKey &iKey)
 

Private Attributes

ActivityRegistry const * activityRegistry_
 
std::unique_ptr< std::vector
< std::shared_ptr
< DataProxyProvider > > > 
dataProviders_
 
propagate_const
< std::shared_ptr
< EventSetupImpl > > 
eventSetupImpl_
 
std::unique_ptr< std::vector
< std::shared_ptr
< EventSetupRecordIntervalFinder > > > 
finders_
 
bool mustFinishConfiguration_
 
std::unique_ptr
< PreferredProviderInfo
preferredProviderInfo_
 
std::unique_ptr< std::map
< ParameterSetIDHolder,
std::set< EventSetupRecordKey > > > 
psetIDToRecordKey_
 
RecordKeys recordKeys_
 
RecordProviders recordProviders_
 
std::unique_ptr< std::set
< EventSetupRecordKey > > 
recordsWithALooperProxy_
 
std::unique_ptr< std::map
< EventSetupRecordKey,
std::vector< std::shared_ptr
< EventSetupRecordIntervalFinder > > > > 
recordToFinders_
 
std::unique_ptr< std::map
< EventSetupRecordKey,
std::map< DataKey,
ComponentDescription > > > 
recordToPreferred_
 
std::unique_ptr< std::map
< EventSetupRecordKey,
std::map< DataKey,
ComponentDescription const * > > > 
referencedDataKeys_
 
unsigned subProcessIndex_
 

Detailed Description

Description: Factory for a EventSetup

Usage: <usage>

Definition at line 49 of file EventSetupProvider.h.

Member Typedef Documentation

Definition at line 54 of file EventSetupProvider.h.

Definition at line 53 of file EventSetupProvider.h.

Definition at line 52 of file EventSetupProvider.h.

Definition at line 56 of file EventSetupProvider.h.

Definition at line 130 of file EventSetupProvider.h.

Definition at line 51 of file EventSetupProvider.h.

Definition at line 133 of file EventSetupProvider.h.

Definition at line 55 of file EventSetupProvider.h.

Constructor & Destructor Documentation

edm::eventsetup::EventSetupProvider::EventSetupProvider ( ActivityRegistry const *  activityRegistry,
unsigned  subProcessIndex = 0U,
PreferredProviderInfo const *  iInfo = nullptr 
)

Definition at line 41 of file EventSetupProvider.cc.

44  : activityRegistry_(activityRegistry),
47  preferredProviderInfo_((nullptr != iInfo) ? (new PreferredProviderInfo(*iInfo)) : nullptr),
48  finders_(new std::vector<std::shared_ptr<EventSetupRecordIntervalFinder>>()),
49  dataProviders_(new std::vector<std::shared_ptr<DataProxyProvider>>()),
50  referencedDataKeys_(new std::map<EventSetupRecordKey, std::map<DataKey, ComponentDescription const*>>),
52  new std::map<EventSetupRecordKey, std::vector<std::shared_ptr<EventSetupRecordIntervalFinder>>>),
53  psetIDToRecordKey_(new std::map<ParameterSetIDHolder, std::set<EventSetupRecordKey>>),
54  recordToPreferred_(new std::map<EventSetupRecordKey, std::map<DataKey, ComponentDescription>>),
55  recordsWithALooperProxy_(new std::set<EventSetupRecordKey>) {}
std::unique_ptr< std::map< ParameterSetIDHolder, std::set< EventSetupRecordKey > > > psetIDToRecordKey_
std::unique_ptr< std::map< EventSetupRecordKey, std::map< DataKey, ComponentDescription const * > > > referencedDataKeys_
std::map< ComponentDescription, RecordToDataMap > PreferredProviderInfo
std::unique_ptr< std::set< EventSetupRecordKey > > recordsWithALooperProxy_
std::unique_ptr< std::vector< std::shared_ptr< EventSetupRecordIntervalFinder > > > finders_
ActivityRegistry const * activityRegistry_
std::unique_ptr< PreferredProviderInfo > preferredProviderInfo_
std::unique_ptr< std::vector< std::shared_ptr< DataProxyProvider > > > dataProviders_
std::unique_ptr< std::map< EventSetupRecordKey, std::vector< std::shared_ptr< EventSetupRecordIntervalFinder > > > > recordToFinders_
std::unique_ptr< std::map< EventSetupRecordKey, std::map< DataKey, ComponentDescription > > > recordToPreferred_
edm::eventsetup::EventSetupProvider::EventSetupProvider ( EventSetupProvider const &  )
delete
edm::eventsetup::EventSetupProvider::~EventSetupProvider ( )

Definition at line 57 of file EventSetupProvider.cc.

References forceCacheClear().

57 { forceCacheClear(); }
void forceCacheClear()
Used when testing that all code properly updates on IOV changes of all Records.

Member Function Documentation

void edm::eventsetup::EventSetupProvider::add ( std::shared_ptr< DataProxyProvider iProvider)
void edm::eventsetup::EventSetupProvider::add ( std::shared_ptr< EventSetupRecordIntervalFinder iFinder)

Definition at line 106 of file EventSetupProvider.cc.

References cms::cuda::assert(), and finders_.

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

106  {
107  assert(iFinder.get() != nullptr);
108  finders_->push_back(iFinder);
109  }
assert(be >=bs)
std::unique_ptr< std::vector< std::shared_ptr< EventSetupRecordIntervalFinder > > > finders_
void edm::eventsetup::EventSetupProvider::addRecord ( const EventSetupRecordKey iKey)

Intended for use only in tests.

Definition at line 740 of file EventSetupProvider.cc.

References eventSetupImpl_, insert(), and recordKeys_.

740  {
741  insert(iKey, std::unique_ptr<EventSetupRecordProvider>());
742  eventSetupImpl_->setKeyIters(recordKeys_.begin(), recordKeys_.end());
743  }
propagate_const< std::shared_ptr< EventSetupImpl > > eventSetupImpl_
void insert(EventSetupRecordKey const &, std::unique_ptr< EventSetupRecordProvider >)
void edm::eventsetup::EventSetupProvider::checkESProducerSharing ( EventSetupProvider precedingESProvider,
std::set< ParameterSetIDHolder > &  sharingCheckDone,
std::map< EventSetupRecordKey, std::vector< ComponentDescription const * >> &  referencedESProducers,
EventSetupsController esController 
)

Definition at line 396 of file EventSetupProvider.cc.

References cms::cuda::assert(), doRecordsMatch(), edm::eventsetup::ComponentFactory< T >::get(), edm::eventsetup::EventSetupsController::getESProducerPSet(), edm::eventsetup::EventSetupsController::isFirstMatch(), edm::eventsetup::EventSetupsController::isLastMatch(), submitPVResolutionJobs::key, logInfoWhenSharing(), edm::eventsetup::EventSetupsController::lookForMatches(), edm::match(), TrackValidation_cff::pset, psetIDToRecordKey_, recordProvider(), recordProviders_, subProcessIndex(), and subProcessIndex_.

400  {
401  edm::LogVerbatim("EventSetupSharing")
402  << "EventSetupProvider::checkESProducerSharing: Checking processes with SubProcess Indexes "
403  << subProcessIndex() << " and " << precedingESProvider.subProcessIndex();
404 
405  if (referencedESProducers.empty()) {
406  for (auto& recProvider : recordProviders_) {
407  recProvider->getReferencedESProducers(referencedESProducers);
408  }
409  }
410 
411  // This records whether the configurations of all the DataProxyProviders
412  // and finders matches for a particular pair of processes and
413  // a particular record and also the records it depends on.
414  std::map<EventSetupRecordKey, bool> allComponentsMatch;
415 
416  std::map<ParameterSetID, bool> candidateNotRejectedYet;
417 
418  // Loop over all the ESProducers which have a DataProxy
419  // referenced by any EventSetupRecord in this EventSetupProvider
420  for (auto const& iRecord : referencedESProducers) {
421  for (auto const& iComponent : iRecord.second) {
422  ParameterSetID const& psetID = iComponent->pid_;
423  ParameterSetIDHolder psetIDHolder(psetID);
424  if (sharingCheckDone.find(psetIDHolder) != sharingCheckDone.end())
425  continue;
426 
427  bool firstProcessWithThisPSet = false;
428  bool precedingHasMatchingPSet = false;
429 
430  esController.lookForMatches(psetID,
432  precedingESProvider.subProcessIndex_,
433  firstProcessWithThisPSet,
434  precedingHasMatchingPSet);
435 
436  if (firstProcessWithThisPSet) {
437  sharingCheckDone.insert(psetIDHolder);
438  allComponentsMatch[iRecord.first] = false;
439  continue;
440  }
441 
442  if (!precedingHasMatchingPSet) {
443  allComponentsMatch[iRecord.first] = false;
444  continue;
445  }
446 
447  // An ESProducer that survives to this point is a candidate.
448  // It was shared with some other process in the first pass where
449  // ESProducers were constructed and one of three possibilities exists:
450  // 1) It should not have been shared and a new ESProducer needs
451  // to be created and the proper pointers set.
452  // 2) It should have been shared with a different preceding process
453  // in which case some pointers need to be modified.
454  // 3) It was originally shared which the correct prior process
455  // in which case nothing needs to be done, but we do need to
456  // do some work to verify that.
457  // Make an entry in a map for each of these ESProducers. We
458  // will set the value to false if and when we determine
459  // the ESProducer cannot be shared between this pair of processes.
460  auto iCandidateNotRejectedYet = candidateNotRejectedYet.find(psetID);
461  if (iCandidateNotRejectedYet == candidateNotRejectedYet.end()) {
462  candidateNotRejectedYet[psetID] = true;
463  iCandidateNotRejectedYet = candidateNotRejectedYet.find(psetID);
464  }
465 
466  // At this point we know that the two processes both
467  // have an ESProducer matching the type and label in
468  // iComponent and also with exactly the same configuration.
469  // And there was not an earlier preceding process
470  // where the same instance of the ESProducer could
471  // have been shared. And this ESProducer was referenced
472  // by the later process's EventSetupRecord (preferred or
473  // or just the only thing that could have made the data).
474  // To determine if sharing is allowed, now we need to
475  // check if all the DataProxyProviders and all the
476  // finders are the same for this record and also for
477  // all records this record depends on. And even
478  // if this is true, we have to wait until the loop
479  // ends because some other DataProxy associated with
480  // the ESProducer could write to a different record where
481  // the same determination will need to be repeated. Only if
482  // all of the the DataProxy's can be shared, can the ESProducer
483  // instance be shared across processes.
484 
485  if (iCandidateNotRejectedYet->second == true) {
486  auto iAllComponentsMatch = allComponentsMatch.find(iRecord.first);
487  if (iAllComponentsMatch == allComponentsMatch.end()) {
488  // We do not know the value in AllComponents yet and
489  // we need it now so we have to do the difficult calculation
490  // now.
491  bool match = doRecordsMatch(precedingESProvider, iRecord.first, allComponentsMatch, esController);
492  allComponentsMatch[iRecord.first] = match;
493  iAllComponentsMatch = allComponentsMatch.find(iRecord.first);
494  }
495  if (!iAllComponentsMatch->second) {
496  iCandidateNotRejectedYet->second = false;
497  }
498  }
499  } // end loop over components used by record
500  } // end loop over records
501 
502  // Loop over candidates
503  for (auto const& candidate : candidateNotRejectedYet) {
504  ParameterSetID const& psetID = candidate.first;
505  bool canBeShared = candidate.second;
506  if (canBeShared) {
507  ParameterSet const& pset = *esController.getESProducerPSet(psetID, subProcessIndex_);
508  logInfoWhenSharing(pset);
509  ParameterSetIDHolder psetIDHolder(psetID);
510  sharingCheckDone.insert(psetIDHolder);
511  if (esController.isFirstMatch(psetID, subProcessIndex_, precedingESProvider.subProcessIndex_)) {
512  continue; // Proper sharing was already done. Nothing more to do.
513  }
514 
515  // Need to reset the pointer from the EventSetupRecordProvider to the
516  // the DataProxyProvider so these two processes share an ESProducer.
517 
518  std::shared_ptr<DataProxyProvider> dataProxyProvider;
519  std::set<EventSetupRecordKey> const& keysForPSetID1 = (*precedingESProvider.psetIDToRecordKey_)[psetIDHolder];
520  for (auto const& key : keysForPSetID1) {
521  dataProxyProvider = precedingESProvider.recordProvider(key)->proxyProvider(psetIDHolder);
522  assert(dataProxyProvider);
523  break;
524  }
525 
526  std::set<EventSetupRecordKey> const& keysForPSetID2 = (*psetIDToRecordKey_)[psetIDHolder];
527  for (auto const& key : keysForPSetID2) {
528  recordProvider(key)->resetProxyProvider(psetIDHolder, dataProxyProvider);
529  }
530  } else {
531  if (esController.isLastMatch(psetID, subProcessIndex_, precedingESProvider.subProcessIndex_)) {
532  ParameterSet const& pset = *esController.getESProducerPSet(psetID, subProcessIndex_);
533  ModuleFactory::get()->addTo(esController, *this, pset, true);
534  }
535  }
536  }
537  }
void lookForMatches(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex, bool &firstProcessWithThisPSet, bool &precedingHasMatchingPSet) const
Log< level::Info, true > LogVerbatim
bool isFirstMatch(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
std::unique_ptr< std::map< ParameterSetIDHolder, std::set< EventSetupRecordKey > > > psetIDToRecordKey_
bool isLastMatch(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
assert(be >=bs)
ParameterSet const * getESProducerPSet(ParameterSetID const &psetID, unsigned subProcessIndex) const
std::shared_ptr< EventSetupRecordProvider > & recordProvider(const EventSetupRecordKey &iKey)
static void logInfoWhenSharing(ParameterSet const &iConfiguration)
tuple key
prepare the HTCondor submission files and eventually submit them
Hash< ParameterSetType > ParameterSetID
bool doRecordsMatch(EventSetupProvider &precedingESProvider, EventSetupRecordKey const &eventSetupRecordKey, std::map< EventSetupRecordKey, bool > &allComponentsMatch, EventSetupsController const &esController)
static ComponentFactory< T > const * get()
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
void edm::eventsetup::EventSetupProvider::clearInitializationData ( )

Definition at line 646 of file EventSetupProvider.cc.

References preferredProviderInfo_, psetIDToRecordKey_, recordsWithALooperProxy_, recordToFinders_, recordToPreferred_, and referencedDataKeys_.

646  {
647  preferredProviderInfo_.reset();
648  referencedDataKeys_.reset();
649  recordToFinders_.reset();
650  psetIDToRecordKey_.reset();
651  recordToPreferred_.reset();
652  recordsWithALooperProxy_.reset();
653  }
std::unique_ptr< std::map< ParameterSetIDHolder, std::set< EventSetupRecordKey > > > psetIDToRecordKey_
std::unique_ptr< std::map< EventSetupRecordKey, std::map< DataKey, ComponentDescription const * > > > referencedDataKeys_
std::unique_ptr< std::set< EventSetupRecordKey > > recordsWithALooperProxy_
std::unique_ptr< PreferredProviderInfo > preferredProviderInfo_
std::unique_ptr< std::map< EventSetupRecordKey, std::vector< std::shared_ptr< EventSetupRecordIntervalFinder > > > > recordToFinders_
std::unique_ptr< std::map< EventSetupRecordKey, std::map< DataKey, ComponentDescription > > > recordToPreferred_
void edm::eventsetup::EventSetupProvider::determinePreferred ( )
private

Definition at line 161 of file EventSetupProvider.cc.

References makeMuonMisalignmentScenario::components, edm::eventsetup::DataProxyProvider::KeyedProxies::contains(), Exception, edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::eventsetup::preferEverything(), preferredProviderInfo_, edm::eventsetup::EventSetupRecordProvider::proxyProvider(), edm::eventsetup::EventSetupRecordProvider::proxyProviderDescriptions(), align_cfg::recordName, recordProvider(), recordProviders_, recordToPreferred_, AlCaHLTBitMon_QueryRunRegistry::string, and edm::eventsetup::EventSetupRecordKey::type().

Referenced by finishConfiguration().

161  {
162  using namespace edm::eventsetup;
164  for (auto const& itInfo : *preferredProviderInfo_) {
165  if (itInfo.second.empty()) {
166  //want everything
168  } else {
169  for (auto const& itRecData : itInfo.second) {
170  std::string recordName = itRecData.first;
172  if (recordKey.type() == eventsetup::EventSetupRecordKey::TypeTag()) {
173  throw cms::Exception("ESPreferUnknownRecord")
174  << "Unknown record \"" << recordName
175  << "\" used in es_prefer statement for type=" << itInfo.first.type_ << " label=\""
176  << itInfo.first.label_ << "\"\n Please check spelling.";
177  //record not found
178  }
179  //See if the ProxyProvider provides something for this Record
180  EventSetupRecordProvider& recordProviderForKey = *recordProvider(recordKey);
181 
182  std::set<ComponentDescription> components = recordProviderForKey.proxyProviderDescriptions();
183  std::set<ComponentDescription>::iterator itProxyProv = components.find(itInfo.first);
184  if (itProxyProv == components.end()) {
185  throw cms::Exception("ESPreferWrongRecord")
186  << "The type=" << itInfo.first.type_ << " label=\"" << itInfo.first.label_
187  << "\" does not provide data for the Record " << recordName;
188  }
189  //Does it data type exist?
190  eventsetup::TypeTag datumType = eventsetup::TypeTag::findType(itRecData.second.first);
191  if (datumType == eventsetup::TypeTag()) {
192  //not found
193  throw cms::Exception("ESPreferWrongDataType")
194  << "The es_prefer statement for type=" << itInfo.first.type_ << " label=\"" << itInfo.first.label_
195  << "\" has the unknown data type \"" << itRecData.second.first << "\""
196  << "\n Please check spelling";
197  }
198  eventsetup::DataKey datumKey(datumType, itRecData.second.second.c_str());
199 
200  //Does the proxyprovider make this?
201  std::shared_ptr<DataProxyProvider> proxyProv = recordProviderForKey.proxyProvider(*itProxyProv);
202  unsigned int iovIndex = 0; // Doesn't matter which index is picked, at least 1 should always exist
203  const DataProxyProvider::KeyedProxies& keyedProxies = proxyProv->keyedProxies(recordKey, iovIndex);
204  if (!keyedProxies.contains(datumKey)) {
205  throw cms::Exception("ESPreferWrongData")
206  << "The es_prefer statement for type=" << itInfo.first.type_ << " label=\"" << itInfo.first.label_
207  << "\" specifies the data item \n"
208  << " type=\"" << itRecData.second.first << "\" label=\"" << itRecData.second.second << "\""
209  << " which is not provided. Please check spelling.";
210  }
211 
213  (*recordToPreferred_)[recordKey];
214  //has another provider already been specified?
215  if (dataToProviderMap.end() != dataToProviderMap.find(datumKey)) {
216  EventSetupRecordProvider::DataToPreferredProviderMap::iterator itFind =
217  dataToProviderMap.find(datumKey);
218  throw cms::Exception("ESPreferConflict")
219  << "Two providers have been set to be preferred for\n"
220  << datumKey.type().name() << " \"" << datumKey.name().value() << "\""
221  << "\n the providers are "
222  << "\n 1) type=" << itFind->second.type_ << " label=\"" << itFind->second.label_ << "\""
223  << "\n 2) type=" << itProxyProv->type_ << " label=\"" << itProxyProv->label_ << "\""
224  << "\nPlease modify configuration so only one is preferred";
225  }
226  dataToProviderMap.insert(std::make_pair(datumKey, *itProxyProv));
227  }
228  }
229  }
230  }
231  }
std::set< ComponentDescription > proxyProviderDescriptions() const
return information on which DataProxyProviders are supplying information
tuple recordName
Definition: align_cfg.py:66
std::shared_ptr< EventSetupRecordProvider > & recordProvider(const EventSetupRecordKey &iKey)
heterocontainer::HCTypeTag TypeTag
Definition: DataKeyTags.h:30
static void preferEverything(const ComponentDescription &iComponent, const RecordProviders &iRecordProviders, RecordToPreferred &iReturnValue)
find everything made by a DataProxyProvider and add it to the &#39;preferred&#39; list
std::shared_ptr< DataProxyProvider > proxyProvider(ComponentDescription const &)
returns the first matching DataProxyProvider or a &#39;null&#39; if not found
std::unique_ptr< PreferredProviderInfo > preferredProviderInfo_
bool contains(DataKey const &dataKey) const
std::map< DataKey, ComponentDescription > DataToPreferredProviderMap
heterocontainer::HCTypeTag TypeTag
std::unique_ptr< std::map< EventSetupRecordKey, std::map< DataKey, ComponentDescription > > > recordToPreferred_
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:121
bool edm::eventsetup::EventSetupProvider::doRecordsMatch ( EventSetupProvider precedingESProvider,
EventSetupRecordKey const &  eventSetupRecordKey,
std::map< EventSetupRecordKey, bool > &  allComponentsMatch,
EventSetupsController const &  esController 
)

Definition at line 539 of file EventSetupProvider.cc.

References edm::eventsetup::EventSetupRecordProvider::dependentRecords(), fillReferencedDataKeys(), edm::eventsetup::EventSetupsController::isMatchingESProducer(), edm::eventsetup::EventSetupsController::isMatchingESSource(), edm::match(), recordsWithALooperProxy_, recordToFinders_, referencedDataKeys_, findQualityFiles::size, subProcessIndex_, and tryToGetRecordProvider().

Referenced by checkESProducerSharing().

542  {
543  // first check if this record matches. If not just return false
544 
545  // then find the directly dependent records and iterate over them
546  // recursively call this function on them. If they return false
547  // set allComponentsMatch to false for them and return false.
548  // if they all return true then set allComponents to true
549  // and return true.
550 
551  if (precedingESProvider.recordsWithALooperProxy_->find(eventSetupRecordKey) !=
552  precedingESProvider.recordsWithALooperProxy_->end()) {
553  return false;
554  }
555 
556  if ((*recordToFinders_)[eventSetupRecordKey].size() !=
557  (*precedingESProvider.recordToFinders_)[eventSetupRecordKey].size()) {
558  return false;
559  }
560 
561  for (auto const& finder : (*recordToFinders_)[eventSetupRecordKey]) {
562  ParameterSetID const& psetID = finder->descriptionForFinder().pid_;
563  bool itMatches =
564  esController.isMatchingESSource(psetID, subProcessIndex_, precedingESProvider.subProcessIndex_);
565  if (!itMatches) {
566  return false;
567  }
568  }
569 
570  fillReferencedDataKeys(eventSetupRecordKey);
571  precedingESProvider.fillReferencedDataKeys(eventSetupRecordKey);
572 
573  std::map<DataKey, ComponentDescription const*> const& dataItems = (*referencedDataKeys_)[eventSetupRecordKey];
574 
575  std::map<DataKey, ComponentDescription const*> const& precedingDataItems =
576  (*precedingESProvider.referencedDataKeys_)[eventSetupRecordKey];
577 
578  if (dataItems.size() != precedingDataItems.size()) {
579  return false;
580  }
581 
582  for (auto const& dataItem : dataItems) {
583  auto precedingDataItem = precedingDataItems.find(dataItem.first);
584  if (precedingDataItem == precedingDataItems.end()) {
585  return false;
586  }
587  if (dataItem.second->pid_ != precedingDataItem->second->pid_) {
588  return false;
589  }
590  // Check that the configurations match exactly for the ESProducers
591  // (We already checked the ESSources above and there should not be
592  // any loopers)
593  if (!dataItem.second->isSource_ && !dataItem.second->isLooper_) {
594  bool itMatches = esController.isMatchingESProducer(
595  dataItem.second->pid_, subProcessIndex_, precedingESProvider.subProcessIndex_);
596  if (!itMatches) {
597  return false;
598  }
599  }
600  }
601  EventSetupRecordProvider* recProvider = tryToGetRecordProvider(eventSetupRecordKey);
602  if (recProvider != nullptr) {
603  std::set<EventSetupRecordKey> dependentRecords = recProvider->dependentRecords();
604  for (auto const& dependentRecord : dependentRecords) {
605  auto iter = allComponentsMatch.find(dependentRecord);
606  if (iter != allComponentsMatch.end()) {
607  if (iter->second) {
608  continue;
609  } else {
610  return false;
611  }
612  }
613  bool match = doRecordsMatch(precedingESProvider, dependentRecord, allComponentsMatch, esController);
614  allComponentsMatch[dependentRecord] = match;
615  if (!match)
616  return false;
617  }
618  }
619  return true;
620  }
std::set< EventSetupRecordKey > dependentRecords() const
Returns the list of Records the provided Record depends on (usually none)
std::unique_ptr< std::map< EventSetupRecordKey, std::map< DataKey, ComponentDescription const * > > > referencedDataKeys_
EventSetupRecordProvider * tryToGetRecordProvider(const EventSetupRecordKey &iKey)
void fillReferencedDataKeys(EventSetupRecordKey const &eventSetupRecordKey)
std::unique_ptr< std::set< EventSetupRecordKey > > recordsWithALooperProxy_
Hash< ParameterSetType > ParameterSetID
std::unique_ptr< std::map< EventSetupRecordKey, std::vector< std::shared_ptr< EventSetupRecordIntervalFinder > > > > recordToFinders_
bool doRecordsMatch(EventSetupProvider &precedingESProvider, EventSetupRecordKey const &eventSetupRecordKey, std::map< EventSetupRecordKey, bool > &allComponentsMatch, EventSetupsController const &esController)
tuple size
Write out results.
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
bool edm::eventsetup::EventSetupProvider::doWeNeedToWaitForIOVsToFinish ( IOVSyncValue const &  iValue) const

Definition at line 714 of file EventSetupProvider.cc.

References recordProviders_.

714  {
715  for (auto& recProvider : recordProviders_) {
716  if (recProvider->doWeNeedToWaitForIOVsToFinish(iValue)) {
717  return true;
718  }
719  }
720  return false;
721  }
std::shared_ptr< const EventSetupImpl > edm::eventsetup::EventSetupProvider::eventSetupForInstance ( IOVSyncValue const &  iValue,
bool &  newEventSetupImpl 
)

Definition at line 675 of file EventSetupProvider.cc.

References eventSetupImpl_, edm::get_underlying_safe(), DetStateFilter::Invalid, recordKeys_, and recordProviders_.

676  {
677  using IntervalStatus = EventSetupRecordProvider::IntervalStatus;
678 
679  // It is important to understand that eventSetupForInstance is a function
680  // where only one call is executing at a time (not multiple calls running
681  // concurrently). These calls are made in the order determined by the
682  // InputSource. One invocation completes and returns before another starts.
683 
684  bool needNewEventSetupImpl = false;
685  if (eventSetupImpl_.get() == nullptr) {
686  needNewEventSetupImpl = true;
687  } else {
688  for (auto& recProvider : recordProviders_) {
689  if (recProvider->intervalStatus() == IntervalStatus::Invalid) {
690  if (eventSetupImpl_->validRecord(recProvider->key())) {
691  needNewEventSetupImpl = true;
692  }
693  } else {
694  if (recProvider->newIntervalForAnySubProcess()) {
695  needNewEventSetupImpl = true;
696  }
697  }
698  }
699  }
700 
701  if (needNewEventSetupImpl) {
702  //cannot use make_shared because constructor is private
703  eventSetupImpl_ = std::shared_ptr<EventSetupImpl>(new EventSetupImpl());
704  newEventSetupImpl = true;
705  eventSetupImpl_->setKeyIters(recordKeys_.begin(), recordKeys_.end());
706 
707  for (auto& recProvider : recordProviders_) {
708  recProvider->setEventSetupImpl(eventSetupImpl_.get());
709  }
710  }
712  }
propagate_const< std::shared_ptr< EventSetupImpl > > eventSetupImpl_
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
EventSetupImpl const& edm::eventsetup::EventSetupProvider::eventSetupImpl ( ) const
inline

Definition at line 77 of file EventSetupProvider.h.

References eventSetupImpl_.

77 { return *eventSetupImpl_; }
propagate_const< std::shared_ptr< EventSetupImpl > > eventSetupImpl_
void edm::eventsetup::EventSetupProvider::fillKeys ( std::set< EventSetupRecordKey > &  keys) const

Definition at line 749 of file EventSetupProvider.cc.

References recordProviders_.

749  {
750  for (auto const& recProvider : recordProviders_) {
751  keys.insert(recProvider->key());
752  }
753  }
void edm::eventsetup::EventSetupProvider::fillRecordsNotAllowingConcurrentIOVs ( std::set< EventSetupRecordKey > &  recordsNotAllowingConcurrentIOVs) const

Definition at line 655 of file EventSetupProvider.cc.

References dataProviders_.

Referenced by edm::eventsetup::NumberOfConcurrentIOVs::fillRecordsNotAllowingConcurrentIOVs().

656  {
657  for (auto const& dataProxyProvider : *dataProviders_) {
658  dataProxyProvider->fillRecordsNotAllowingConcurrentIOVs(recordsNotAllowingConcurrentIOVs);
659  }
660  }
std::unique_ptr< std::vector< std::shared_ptr< DataProxyProvider > > > dataProviders_
void edm::eventsetup::EventSetupProvider::fillReferencedDataKeys ( EventSetupRecordKey const &  eventSetupRecordKey)

Definition at line 622 of file EventSetupProvider.cc.

References edm::eventsetup::EventSetupRecordProvider::fillReferencedDataKeys(), referencedDataKeys_, and tryToGetRecordProvider().

Referenced by doRecordsMatch().

622  {
623  if (referencedDataKeys_->find(eventSetupRecordKey) != referencedDataKeys_->end())
624  return;
625 
626  EventSetupRecordProvider* recProvider = tryToGetRecordProvider(eventSetupRecordKey);
627  if (recProvider == nullptr) {
628  (*referencedDataKeys_)[eventSetupRecordKey];
629  return;
630  }
631  recProvider->fillReferencedDataKeys((*referencedDataKeys_)[eventSetupRecordKey]);
632  }
std::unique_ptr< std::map< EventSetupRecordKey, std::map< DataKey, ComponentDescription const * > > > referencedDataKeys_
void fillReferencedDataKeys(std::map< DataKey, ComponentDescription const * > &referencedDataKeys) const
EventSetupRecordProvider * tryToGetRecordProvider(const EventSetupRecordKey &iKey)
void edm::eventsetup::EventSetupProvider::finishConfiguration ( NumberOfConcurrentIOVs const &  numberOfConcurrentIOVs,
bool &  hasNonconcurrentFinder 
)

Definition at line 233 of file EventSetupProvider.cc.

References activityRegistry_, edm::eventsetup::EventSetupRecordProvider::add(), edm::eventsetup::EventSetupRecordProvider::addFinder(), dataProviders_, determinePreferred(), HLT_FULL_cff::distance, finders_, dqmdumpme::indices, insert(), submitPVResolutionJobs::key, cuda_std::lower_bound(), mustFinishConfiguration_, edm::eventsetup::NumberOfConcurrentIOVs::numberOfConcurrentIOVs(), psetIDToRecordKey_, recordKeys_, recordProviders_, recordsToProxyIndices(), recordsWithALooperProxy_, recordToFinders_, recordToPreferred_, AlCaHLTBitMon_QueryRunRegistry::string, and tryToGetRecordProvider().

234  {
235  //we delayed adding finders to the system till here so that everything would be loaded first
236  recordToFinders_->clear();
237  for (auto& finder : *finders_) {
238  if (!finder->concurrentFinder()) {
239  hasNonconcurrentFinder = true;
240  }
241 
242  const std::set<EventSetupRecordKey> recordsUsing = finder->findingForRecords();
243 
244  for (auto const& key : recordsUsing) {
245  (*recordToFinders_)[key].push_back(finder);
246 
248  if (recProvider == nullptr) {
249  bool printInfoMsg = true;
250  unsigned int nConcurrentIOVs = numberOfConcurrentIOVs.numberOfConcurrentIOVs(key, printInfoMsg);
251 
252  //create a provider for this record
253  insert(key, std::make_unique<EventSetupRecordProvider>(key, activityRegistry_, nConcurrentIOVs));
254  recProvider = tryToGetRecordProvider(key);
255  }
256  recProvider->addFinder(finder);
257  }
258  }
259  //we've transfered our ownership so this is no longer needed
260  finders_.reset();
261 
262  //Now handle providers since sources can also be finders and the sources can delay registering
263  // their Records and therefore could delay setting up their Proxies
264  psetIDToRecordKey_->clear();
265  for (auto& dataProxyProvider : *dataProviders_) {
266  ParameterSetIDHolder psetID(dataProxyProvider->description().pid_);
267 
268  const std::set<EventSetupRecordKey> recordsUsing = dataProxyProvider->usingRecords();
269  for (auto const& key : recordsUsing) {
270  unsigned int nConcurrentIOVs = numberOfConcurrentIOVs.numberOfConcurrentIOVs(key);
271  dataProxyProvider->createKeyedProxies(key, nConcurrentIOVs);
272 
273  if (dataProxyProvider->description().isLooper_) {
274  recordsWithALooperProxy_->insert(key);
275  }
276 
277  (*psetIDToRecordKey_)[psetID].insert(key);
278 
280  if (recProvider == nullptr) {
281  bool printInfoMsg = true;
282  nConcurrentIOVs = numberOfConcurrentIOVs.numberOfConcurrentIOVs(key, printInfoMsg);
283  //create a provider for this record
284  insert(key, std::make_unique<EventSetupRecordProvider>(key, activityRegistry_, nConcurrentIOVs));
285  recProvider = tryToGetRecordProvider(key);
286  }
287  recProvider->add(dataProxyProvider);
288  }
289  }
290 
291  //used for the case where no preferred Providers have been specified for the Record
293 
295 
296  //For each Provider, find all the Providers it depends on. If a dependent Provider
297  // can not be found pass in an empty list
298  //CHANGE: now allow for missing Providers
299  for (auto& itRecordProvider : recordProviders_) {
300  const EventSetupRecordProvider::DataToPreferredProviderMap* preferredInfo = &kEmptyMap;
301  RecordToPreferred::const_iterator itRecordFound = recordToPreferred_->find(itRecordProvider->key());
302  if (itRecordFound != recordToPreferred_->end()) {
303  preferredInfo = &(itRecordFound->second);
304  }
305  //Give it our list of preferred
306  itRecordProvider->usePreferred(*preferredInfo);
307 
308  std::set<EventSetupRecordKey> records = itRecordProvider->dependentRecords();
309  if (!records.empty()) {
310  std::string missingRecords;
311  std::vector<std::shared_ptr<EventSetupRecordProvider>> depProviders;
312  depProviders.reserve(records.size());
313  bool foundAllProviders = true;
314  for (auto const& key : records) {
315  auto lb = std::lower_bound(recordKeys_.begin(), recordKeys_.end(), key);
316  if (lb == recordKeys_.end() || key != *lb) {
317  foundAllProviders = false;
318  if (missingRecords.empty()) {
319  missingRecords = key.name();
320  } else {
321  missingRecords += ", ";
322  missingRecords += key.name();
323  }
324  } else {
325  auto index = std::distance(recordKeys_.begin(), lb);
326  depProviders.push_back(recordProviders_[index]);
327  }
328  }
329 
330  if (!foundAllProviders) {
331  edm::LogInfo("EventSetupDependency")
332  << "The EventSetup record " << itRecordProvider->key().name() << " depends on at least one Record \n ("
333  << missingRecords
334  << ") which is not present in the job."
335  "\n This may lead to an exception begin thrown during event processing.\n If no exception occurs "
336  "during the job than it is usually safe to ignore this message.";
337 
338  //depProviders.clear();
339  //NOTE: should provide a warning
340  }
341 
342  itRecordProvider->setDependentProviders(depProviders);
343  }
344  }
345 
347  for (auto& provider : *dataProviders_) {
348  provider->updateLookup(indices);
349  }
350  dataProviders_.reset();
351 
352  mustFinishConfiguration_ = false;
353  }
std::unique_ptr< std::map< ParameterSetIDHolder, std::set< EventSetupRecordKey > > > psetIDToRecordKey_
void addFinder(std::shared_ptr< EventSetupRecordIntervalFinder >)
For now, only use one finder.
EventSetupRecordProvider * tryToGetRecordProvider(const EventSetupRecordKey &iKey)
void add(std::shared_ptr< DataProxyProvider >)
std::unique_ptr< std::set< EventSetupRecordKey > > recordsWithALooperProxy_
std::unique_ptr< std::vector< std::shared_ptr< EventSetupRecordIntervalFinder > > > finders_
tuple key
prepare the HTCondor submission files and eventually submit them
ActivityRegistry const * activityRegistry_
std::unique_ptr< std::vector< std::shared_ptr< DataProxyProvider > > > dataProviders_
Log< level::Info, false > LogInfo
std::unique_ptr< std::map< EventSetupRecordKey, std::vector< std::shared_ptr< EventSetupRecordIntervalFinder > > > > recordToFinders_
std::map< DataKey, ComponentDescription > DataToPreferredProviderMap
ESRecordsToProxyIndices recordsToProxyIndices() const
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::unique_ptr< std::map< EventSetupRecordKey, std::map< DataKey, ComponentDescription > > > recordToPreferred_
void insert(EventSetupRecordKey const &, std::unique_ptr< EventSetupRecordProvider >)
list indices
Definition: dqmdumpme.py:50
void edm::eventsetup::EventSetupProvider::forceCacheClear ( )

Used when testing that all code properly updates on IOV changes of all Records.

Definition at line 388 of file EventSetupProvider.cc.

References recordProviders_.

Referenced by ~EventSetupProvider().

388  {
389  for (auto& recProvider : recordProviders_) {
390  if (recProvider) {
391  recProvider->resetProxies();
392  }
393  }
394  }
void edm::eventsetup::EventSetupProvider::insert ( EventSetupRecordKey const &  iKey,
std::unique_ptr< EventSetupRecordProvider iProvider 
)
private

Definition at line 78 of file EventSetupProvider.cc.

References HLT_FULL_cff::distance, cuda_std::lower_bound(), eostools::move(), recordKeys_, and recordProviders_.

Referenced by BeautifulSoup.PageElement::_invert(), SequenceTypes.Schedule::_replaceIfHeldDirectly(), addRecord(), and finishConfiguration().

79  {
80  auto lb = std::lower_bound(recordKeys_.begin(), recordKeys_.end(), iKey);
81  auto index = std::distance(recordKeys_.begin(), lb);
82  if (lb == recordKeys_.end() || iKey != *lb) {
83  recordKeys_.insert(lb, iKey);
84  recordProviders_.insert(recordProviders_.begin() + index, std::move(iProvider));
85  } else {
86  recordProviders_[index] = std::move(iProvider);
87  }
88  }
def move
Definition: eostools.py:511
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
void edm::eventsetup::EventSetupProvider::logInfoWhenSharing ( ParameterSet const &  iConfiguration)
static

Definition at line 770 of file EventSetupProvider.cc.

References edm::ParameterSet::getParameter(), label, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by checkESProducerSharing().

770  {
771  std::string edmtype = iConfiguration.getParameter<std::string>("@module_edm_type");
772  std::string modtype = iConfiguration.getParameter<std::string>("@module_type");
773  std::string label = iConfiguration.getParameter<std::string>("@module_label");
774  edm::LogVerbatim("EventSetupSharing")
775  << "Sharing " << edmtype << ": class=" << modtype << " label='" << label << "'";
776  }
Log< level::Info, true > LogVerbatim
char const * label
EventSetupProvider const& edm::eventsetup::EventSetupProvider::operator= ( EventSetupProvider const &  )
delete
std::set< ComponentDescription > edm::eventsetup::EventSetupProvider::proxyProviderDescriptions ( ) const

Definition at line 723 of file EventSetupProvider.cc.

References ztail::d, dataProviders_, AlCaHLTBitMon_ParallelJobs::p, and recordProviders_.

723  {
724  typedef std::set<ComponentDescription> Set;
725  Set descriptions;
726 
727  for (auto const& recProvider : recordProviders_) {
728  auto const& d = recProvider->proxyProviderDescriptions();
729  descriptions.insert(d.begin(), d.end());
730  }
731  if (dataProviders_.get()) {
732  for (auto const& p : *dataProviders_) {
733  descriptions.insert(p->description());
734  }
735  }
736 
737  return descriptions;
738  }
tuple d
Definition: ztail.py:151
std::unique_ptr< std::vector< std::shared_ptr< DataProxyProvider > > > dataProviders_
std::shared_ptr< EventSetupRecordProvider > & edm::eventsetup::EventSetupProvider::recordProvider ( const EventSetupRecordKey iKey)
private

Definition at line 59 of file EventSetupProvider.cc.

References HLT_FULL_cff::distance, Exception, cuda_std::lower_bound(), recordKeys_, and recordProviders_.

Referenced by checkESProducerSharing(), determinePreferred(), and replaceExisting().

59  {
60  auto lb = std::lower_bound(recordKeys_.begin(), recordKeys_.end(), iKey);
61  if (lb == recordKeys_.end() || iKey != *lb) {
62  throw cms::Exception("LogicError") << "EventSetupProvider::recordProvider Could not find key\n"
63  << "Should be impossible. Please contact Framework developer.\n";
64  }
65  auto index = std::distance(recordKeys_.begin(), lb);
66  return recordProviders_[index];
67  }
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
ESRecordsToProxyIndices edm::eventsetup::EventSetupProvider::recordsToProxyIndices ( ) const

Definition at line 755 of file EventSetupProvider.cc.

References edm::eventsetup::ESRecordsToProxyIndices::dataKeysInRecord(), recordKeys_, recordProviders_, and runTheMatrix::ret.

Referenced by finishConfiguration().

755  {
757 
758  unsigned int index = 0;
759  for (const auto& provider : recordProviders_) {
760  index = ret.dataKeysInRecord(
761  index, provider->key(), provider->registeredDataKeys(), provider->componentsForRegisteredDataKeys());
762  }
763 
764  return ret;
765  }
tuple ret
prodAgent to be discontinued
void edm::eventsetup::EventSetupProvider::replaceExisting ( std::shared_ptr< DataProxyProvider dataProxyProvider)

Definition at line 98 of file EventSetupProvider.cc.

References submitPVResolutionJobs::key, and recordProvider().

Referenced by edm::eventsetup::ModuleMakerTraits::replaceExisting().

98  {
99  ParameterSetIDHolder psetID(dataProxyProvider->description().pid_);
100  std::set<EventSetupRecordKey> const& keysForPSetID = (*psetIDToRecordKey_)[psetID];
101  for (auto const& key : keysForPSetID) {
102  recordProvider(key)->resetProxyProvider(psetID, dataProxyProvider);
103  }
104  }
std::shared_ptr< EventSetupRecordProvider > & recordProvider(const EventSetupRecordKey &iKey)
tuple key
prepare the HTCondor submission files and eventually submit them
void edm::eventsetup::EventSetupProvider::resetRecordPlusDependentRecords ( EventSetupRecordKey const &  iKey)

Used when we need to force a Record to reset all its proxies.

Definition at line 371 of file EventSetupProvider.cc.

References ztail::d, edm::eventsetup::findDependents(), recordProviders_, edm::eventsetup::EventSetupRecordProvider::resetProxies(), tryToGetRecordProvider(), and tier0::unique().

Referenced by edm::EDLooperBase::prepareForNextLoop().

371  {
373  if (recProvider == nullptr) {
374  return;
375  }
376 
377  std::vector<std::shared_ptr<EventSetupRecordProvider>> dependents;
378  findDependents(iKey, recordProviders_.begin(), recordProviders_.end(), dependents);
379 
380  dependents.erase(std::unique(dependents.begin(), dependents.end()), dependents.end());
381 
382  recProvider->resetProxies();
383  for (auto& d : dependents) {
384  d->resetProxies();
385  }
386  }
static void findDependents(const EventSetupRecordKey &iKey, Itr itBegin, Itr itEnd, std::vector< std::shared_ptr< EventSetupRecordProvider >> &oDependents)
void resetProxies()
This will clear the cache&#39;s of all the Proxies so that next time they are called they will run...
def unique
Definition: tier0.py:24
tuple d
Definition: ztail.py:151
EventSetupRecordProvider * tryToGetRecordProvider(const EventSetupRecordKey &iKey)
void edm::eventsetup::EventSetupProvider::resetRecordToProxyPointers ( )

Definition at line 634 of file EventSetupProvider.cc.

References recordProviders_, and recordToPreferred_.

634  {
635  for (auto const& recProvider : recordProviders_) {
637  const EventSetupRecordProvider::DataToPreferredProviderMap* preferredInfo = &kEmptyMap;
638  RecordToPreferred::const_iterator itRecordFound = recordToPreferred_->find(recProvider->key());
639  if (itRecordFound != recordToPreferred_->end()) {
640  preferredInfo = &(itRecordFound->second);
641  }
642  recProvider->resetRecordToProxyPointers(*preferredInfo);
643  }
644  }
std::map< DataKey, ComponentDescription > DataToPreferredProviderMap
std::unique_ptr< std::map< EventSetupRecordKey, std::map< DataKey, ComponentDescription > > > recordToPreferred_
void edm::eventsetup::EventSetupProvider::setAllValidityIntervals ( const IOVSyncValue iValue)

Set the validity intervals in all EventSetupRecordProviders.

Definition at line 662 of file EventSetupProvider.cc.

References recordProviders_.

662  {
663  // First loop sets a flag that helps us to not duplicate calls to the
664  // same EventSetupRecordProvider setting the IOVs. Dependent records
665  // can cause duplicate calls without this protection.
666  for (auto& recProvider : recordProviders_) {
667  recProvider->initializeForNewSyncValue();
668  }
669 
670  for (auto& recProvider : recordProviders_) {
671  recProvider->setValidityIntervalFor(iValue);
672  }
673  }
void edm::eventsetup::EventSetupProvider::setPreferredProviderInfo ( PreferredProviderInfo const &  iInfo)

Definition at line 745 of file EventSetupProvider.cc.

References preferredProviderInfo_.

745  {
746  preferredProviderInfo_ = std::make_unique<PreferredProviderInfo>(iInfo);
747  }
std::unique_ptr< PreferredProviderInfo > preferredProviderInfo_
unsigned edm::eventsetup::EventSetupProvider::subProcessIndex ( ) const
inline

Definition at line 108 of file EventSetupProvider.h.

References subProcessIndex_.

Referenced by checkESProducerSharing().

EventSetupRecordProvider * edm::eventsetup::EventSetupProvider::tryToGetRecordProvider ( const EventSetupRecordKey iKey)

Definition at line 69 of file EventSetupProvider.cc.

References HLT_FULL_cff::distance, cuda_std::lower_bound(), recordKeys_, and recordProviders_.

Referenced by doRecordsMatch(), fillReferencedDataKeys(), finishConfiguration(), and resetRecordPlusDependentRecords().

69  {
70  auto lb = std::lower_bound(recordKeys_.begin(), recordKeys_.end(), iKey);
71  if (lb == recordKeys_.end() || iKey != *lb) {
72  return nullptr;
73  }
74  auto index = std::distance(recordKeys_.begin(), lb);
75  return recordProviders_[index].get();
76  }
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})

Member Data Documentation

ActivityRegistry const* edm::eventsetup::EventSetupProvider::activityRegistry_
private

Definition at line 136 of file EventSetupProvider.h.

Referenced by add(), and finishConfiguration().

std::unique_ptr<std::vector<std::shared_ptr<DataProxyProvider> > > edm::eventsetup::EventSetupProvider::dataProviders_
private
propagate_const<std::shared_ptr<EventSetupImpl> > edm::eventsetup::EventSetupProvider::eventSetupImpl_
private

Definition at line 140 of file EventSetupProvider.h.

Referenced by addRecord(), eventSetupForInstance(), and eventSetupImpl().

std::unique_ptr<std::vector<std::shared_ptr<EventSetupRecordIntervalFinder> > > edm::eventsetup::EventSetupProvider::finders_
private

Definition at line 145 of file EventSetupProvider.h.

Referenced by add(), and finishConfiguration().

bool edm::eventsetup::EventSetupProvider::mustFinishConfiguration_
private

Definition at line 138 of file EventSetupProvider.h.

Referenced by finishConfiguration().

std::unique_ptr<PreferredProviderInfo> edm::eventsetup::EventSetupProvider::preferredProviderInfo_
private
std::unique_ptr<std::map<ParameterSetIDHolder, std::set<EventSetupRecordKey> > > edm::eventsetup::EventSetupProvider::psetIDToRecordKey_
private
RecordKeys edm::eventsetup::EventSetupProvider::recordKeys_
private
RecordProviders edm::eventsetup::EventSetupProvider::recordProviders_
private
std::unique_ptr<std::set<EventSetupRecordKey> > edm::eventsetup::EventSetupProvider::recordsWithALooperProxy_
private
std::unique_ptr<std::map<EventSetupRecordKey, std::vector<std::shared_ptr<EventSetupRecordIntervalFinder> > > > edm::eventsetup::EventSetupProvider::recordToFinders_
private
std::unique_ptr<std::map<EventSetupRecordKey, std::map<DataKey, ComponentDescription> > > edm::eventsetup::EventSetupProvider::recordToPreferred_
private
std::unique_ptr<std::map<EventSetupRecordKey, std::map<DataKey, ComponentDescription const*> > > edm::eventsetup::EventSetupProvider::referencedDataKeys_
private
unsigned edm::eventsetup::EventSetupProvider::subProcessIndex_
private

Definition at line 139 of file EventSetupProvider.h.

Referenced by checkESProducerSharing(), doRecordsMatch(), and subProcessIndex().