CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::eventsetup::EventSetupsController Class Reference

#include <EventSetupsController.h>

Public Member Functions

void clearComponents ()
 
bool doWeNeedToWaitForIOVsToFinish (IOVSyncValue const &) const
 
void endIOVs ()
 
std::multimap< ParameterSetID, ESProducerInfo > const & esproducers () const
 
std::multimap< ParameterSetID, ESSourceInfo > const & essources () const
 
void eventSetupForInstance (IOVSyncValue const &)
 
void eventSetupForInstance (IOVSyncValue const &, WaitingTaskHolder const &taskToStartAfterIOVInit, WaitingTaskList &endIOVWaitingTasks, std::vector< std::shared_ptr< const EventSetupImpl >> &)
 
 EventSetupsController ()
 
 EventSetupsController (EventSetupsController const &)=delete
 
void finishConfiguration ()
 
void forceCacheClear ()
 
std::shared_ptr< DataProxyProvidergetESProducerAndRegisterProcess (ParameterSet const &pset, unsigned subProcessIndex)
 
ParameterSet const * getESProducerPSet (ParameterSetID const &psetID, unsigned subProcessIndex) const
 
std::shared_ptr< EventSetupRecordIntervalFindergetESSourceAndRegisterProcess (ParameterSet const &pset, unsigned subProcessIndex)
 
bool hasNonconcurrentFinder () const
 
unsigned indexOfNextProcess () const
 
bool isFirstMatch (ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
 
bool isLastMatch (ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
 
bool isMatchingESProducer (ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
 
bool isMatchingESSource (ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
 
void lookForMatches (ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex, bool &firstProcessWithThisPSet, bool &precedingHasMatchingPSet) const
 
std::shared_ptr< EventSetupProvidermakeProvider (ParameterSet &, ActivityRegistry *, ParameterSet const *eventSetupPset=nullptr)
 
bool mustFinishConfiguration () const
 
EventSetupsController const & operator= (EventSetupsController const &)=delete
 
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > const & providers () const
 
void putESProducer (ParameterSet const &pset, std::shared_ptr< DataProxyProvider > const &component, unsigned subProcessIndex)
 
void putESSource (ParameterSet const &pset, std::shared_ptr< EventSetupRecordIntervalFinder > const &component, unsigned subProcessIndex)
 
void setMaxConcurrentIOVs (unsigned int nStreams, unsigned int nConcurrentLumis)
 

Private Member Functions

void checkESProducerSharing ()
 
void initializeEventSetupRecordIOVQueues ()
 

Private Attributes

std::multimap< ParameterSetID, ESProducerInfoesproducers_
 
std::multimap< ParameterSetID, ESSourceInfoessources_
 
std::vector< propagate_const< std::unique_ptr< EventSetupRecordIOVQueue > > > eventSetupRecordIOVQueues_
 
bool hasNonconcurrentFinder_ = false
 
bool mustFinishConfiguration_ = true
 
NumberOfConcurrentIOVs numberOfConcurrentIOVs_
 
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_
 

Detailed Description

Description: Manages a group of EventSetups which can share components

Usage: <usage>

Definition at line 79 of file EventSetupsController.h.

Constructor & Destructor Documentation

◆ EventSetupsController() [1/2]

edm::eventsetup::EventSetupsController::EventSetupsController ( )

Definition at line 34 of file EventSetupsController.cc.

34 {}

◆ EventSetupsController() [2/2]

edm::eventsetup::EventSetupsController::EventSetupsController ( EventSetupsController const &  )
delete

Member Function Documentation

◆ checkESProducerSharing()

void edm::eventsetup::EventSetupsController::checkESProducerSharing ( )
private

Definition at line 396 of file EventSetupsController.cc.

396  {
397  // Loop over SubProcesses, skip the top level process.
398  auto esProvider = providers_.begin();
399  auto const esProviderEnd = providers_.end();
400  if (esProvider != esProviderEnd)
401  ++esProvider;
402  for (; esProvider != esProviderEnd; ++esProvider) {
403  // An element is added to this set for each ESProducer
404  // when we have determined which preceding process
405  // this process can share that ESProducer with or
406  // we have determined that it cannot be shared with
407  // any preceding process.
408  // Note the earliest possible preceding process
409  // will be the one selected if there is more than one.
410  std::set<ParameterSetIDHolder> sharingCheckDone;
411 
412  // This will hold an entry for DataProxy's that are
413  // referenced by an EventSetupRecord in this SubProcess.
414  // But only for DataProxy's that are associated with
415  // an ESProducer (not the ones associated with ESSource's
416  // or EDLooper's)
417  std::map<EventSetupRecordKey, std::vector<ComponentDescription const*>> referencedESProducers;
418 
419  // For each EventSetupProvider from a SubProcess, loop over the
420  // EventSetupProviders from the preceding processes (the first
421  // preceding process will be the top level process and the others
422  // SubProcess's)
423  for (auto precedingESProvider = providers_.begin(); precedingESProvider != esProvider; ++precedingESProvider) {
424  (*esProvider)->checkESProducerSharing(**precedingESProvider, sharingCheckDone, referencedESProducers, *this);
425  }
426 
427  (*esProvider)->resetRecordToProxyPointers();
428  }
429  for (auto& eventSetupProvider : providers_) {
430  eventSetupProvider->clearInitializationData();
431  }
432  }

References providers_.

Referenced by finishConfiguration().

◆ clearComponents()

void edm::eventsetup::EventSetupsController::clearComponents ( )

Definition at line 239 of file EventSetupsController.cc.

239  {
240  esproducers_.clear();
241  essources_.clear();
242  }

References esproducers_, and essources_.

Referenced by finishConfiguration().

◆ doWeNeedToWaitForIOVsToFinish()

bool edm::eventsetup::EventSetupsController::doWeNeedToWaitForIOVsToFinish ( IOVSyncValue const &  syncValue) const

Definition at line 170 of file EventSetupsController.cc.

170  {
171  if (hasNonconcurrentFinder()) {
172  for (auto& eventSetupProvider : providers_) {
173  if (eventSetupProvider->doWeNeedToWaitForIOVsToFinish(syncValue)) {
174  return true;
175  }
176  }
177  }
178  return false;
179  }

References hasNonconcurrentFinder(), and providers_.

◆ endIOVs()

void edm::eventsetup::EventSetupsController::endIOVs ( )

Definition at line 36 of file EventSetupsController.cc.

36  {
37  for (auto& eventSetupRecordIOVQueue : eventSetupRecordIOVQueues_) {
38  eventSetupRecordIOVQueue->endIOV();
39  }
40  }

References eventSetupRecordIOVQueues_.

◆ esproducers()

std::multimap<ParameterSetID, ESProducerInfo> const& edm::eventsetup::EventSetupsController::esproducers ( ) const
inline

Definition at line 157 of file EventSetupsController.h.

157 { return esproducers_; }

References esproducers_.

◆ essources()

std::multimap<ParameterSetID, ESSourceInfo> const& edm::eventsetup::EventSetupsController::essources ( ) const
inline

Definition at line 159 of file EventSetupsController.h.

159 { return essources_; }

References essources_.

◆ eventSetupForInstance() [1/2]

void edm::eventsetup::EventSetupsController::eventSetupForInstance ( IOVSyncValue const &  syncValue)

Definition at line 131 of file EventSetupsController.cc.

131  {
132  // This function only supports use cases where the event setup
133  // system is used without multiple concurrent IOVs.
134  // At the time this comment is being written, this is used for
135  // run transitions and in unit test code. In the future,
136  // it may only be needed for unit tests. This function uses
137  // the other version of eventSetupForInstance that
138  // supports concurrent IOVs. To get this to work, a couple
139  // arguments to that function need dummy objects that do
140  // not serve any purpose in this context. We also need to
141  // add in a task to wait for the asynchronous initialization
142  // of IOVs to complete.
143 
144  auto waitUntilIOVInitializationCompletes = make_empty_waiting_task();
145  waitUntilIOVInitializationCompletes->increment_ref_count();
146 
147  // These do nothing ...
148  WaitingTaskList dummyWaitingTaskList;
149  std::vector<std::shared_ptr<const EventSetupImpl>> dummyEventSetupImpls;
150 
151  {
152  WaitingTaskHolder waitingTaskHolder(waitUntilIOVInitializationCompletes.get());
153  // Caught exception is propagated via WaitingTaskHolder
154  CMS_SA_ALLOW try {
155  // All the real work is done here.
156  eventSetupForInstance(syncValue, waitingTaskHolder, dummyWaitingTaskList, dummyEventSetupImpls);
157  dummyWaitingTaskList.doneWaiting(std::exception_ptr{});
158  } catch (...) {
159  dummyWaitingTaskList.doneWaiting(std::exception_ptr{});
160  waitingTaskHolder.doneWaiting(std::current_exception());
161  }
162  }
163  waitUntilIOVInitializationCompletes->wait_for_all();
164 
165  if (waitUntilIOVInitializationCompletes->exceptionPtr() != nullptr) {
166  std::rethrow_exception(*(waitUntilIOVInitializationCompletes->exceptionPtr()));
167  }
168  }

References CMS_SA_ALLOW, edm::WaitingTaskList::doneWaiting(), eventSetupForInstance(), and edm::make_empty_waiting_task().

◆ eventSetupForInstance() [2/2]

void edm::eventsetup::EventSetupsController::eventSetupForInstance ( IOVSyncValue const &  syncValue,
WaitingTaskHolder const &  taskToStartAfterIOVInit,
WaitingTaskList endIOVWaitingTasks,
std::vector< std::shared_ptr< const EventSetupImpl >> &  eventSetupImpls 
)

Definition at line 92 of file EventSetupsController.cc.

96  {
98 
99  bool newEventSetupImpl = false;
100  eventSetupImpls.clear();
101  eventSetupImpls.reserve(providers_.size());
102 
103  // Note that unless there are one or more SubProcesses providers_ will only
104  // contain one element.
105 
106  for (auto& eventSetupProvider : providers_) {
107  eventSetupProvider->setAllValidityIntervals(syncValue);
108  }
109 
110  for (auto& eventSetupRecordIOVQueue : eventSetupRecordIOVQueues_) {
111  // For a particular record, if the top level process or any SubProcess requires
112  // starting a new IOV, then we must start a new IOV for all of them. And we
113  // need to know whether this is needed at this point in time. This is
114  // recorded in the EventSetupRecordProviders.
115  eventSetupRecordIOVQueue->setNewIntervalForAnySubProcess();
116  }
117 
118  for (auto& eventSetupProvider : providers_) {
119  // Decides whether we can reuse the existing EventSetupImpl and if we can
120  // returns it. If a new one is needed it will create it, although the pointers
121  // to the EventSetupRecordImpl's will not be set yet in the returned EventSetupImpl
122  // object.
123  eventSetupImpls.push_back(eventSetupProvider->eventSetupForInstance(syncValue, newEventSetupImpl));
124  }
125 
126  for (auto& eventSetupRecordIOVQueue : eventSetupRecordIOVQueues_) {
127  eventSetupRecordIOVQueue->checkForNewIOVs(taskToStartAfterIOVInit, endIOVWaitingTasks, newEventSetupImpl);
128  }
129  }

References eventSetupRecordIOVQueues_, finishConfiguration(), and providers_.

Referenced by eventSetupForInstance().

◆ finishConfiguration()

void edm::eventsetup::EventSetupsController::finishConfiguration ( )

Definition at line 66 of file EventSetupsController.cc.

66  {
68  for (auto& eventSetupProvider : providers_) {
70  }
71 
72  for (auto& eventSetupProvider : providers_) {
73  eventSetupProvider->finishConfiguration(numberOfConcurrentIOVs_, hasNonconcurrentFinder_);
74  }
75 
76  // When the ESSources and ESProducers were constructed a first pass was
77  // done which attempts to get component sharing between SubProcesses
78  // correct, but in this pass only the configuration of the components
79  // being shared are compared. This is not good enough for ESProducers.
80  // In the following function, all the other components that contribute
81  // to the same record and also the records that record depends on are
82  // also checked. The component sharing is appropriately fixed as necessary.
85 
89  }
90  }

References checkESProducerSharing(), edm::eventsetup::NumberOfConcurrentIOVs::clear(), clearComponents(), edm::eventsetup::NumberOfConcurrentIOVs::fillRecordsNotAllowingConcurrentIOVs(), hasNonconcurrentFinder_, initializeEventSetupRecordIOVQueues(), mustFinishConfiguration_, numberOfConcurrentIOVs_, and providers_.

Referenced by eventSetupForInstance().

◆ forceCacheClear()

void edm::eventsetup::EventSetupsController::forceCacheClear ( )

Definition at line 181 of file EventSetupsController.cc.

181  {
182  for (auto& eventSetupProvider : providers_) {
183  eventSetupProvider->forceCacheClear();
184  }
185  }

References providers_.

◆ getESProducerAndRegisterProcess()

std::shared_ptr< DataProxyProvider > edm::eventsetup::EventSetupsController::getESProducerAndRegisterProcess ( ParameterSet const &  pset,
unsigned  subProcessIndex 
)

Definition at line 187 of file EventSetupsController.cc.

188  {
189  // Try to find a DataProxyProvider with a matching ParameterSet
190  auto elements = esproducers_.equal_range(pset.id());
191  for (auto it = elements.first; it != elements.second; ++it) {
192  // Untracked parameters must also match, do complete comparison if IDs match
193  if (isTransientEqual(pset, *it->second.pset())) {
194  // Register processes with an exact match
195  it->second.subProcessIndexes().push_back(subProcessIndex);
196  // Return the DataProxyProvider
197  return it->second.provider();
198  }
199  }
200  // Could not find it
201  return std::shared_ptr<DataProxyProvider>();
202  }

References bookConverter::elements, esproducers_, edm::isTransientEqual(), and muonDTDigis_cfi::pset.

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

◆ getESProducerPSet()

ParameterSet const * edm::eventsetup::EventSetupsController::getESProducerPSet ( ParameterSetID const &  psetID,
unsigned  subProcessIndex 
) const

Definition at line 378 of file EventSetupsController.cc.

379  {
380  auto elements = esproducers_.equal_range(psetID);
381  for (auto it = elements.first; it != elements.second; ++it) {
382  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
383 
384  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
385  if (iFound == subProcessIndexes.end()) {
386  continue;
387  }
388  return it->second.pset();
389  }
390  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::getESProducerPSet\n"
391  << "Subprocess index not found. This should never happen\n"
392  << "Please report this to a Framework Developer\n";
393  return nullptr;
394  }

References bookConverter::elements, esproducers_, Exception, spr::find(), and edm::errors::LogicError.

Referenced by edm::eventsetup::EventSetupProvider::checkESProducerSharing().

◆ getESSourceAndRegisterProcess()

std::shared_ptr< EventSetupRecordIntervalFinder > edm::eventsetup::EventSetupsController::getESSourceAndRegisterProcess ( ParameterSet const &  pset,
unsigned  subProcessIndex 
)

Definition at line 213 of file EventSetupsController.cc.

214  {
215  // Try to find a EventSetupRecordIntervalFinder with a matching ParameterSet
216  auto elements = essources_.equal_range(pset.id());
217  for (auto it = elements.first; it != elements.second; ++it) {
218  // Untracked parameters must also match, do complete comparison if IDs match
219  if (isTransientEqual(pset, *it->second.pset())) {
220  // Register processes with an exact match
221  it->second.subProcessIndexes().push_back(subProcessIndex);
222  // Return the EventSetupRecordIntervalFinder
223  return it->second.finder();
224  }
225  }
226  // Could not find it
227  return std::shared_ptr<EventSetupRecordIntervalFinder>();
228  }

References bookConverter::elements, essources_, edm::isTransientEqual(), and muonDTDigis_cfi::pset.

Referenced by edm::eventsetup::SourceMakerTraits::getComponentAndRegisterProcess().

◆ hasNonconcurrentFinder()

bool edm::eventsetup::EventSetupsController::hasNonconcurrentFinder ( ) const
inline

Definition at line 161 of file EventSetupsController.h.

161 { return hasNonconcurrentFinder_; }

References hasNonconcurrentFinder_.

Referenced by doWeNeedToWaitForIOVsToFinish().

◆ indexOfNextProcess()

unsigned edm::eventsetup::EventSetupsController::indexOfNextProcess ( ) const
inline

◆ initializeEventSetupRecordIOVQueues()

void edm::eventsetup::EventSetupsController::initializeEventSetupRecordIOVQueues ( )
private

Definition at line 434 of file EventSetupsController.cc.

434  {
435  std::set<EventSetupRecordKey> keys;
436  for (auto const& provider : providers_) {
437  provider->fillKeys(keys);
438  }
439 
440  for (auto const& key : keys) {
441  eventSetupRecordIOVQueues_.push_back(
442  std::make_unique<EventSetupRecordIOVQueue>(numberOfConcurrentIOVs_.numberOfConcurrentIOVs(key)));
443  EventSetupRecordIOVQueue& iovQueue = *eventSetupRecordIOVQueues_.back();
444  for (auto& provider : providers_) {
445  EventSetupRecordProvider* recProvider = provider->tryToGetRecordProvider(key);
446  if (recProvider) {
447  iovQueue.addRecProvider(recProvider);
448  }
449  }
450  }
451  }

References edm::eventsetup::EventSetupRecordIOVQueue::addRecProvider(), eventSetupRecordIOVQueues_, crabWrapper::key, relativeConstraints::keys, edm::eventsetup::NumberOfConcurrentIOVs::numberOfConcurrentIOVs(), numberOfConcurrentIOVs_, and providers_.

Referenced by finishConfiguration().

◆ isFirstMatch()

bool edm::eventsetup::EventSetupsController::isFirstMatch ( ParameterSetID const &  psetID,
unsigned  subProcessIndex,
unsigned  precedingProcessIndex 
) const

Definition at line 278 of file EventSetupsController.cc.

280  {
281  auto elements = esproducers_.equal_range(psetID);
282  for (auto it = elements.first; it != elements.second; ++it) {
283  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
284 
285  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
286  if (iFound == subProcessIndexes.end()) {
287  continue;
288  }
289 
290  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
291  if (iFoundPreceding == iFound) {
292  break;
293  } else {
294  return iFoundPreceding == subProcessIndexes.begin();
295  }
296  }
297  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::isFirstMatch\n"
298  << "Subprocess index not found. This should never happen\n"
299  << "Please report this to a Framework Developer\n";
300  return false;
301  }

References bookConverter::elements, esproducers_, Exception, spr::find(), and edm::errors::LogicError.

Referenced by edm::eventsetup::EventSetupProvider::checkESProducerSharing().

◆ isLastMatch()

bool edm::eventsetup::EventSetupsController::isLastMatch ( ParameterSetID const &  psetID,
unsigned  subProcessIndex,
unsigned  precedingProcessIndex 
) const

Definition at line 303 of file EventSetupsController.cc.

305  {
306  auto elements = esproducers_.equal_range(psetID);
307  for (auto it = elements.first; it != elements.second; ++it) {
308  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
309 
310  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
311  if (iFound == subProcessIndexes.end()) {
312  continue;
313  }
314 
315  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
316  if (iFoundPreceding == iFound) {
317  break;
318  } else {
319  return (++iFoundPreceding) == iFound;
320  }
321  }
322  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::isLastMatch\n"
323  << "Subprocess index not found. This should never happen\n"
324  << "Please report this to a Framework Developer\n";
325  return false;
326  }

References bookConverter::elements, esproducers_, Exception, spr::find(), and edm::errors::LogicError.

Referenced by edm::eventsetup::EventSetupProvider::checkESProducerSharing().

◆ isMatchingESProducer()

bool edm::eventsetup::EventSetupsController::isMatchingESProducer ( ParameterSetID const &  psetID,
unsigned  subProcessIndex,
unsigned  precedingProcessIndex 
) const

Definition at line 353 of file EventSetupsController.cc.

355  {
356  auto elements = esproducers_.equal_range(psetID);
357  for (auto it = elements.first; it != elements.second; ++it) {
358  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
359 
360  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
361  if (iFound == subProcessIndexes.end()) {
362  continue;
363  }
364 
365  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
366  if (iFoundPreceding == iFound) {
367  return false;
368  } else {
369  return true;
370  }
371  }
372  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::lookForMatchingESSource\n"
373  << "Subprocess index not found. This should never happen\n"
374  << "Please report this to a Framework Developer\n";
375  return false;
376  }

References bookConverter::elements, esproducers_, Exception, spr::find(), and edm::errors::LogicError.

Referenced by edm::eventsetup::EventSetupProvider::doRecordsMatch().

◆ isMatchingESSource()

bool edm::eventsetup::EventSetupsController::isMatchingESSource ( ParameterSetID const &  psetID,
unsigned  subProcessIndex,
unsigned  precedingProcessIndex 
) const

Definition at line 328 of file EventSetupsController.cc.

330  {
331  auto elements = essources_.equal_range(psetID);
332  for (auto it = elements.first; it != elements.second; ++it) {
333  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
334 
335  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
336  if (iFound == subProcessIndexes.end()) {
337  continue;
338  }
339 
340  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
341  if (iFoundPreceding == iFound) {
342  return false;
343  } else {
344  return true;
345  }
346  }
347  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::lookForMatchingESSource\n"
348  << "Subprocess index not found. This should never happen\n"
349  << "Please report this to a Framework Developer\n";
350  return false;
351  }

References bookConverter::elements, essources_, Exception, spr::find(), and edm::errors::LogicError.

Referenced by edm::eventsetup::EventSetupProvider::doRecordsMatch().

◆ lookForMatches()

void edm::eventsetup::EventSetupsController::lookForMatches ( ParameterSetID const &  psetID,
unsigned  subProcessIndex,
unsigned  precedingProcessIndex,
bool &  firstProcessWithThisPSet,
bool &  precedingHasMatchingPSet 
) const

Definition at line 244 of file EventSetupsController.cc.

248  {
249  auto elements = esproducers_.equal_range(psetID);
250  for (auto it = elements.first; it != elements.second; ++it) {
251  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
252 
253  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
254  if (iFound == subProcessIndexes.end()) {
255  continue;
256  }
257 
258  if (iFound == subProcessIndexes.begin()) {
259  firstProcessWithThisPSet = true;
260  precedingHasMatchingPSet = false;
261  } else {
262  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
263  if (iFoundPreceding == iFound) {
264  firstProcessWithThisPSet = false;
265  precedingHasMatchingPSet = false;
266  } else {
267  firstProcessWithThisPSet = false;
268  precedingHasMatchingPSet = true;
269  }
270  }
271  return;
272  }
273  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::lookForMatches\n"
274  << "Subprocess index not found. This should never happen\n"
275  << "Please report this to a Framework Developer\n";
276  }

References bookConverter::elements, esproducers_, Exception, spr::find(), and edm::errors::LogicError.

Referenced by edm::eventsetup::EventSetupProvider::checkESProducerSharing().

◆ makeProvider()

std::shared_ptr< EventSetupProvider > edm::eventsetup::EventSetupsController::makeProvider ( ParameterSet iPSet,
ActivityRegistry activityRegistry,
ParameterSet const *  eventSetupPset = nullptr 
)

Definition at line 42 of file EventSetupsController.cc.

44  {
45  // Makes an EventSetupProvider
46  // Also parses the prefer information from ParameterSets and puts
47  // it in a map that is stored in the EventSetupProvider
48  std::shared_ptr<EventSetupProvider> returnValue(
49  makeEventSetupProvider(iPSet, providers_.size(), activityRegistry));
50 
51  // Construct the ESProducers and ESSources
52  // shared_ptrs to them are temporarily stored in this
53  // EventSetupsController and in the EventSetupProvider
54  fillEventSetupProvider(*this, *returnValue, iPSet);
55 
57 
58  providers_.push_back(returnValue);
59  return returnValue;
60  }

References edm::eventsetup::fillEventSetupProvider(), edm::eventsetup::makeEventSetupProvider(), numberOfConcurrentIOVs_, providers_, and edm::eventsetup::NumberOfConcurrentIOVs::readConfigurationParameters().

Referenced by edm::SubProcess::SubProcess().

◆ mustFinishConfiguration()

bool edm::eventsetup::EventSetupsController::mustFinishConfiguration ( ) const
inline

Definition at line 162 of file EventSetupsController.h.

162 { return mustFinishConfiguration_; }

References mustFinishConfiguration_.

◆ operator=()

EventSetupsController const& edm::eventsetup::EventSetupsController::operator= ( EventSetupsController const &  )
delete

◆ providers()

std::vector<propagate_const<std::shared_ptr<EventSetupProvider> > > const& edm::eventsetup::EventSetupsController::providers ( ) const
inline

Definition at line 155 of file EventSetupsController.h.

155 { return providers_; }

References providers_.

◆ putESProducer()

void edm::eventsetup::EventSetupsController::putESProducer ( ParameterSet const &  pset,
std::shared_ptr< DataProxyProvider > const &  component,
unsigned  subProcessIndex 
)

Definition at line 204 of file EventSetupsController.cc.

206  {
207  auto newElement =
208  esproducers_.insert(std::pair<ParameterSetID, ESProducerInfo>(pset.id(), ESProducerInfo(&pset, component)));
209  // Register processes with an exact match
210  newElement->second.subProcessIndexes().push_back(subProcessIndex);
211  }

References esproducers_, and muonDTDigis_cfi::pset.

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

◆ putESSource()

void edm::eventsetup::EventSetupsController::putESSource ( ParameterSet const &  pset,
std::shared_ptr< EventSetupRecordIntervalFinder > const &  component,
unsigned  subProcessIndex 
)

Definition at line 230 of file EventSetupsController.cc.

232  {
233  auto newElement =
234  essources_.insert(std::pair<ParameterSetID, ESSourceInfo>(pset.id(), ESSourceInfo(&pset, component)));
235  // Register processes with an exact match
236  newElement->second.subProcessIndexes().push_back(subProcessIndex);
237  }

References essources_, and muonDTDigis_cfi::pset.

Referenced by edm::eventsetup::SourceMakerTraits::putComponent().

◆ setMaxConcurrentIOVs()

void edm::eventsetup::EventSetupsController::setMaxConcurrentIOVs ( unsigned int  nStreams,
unsigned int  nConcurrentLumis 
)

Member Data Documentation

◆ esproducers_

std::multimap<ParameterSetID, ESProducerInfo> edm::eventsetup::EventSetupsController::esproducers_
private

◆ essources_

std::multimap<ParameterSetID, ESSourceInfo> edm::eventsetup::EventSetupsController::essources_
private

◆ eventSetupRecordIOVQueues_

std::vector<propagate_const<std::unique_ptr<EventSetupRecordIOVQueue> > > edm::eventsetup::EventSetupsController::eventSetupRecordIOVQueues_
private

◆ hasNonconcurrentFinder_

bool edm::eventsetup::EventSetupsController::hasNonconcurrentFinder_ = false
private

Definition at line 189 of file EventSetupsController.h.

Referenced by finishConfiguration(), and hasNonconcurrentFinder().

◆ mustFinishConfiguration_

bool edm::eventsetup::EventSetupsController::mustFinishConfiguration_ = true
private

Definition at line 190 of file EventSetupsController.h.

Referenced by finishConfiguration(), and mustFinishConfiguration().

◆ numberOfConcurrentIOVs_

NumberOfConcurrentIOVs edm::eventsetup::EventSetupsController::numberOfConcurrentIOVs_
private

◆ providers_

std::vector<propagate_const<std::shared_ptr<EventSetupProvider> > > edm::eventsetup::EventSetupsController::providers_
private
edm::eventsetup::EventSetupsController::eventSetupForInstance
void eventSetupForInstance(IOVSyncValue const &, WaitingTaskHolder const &taskToStartAfterIOVInit, WaitingTaskList &endIOVWaitingTasks, std::vector< std::shared_ptr< const EventSetupImpl >> &)
Definition: EventSetupsController.cc:92
edm::errors::LogicError
Definition: EDMException.h:37
edm::eventsetup::EventSetupsController::eventSetupRecordIOVQueues_
std::vector< propagate_const< std::unique_ptr< EventSetupRecordIOVQueue > > > eventSetupRecordIOVQueues_
Definition: EventSetupsController.h:174
edm::eventsetup::makeEventSetupProvider
std::unique_ptr< EventSetupProvider > makeEventSetupProvider(ParameterSet const &params, unsigned subProcessIndex, ActivityRegistry *activityRegistry)
Definition: EventSetupProviderMaker.cc:25
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
runTheMatrix.nStreams
nStreams
Definition: runTheMatrix.py:356
edm::eventsetup::EventSetupsController::providers_
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_
Definition: EventSetupsController.h:169
edm::eventsetup::EventSetupsController::essources_
std::multimap< ParameterSetID, ESSourceInfo > essources_
Definition: EventSetupsController.h:187
WaitingTaskHolder
edm::eventsetup::EventSetupsController::numberOfConcurrentIOVs_
NumberOfConcurrentIOVs numberOfConcurrentIOVs_
Definition: EventSetupsController.h:170
edm::eventsetup::EventSetupsController::checkESProducerSharing
void checkESProducerSharing()
Definition: EventSetupsController.cc:396
edm::eventsetup::NumberOfConcurrentIOVs::readConfigurationParameters
void readConfigurationParameters(ParameterSet const *eventSetupPset)
Definition: NumberOfConcurrentIOVs.cc:19
edm::eventsetup::EventSetupsController::hasNonconcurrentFinder_
bool hasNonconcurrentFinder_
Definition: EventSetupsController.h:189
edm::eventsetup::EventSetupsController::finishConfiguration
void finishConfiguration()
Definition: EventSetupsController.cc:66
WaitingTaskList
edm::make_empty_waiting_task
std::unique_ptr< edm::EmptyWaitingTask, waitingtask::TaskDestroyer > make_empty_waiting_task()
Create an EmptyWaitingTask which will properly be destroyed.
Definition: WaitingTaskList.h:96
edm::isTransientEqual
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)
Definition: ParameterSet.cc:777
edm::eventsetup::NumberOfConcurrentIOVs::numberOfConcurrentIOVs
unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const &, bool printInfoMsg=false) const
Definition: NumberOfConcurrentIOVs.cc:47
edm::eventsetup::NumberOfConcurrentIOVs::clear
void clear()
Definition: NumberOfConcurrentIOVs.cc:75
edm::eventsetup::EventSetupsController::hasNonconcurrentFinder
bool hasNonconcurrentFinder() const
Definition: EventSetupsController.h:161
bookConverter.elements
elements
Definition: bookConverter.py:147
edm::eventsetup::NumberOfConcurrentIOVs::fillRecordsNotAllowingConcurrentIOVs
void fillRecordsNotAllowingConcurrentIOVs(EventSetupProvider const &)
Definition: NumberOfConcurrentIOVs.cc:43
Exception
Definition: hltDiff.cc:246
edm::eventsetup::fillEventSetupProvider
void fillEventSetupProvider(EventSetupsController &esController, EventSetupProvider &cp, ParameterSet &params)
Definition: EventSetupProviderMaker.cc:93
edm::eventsetup::EventSetupsController::initializeEventSetupRecordIOVQueues
void initializeEventSetupRecordIOVQueues()
Definition: EventSetupsController.cc:434
edm::eventsetup::EventSetupsController::mustFinishConfiguration_
bool mustFinishConfiguration_
Definition: EventSetupsController.h:190
edm::eventsetup::NumberOfConcurrentIOVs::setMaxConcurrentIOVs
void setMaxConcurrentIOVs(unsigned int nStreams, unsigned int nConcurrentLumis)
Definition: NumberOfConcurrentIOVs.cc:39
edm::eventsetup::EventSetupsController::clearComponents
void clearComponents()
Definition: EventSetupsController.cc:239
edm::eventsetup::EventSetupsController::esproducers_
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
Definition: EventSetupsController.h:186
crabWrapper.key
key
Definition: crabWrapper.py:19
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27