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 endIOVsAsync (edm::WaitingTaskHolder iEndTask)
 
std::multimap< ParameterSetID, ESProducerInfo > const & esproducers () const
 
std::multimap< ParameterSetID, ESSourceInfo > const & essources () const
 
void eventSetupForInstanceAsync (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, unsigned int maxConcurrentIOVs=0, bool dumpOptions=false)
 
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)
 

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 355 of file EventSetupsController.cc.

References providers_.

Referenced by finishConfiguration().

355  {
356  // Loop over SubProcesses, skip the top level process.
357  auto esProvider = providers_.begin();
358  auto const esProviderEnd = providers_.end();
359  if (esProvider != esProviderEnd)
360  ++esProvider;
361  for (; esProvider != esProviderEnd; ++esProvider) {
362  // An element is added to this set for each ESProducer
363  // when we have determined which preceding process
364  // this process can share that ESProducer with or
365  // we have determined that it cannot be shared with
366  // any preceding process.
367  // Note the earliest possible preceding process
368  // will be the one selected if there is more than one.
369  std::set<ParameterSetIDHolder> sharingCheckDone;
370 
371  // This will hold an entry for DataProxy's that are
372  // referenced by an EventSetupRecord in this SubProcess.
373  // But only for DataProxy's that are associated with
374  // an ESProducer (not the ones associated with ESSource's
375  // or EDLooper's)
376  std::map<EventSetupRecordKey, std::vector<ComponentDescription const*>> referencedESProducers;
377 
378  // For each EventSetupProvider from a SubProcess, loop over the
379  // EventSetupProviders from the preceding processes (the first
380  // preceding process will be the top level process and the others
381  // SubProcess's)
382  for (auto precedingESProvider = providers_.begin(); precedingESProvider != esProvider; ++precedingESProvider) {
383  (*esProvider)->checkESProducerSharing(**precedingESProvider, sharingCheckDone, referencedESProducers, *this);
384  }
385 
386  (*esProvider)->resetRecordToProxyPointers();
387  }
388  for (auto& eventSetupProvider : providers_) {
389  eventSetupProvider->clearInitializationData();
390  }
391  }
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_

◆ clearComponents()

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

Definition at line 198 of file EventSetupsController.cc.

References esproducers_, and essources_.

Referenced by finishConfiguration().

198  {
199  esproducers_.clear();
200  essources_.clear();
201  }
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
std::multimap< ParameterSetID, ESSourceInfo > essources_

◆ doWeNeedToWaitForIOVsToFinish()

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

Definition at line 129 of file EventSetupsController.cc.

References hasNonconcurrentFinder(), and providers_.

129  {
130  if (hasNonconcurrentFinder()) {
131  for (auto& eventSetupProvider : providers_) {
132  if (eventSetupProvider->doWeNeedToWaitForIOVsToFinish(syncValue)) {
133  return true;
134  }
135  }
136  }
137  return false;
138  }
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_

◆ endIOVsAsync()

void edm::eventsetup::EventSetupsController::endIOVsAsync ( edm::WaitingTaskHolder  iEndTask)

Definition at line 36 of file EventSetupsController.cc.

References eventSetupRecordIOVQueues_.

Referenced by edm::eventsetup::SynchronousEventSetupsController::~SynchronousEventSetupsController().

36  {
37  for (auto& eventSetupRecordIOVQueue : eventSetupRecordIOVQueues_) {
38  eventSetupRecordIOVQueue->endIOVAsync(iEndTask);
39  }
40  }
std::vector< propagate_const< std::unique_ptr< EventSetupRecordIOVQueue > > > eventSetupRecordIOVQueues_

◆ esproducers()

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

Definition at line 154 of file EventSetupsController.h.

References esproducers_.

154 { return esproducers_; }
std::multimap< ParameterSetID, ESProducerInfo > esproducers_

◆ essources()

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

Definition at line 156 of file EventSetupsController.h.

References essources_.

156 { return essources_; }
std::multimap< ParameterSetID, ESSourceInfo > essources_

◆ eventSetupForInstanceAsync()

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

Definition at line 90 of file EventSetupsController.cc.

References eventSetupRecordIOVQueues_, finishConfiguration(), and providers_.

Referenced by edm::eventsetup::synchronousEventSetupForInstance().

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

◆ finishConfiguration()

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

Definition at line 64 of file EventSetupsController.cc.

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

Referenced by eventSetupForInstanceAsync().

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

◆ forceCacheClear()

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

Definition at line 140 of file EventSetupsController.cc.

References providers_.

140  {
141  for (auto& eventSetupProvider : providers_) {
142  eventSetupProvider->forceCacheClear();
143  }
144  }
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_

◆ getESProducerAndRegisterProcess()

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

Definition at line 146 of file EventSetupsController.cc.

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

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

147  {
148  // Try to find a DataProxyProvider with a matching ParameterSet
149  auto elements = esproducers_.equal_range(pset.id());
150  for (auto it = elements.first; it != elements.second; ++it) {
151  // Untracked parameters must also match, do complete comparison if IDs match
152  if (isTransientEqual(pset, *it->second.pset())) {
153  // Register processes with an exact match
154  it->second.subProcessIndexes().push_back(subProcessIndex);
155  // Return the DataProxyProvider
156  return it->second.provider();
157  }
158  }
159  // Could not find it
160  return std::shared_ptr<DataProxyProvider>();
161  }
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)

◆ getESProducerPSet()

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

Definition at line 337 of file EventSetupsController.cc.

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

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

338  {
339  auto elements = esproducers_.equal_range(psetID);
340  for (auto it = elements.first; it != elements.second; ++it) {
341  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
342 
343  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
344  if (iFound == subProcessIndexes.end()) {
345  continue;
346  }
347  return it->second.pset();
348  }
349  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::getESProducerPSet\n"
350  << "Subprocess index not found. This should never happen\n"
351  << "Please report this to a Framework Developer\n";
352  return nullptr;
353  }
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ getESSourceAndRegisterProcess()

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

Definition at line 172 of file EventSetupsController.cc.

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

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

173  {
174  // Try to find a EventSetupRecordIntervalFinder with a matching ParameterSet
175  auto elements = essources_.equal_range(pset.id());
176  for (auto it = elements.first; it != elements.second; ++it) {
177  // Untracked parameters must also match, do complete comparison if IDs match
178  if (isTransientEqual(pset, *it->second.pset())) {
179  // Register processes with an exact match
180  it->second.subProcessIndexes().push_back(subProcessIndex);
181  // Return the EventSetupRecordIntervalFinder
182  return it->second.finder();
183  }
184  }
185  // Could not find it
186  return std::shared_ptr<EventSetupRecordIntervalFinder>();
187  }
std::multimap< ParameterSetID, ESSourceInfo > essources_
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)

◆ hasNonconcurrentFinder()

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

◆ indexOfNextProcess()

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

◆ initializeEventSetupRecordIOVQueues()

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

Definition at line 393 of file EventSetupsController.cc.

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

Referenced by finishConfiguration().

393  {
394  std::set<EventSetupRecordKey> keys;
395  for (auto const& provider : providers_) {
396  provider->fillKeys(keys);
397  }
398 
399  for (auto const& key : keys) {
400  eventSetupRecordIOVQueues_.push_back(
401  std::make_unique<EventSetupRecordIOVQueue>(numberOfConcurrentIOVs_.numberOfConcurrentIOVs(key)));
402  EventSetupRecordIOVQueue& iovQueue = *eventSetupRecordIOVQueues_.back();
403  for (auto& provider : providers_) {
404  EventSetupRecordProvider* recProvider = provider->tryToGetRecordProvider(key);
405  if (recProvider) {
406  iovQueue.addRecProvider(recProvider);
407  }
408  }
409  }
410  }
std::vector< propagate_const< std::unique_ptr< EventSetupRecordIOVQueue > > > eventSetupRecordIOVQueues_
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_
unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const &, bool printInfoMsg=false) const

◆ isFirstMatch()

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

Definition at line 237 of file EventSetupsController.cc.

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

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

239  {
240  auto elements = esproducers_.equal_range(psetID);
241  for (auto it = elements.first; it != elements.second; ++it) {
242  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
243 
244  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
245  if (iFound == subProcessIndexes.end()) {
246  continue;
247  }
248 
249  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
250  if (iFoundPreceding == iFound) {
251  break;
252  } else {
253  return iFoundPreceding == subProcessIndexes.begin();
254  }
255  }
256  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::isFirstMatch\n"
257  << "Subprocess index not found. This should never happen\n"
258  << "Please report this to a Framework Developer\n";
259  return false;
260  }
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ isLastMatch()

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

Definition at line 262 of file EventSetupsController.cc.

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

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

264  {
265  auto elements = esproducers_.equal_range(psetID);
266  for (auto it = elements.first; it != elements.second; ++it) {
267  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
268 
269  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
270  if (iFound == subProcessIndexes.end()) {
271  continue;
272  }
273 
274  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
275  if (iFoundPreceding == iFound) {
276  break;
277  } else {
278  return (++iFoundPreceding) == iFound;
279  }
280  }
281  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::isLastMatch\n"
282  << "Subprocess index not found. This should never happen\n"
283  << "Please report this to a Framework Developer\n";
284  return false;
285  }
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ isMatchingESProducer()

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

Definition at line 312 of file EventSetupsController.cc.

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

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

314  {
315  auto elements = esproducers_.equal_range(psetID);
316  for (auto it = elements.first; it != elements.second; ++it) {
317  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
318 
319  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
320  if (iFound == subProcessIndexes.end()) {
321  continue;
322  }
323 
324  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
325  if (iFoundPreceding == iFound) {
326  return false;
327  } else {
328  return true;
329  }
330  }
331  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::lookForMatchingESSource\n"
332  << "Subprocess index not found. This should never happen\n"
333  << "Please report this to a Framework Developer\n";
334  return false;
335  }
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ isMatchingESSource()

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

Definition at line 287 of file EventSetupsController.cc.

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

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

289  {
290  auto elements = essources_.equal_range(psetID);
291  for (auto it = elements.first; it != elements.second; ++it) {
292  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
293 
294  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
295  if (iFound == subProcessIndexes.end()) {
296  continue;
297  }
298 
299  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
300  if (iFoundPreceding == iFound) {
301  return false;
302  } else {
303  return true;
304  }
305  }
306  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::lookForMatchingESSource\n"
307  << "Subprocess index not found. This should never happen\n"
308  << "Please report this to a Framework Developer\n";
309  return false;
310  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::multimap< ParameterSetID, ESSourceInfo > essources_

◆ lookForMatches()

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

Definition at line 203 of file EventSetupsController.cc.

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

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

207  {
208  auto elements = esproducers_.equal_range(psetID);
209  for (auto it = elements.first; it != elements.second; ++it) {
210  std::vector<unsigned> const& subProcessIndexes = it->second.subProcessIndexes();
211 
212  auto iFound = std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
213  if (iFound == subProcessIndexes.end()) {
214  continue;
215  }
216 
217  if (iFound == subProcessIndexes.begin()) {
218  firstProcessWithThisPSet = true;
219  precedingHasMatchingPSet = false;
220  } else {
221  auto iFoundPreceding = std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
222  if (iFoundPreceding == iFound) {
223  firstProcessWithThisPSet = false;
224  precedingHasMatchingPSet = false;
225  } else {
226  firstProcessWithThisPSet = false;
227  precedingHasMatchingPSet = true;
228  }
229  }
230  return;
231  }
232  throw edm::Exception(edm::errors::LogicError) << "EventSetupsController::lookForMatches\n"
233  << "Subprocess index not found. This should never happen\n"
234  << "Please report this to a Framework Developer\n";
235  }
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ makeProvider()

std::shared_ptr< EventSetupProvider > edm::eventsetup::EventSetupsController::makeProvider ( ParameterSet iPSet,
ActivityRegistry activityRegistry,
ParameterSet const *  eventSetupPset = nullptr,
unsigned int  maxConcurrentIOVs = 0,
bool  dumpOptions = false 
)

Definition at line 42 of file EventSetupsController.cc.

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

Referenced by edm::eventsetup::SynchronousEventSetupsController::makeProvider(), and edm::SubProcess::SubProcess().

46  {
47  // Makes an EventSetupProvider
48  // Also parses the prefer information from ParameterSets and puts
49  // it in a map that is stored in the EventSetupProvider
50  std::shared_ptr<EventSetupProvider> returnValue(
51  makeEventSetupProvider(iPSet, providers_.size(), activityRegistry));
52 
53  // Construct the ESProducers and ESSources
54  // shared_ptrs to them are temporarily stored in this
55  // EventSetupsController and in the EventSetupProvider
56  fillEventSetupProvider(*this, *returnValue, iPSet);
57 
58  numberOfConcurrentIOVs_.readConfigurationParameters(eventSetupPset, maxConcurrentIOVs, dumpOptions);
59 
60  providers_.push_back(returnValue);
61  return returnValue;
62  }
std::unique_ptr< EventSetupProvider > makeEventSetupProvider(ParameterSet const &params, unsigned subProcessIndex, ActivityRegistry *activityRegistry)
void fillEventSetupProvider(EventSetupsController &esController, EventSetupProvider &cp, ParameterSet &params)
void readConfigurationParameters(ParameterSet const *eventSetupPset, unsigned int maxConcurrentIOVs, bool dumpOptions)
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_

◆ mustFinishConfiguration()

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

◆ 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 152 of file EventSetupsController.h.

References providers_.

152 { return providers_; }
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_

◆ putESProducer()

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

Definition at line 163 of file EventSetupsController.cc.

References esproducers_, and muonDTDigis_cfi::pset.

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

165  {
166  auto newElement =
167  esproducers_.insert(std::pair<ParameterSetID, ESProducerInfo>(pset.id(), ESProducerInfo(&pset, component)));
168  // Register processes with an exact match
169  newElement->second.subProcessIndexes().push_back(subProcessIndex);
170  }
std::multimap< ParameterSetID, ESProducerInfo > esproducers_

◆ putESSource()

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

Definition at line 189 of file EventSetupsController.cc.

References essources_, and muonDTDigis_cfi::pset.

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

191  {
192  auto newElement =
193  essources_.insert(std::pair<ParameterSetID, ESSourceInfo>(pset.id(), ESSourceInfo(&pset, component)));
194  // Register processes with an exact match
195  newElement->second.subProcessIndexes().push_back(subProcessIndex);
196  }
std::multimap< ParameterSetID, ESSourceInfo > essources_

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 186 of file EventSetupsController.h.

Referenced by finishConfiguration(), and hasNonconcurrentFinder().

◆ mustFinishConfiguration_

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

Definition at line 187 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