31 namespace eventsetup {
41 std::shared_ptr<EventSetupProvider> returnValue(
65 for (
auto& eventSetupProvider : providers_) {
89 std::vector<std::shared_ptr<const EventSetupImpl>>& eventSetupImpls) {
92 bool newEventSetupImpl =
false;
93 eventSetupImpls.clear();
100 eventSetupProvider->setAllValidityIntervals(syncValue);
108 eventSetupRecordIOVQueue->setNewIntervalForAnySubProcess();
111 for (
auto& eventSetupProvider : providers_) {
116 eventSetupImpls.push_back(eventSetupProvider->eventSetupForInstance(syncValue, newEventSetupImpl));
119 for (
auto& eventSetupRecordIOVQueue : eventSetupRecordIOVQueues_) {
120 eventSetupRecordIOVQueue->checkForNewIOVs(taskToStartAfterIOVInit, endIOVWaitingTasks, newEventSetupImpl);
138 waitUntilIOVInitializationCompletes->increment_ref_count();
142 std::vector<std::shared_ptr<const EventSetupImpl>> dummyEventSetupImpls;
150 dummyWaitingTaskList.
doneWaiting(std::exception_ptr{});
152 dummyWaitingTaskList.
doneWaiting(std::exception_ptr{});
153 waitingTaskHolder.doneWaiting(std::current_exception());
156 waitUntilIOVInitializationCompletes->wait_for_all();
158 if (waitUntilIOVInitializationCompletes->exceptionPtr() !=
nullptr) {
159 std::rethrow_exception(*(waitUntilIOVInitializationCompletes->exceptionPtr()));
166 if (eventSetupProvider->doWeNeedToWaitForIOVsToFinish(syncValue)) {
176 eventSetupProvider->forceCacheClear();
188 it->second.subProcessIndexes().push_back(subProcessIndex);
190 return it->second.provider();
194 return std::shared_ptr<DataProxyProvider>();
198 std::shared_ptr<DataProxyProvider>
const& component,
199 unsigned subProcessIndex) {
203 newElement->second.subProcessIndexes().push_back(subProcessIndex);
214 it->second.subProcessIndexes().push_back(subProcessIndex);
216 return it->second.finder();
220 return std::shared_ptr<EventSetupRecordIntervalFinder>();
224 std::shared_ptr<EventSetupRecordIntervalFinder>
const& component,
225 unsigned subProcessIndex) {
229 newElement->second.subProcessIndexes().push_back(subProcessIndex);
238 unsigned subProcessIndex,
239 unsigned precedingProcessIndex,
240 bool& firstProcessWithThisPSet,
241 bool& precedingHasMatchingPSet)
const {
244 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
246 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
247 if (iFound == subProcessIndexes.end()) {
251 if (iFound == subProcessIndexes.begin()) {
252 firstProcessWithThisPSet =
true;
253 precedingHasMatchingPSet =
false;
255 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
256 if (iFoundPreceding == iFound) {
257 firstProcessWithThisPSet =
false;
258 precedingHasMatchingPSet =
false;
260 firstProcessWithThisPSet =
false;
261 precedingHasMatchingPSet =
true;
267 <<
"Subprocess index not found. This should never happen\n" 268 <<
"Please report this to a Framework Developer\n";
272 unsigned subProcessIndex,
273 unsigned precedingProcessIndex)
const {
276 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
278 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
279 if (iFound == subProcessIndexes.end()) {
283 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
284 if (iFoundPreceding == iFound) {
287 return iFoundPreceding == subProcessIndexes.begin();
291 <<
"Subprocess index not found. This should never happen\n" 292 <<
"Please report this to a Framework Developer\n";
297 unsigned subProcessIndex,
298 unsigned precedingProcessIndex)
const {
301 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
303 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
304 if (iFound == subProcessIndexes.end()) {
308 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
309 if (iFoundPreceding == iFound) {
312 return (++iFoundPreceding) == iFound;
316 <<
"Subprocess index not found. This should never happen\n" 317 <<
"Please report this to a Framework Developer\n";
322 unsigned subProcessIndex,
323 unsigned precedingProcessIndex)
const {
326 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
328 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
329 if (iFound == subProcessIndexes.end()) {
333 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
334 if (iFoundPreceding == iFound) {
341 <<
"Subprocess index not found. This should never happen\n" 342 <<
"Please report this to a Framework Developer\n";
347 unsigned subProcessIndex,
348 unsigned precedingProcessIndex)
const {
351 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
353 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
354 if (iFound == subProcessIndexes.end()) {
358 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
359 if (iFoundPreceding == iFound) {
366 <<
"Subprocess index not found. This should never happen\n" 367 <<
"Please report this to a Framework Developer\n";
372 unsigned subProcessIndex)
const {
375 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
377 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
378 if (iFound == subProcessIndexes.end()) {
381 return it->second.pset();
384 <<
"Subprocess index not found. This should never happen\n" 385 <<
"Please report this to a Framework Developer\n";
393 if (esProvider != esProviderEnd)
395 for (; esProvider != esProviderEnd; ++esProvider) {
403 std::set<ParameterSetIDHolder> sharingCheckDone;
410 std::map<EventSetupRecordKey, std::vector<ComponentDescription const*>> referencedESProducers;
416 for (
auto precedingESProvider =
providers_.begin(); precedingESProvider != esProvider; ++precedingESProvider) {
417 (*esProvider)->checkESProducerSharing(**precedingESProvider, sharingCheckDone, referencedESProducers, *
this);
420 (*esProvider)->resetRecordToProxyPointers();
423 eventSetupProvider->clearInitializationData();
428 std::set<EventSetupRecordKey>
keys;
430 provider->fillKeys(keys);
433 for (
auto const&
key : keys) {
437 for (
auto& provider : providers_) {
void lookForMatches(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex, bool &firstProcessWithThisPSet, bool &precedingHasMatchingPSet) const
std::shared_ptr< EventSetupRecordIntervalFinder > getESSourceAndRegisterProcess(ParameterSet const &pset, unsigned subProcessIndex)
bool isFirstMatch(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
void addRecProvider(EventSetupRecordProvider *recProvider)
bool isMatchingESProducer(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
void checkESProducerSharing()
std::vector< propagate_const< std::unique_ptr< EventSetupRecordIOVQueue > > > eventSetupRecordIOVQueues_
void putESSource(ParameterSet const &pset, std::shared_ptr< EventSetupRecordIntervalFinder > const &component, unsigned subProcessIndex)
ParameterSetID id() const
void putESProducer(ParameterSet const &pset, std::shared_ptr< DataProxyProvider > const &component, unsigned subProcessIndex)
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
bool isLastMatch(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
bool mustFinishConfiguration_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
ParameterSet const * getESProducerPSet(ParameterSetID const &psetID, unsigned subProcessIndex) const
void setMaxConcurrentIOVs(unsigned int nStreams, unsigned int nConcurrentLumis)
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
std::shared_ptr< DataProxyProvider > getESProducerAndRegisterProcess(ParameterSet const &pset, unsigned subProcessIndex)
void fillEventSetupProvider(EventSetupsController &esController, EventSetupProvider &cp, ParameterSet ¶ms)
void fillRecordsNotAllowingConcurrentIOVs(EventSetupProvider const &)
std::unique_ptr< edm::EmptyWaitingTask, waitingtask::TaskDestroyer > make_empty_waiting_task()
Create an EmptyWaitingTask which will properly be destroyed.
std::multimap< ParameterSetID, ESSourceInfo > essources_
bool doWeNeedToWaitForIOVsToFinish(IOVSyncValue const &) const
void initializeEventSetupRecordIOVQueues()
unsigned int numberOfConcurrentIOVs(EventSetupRecordKey const &, bool printInfoMsg=false) const
bool hasNonconcurrentFinder() const
void eventSetupForInstance(IOVSyncValue const &, WaitingTaskHolder const &taskToStartAfterIOVInit, WaitingTaskList &endIOVWaitingTasks, std::vector< std::shared_ptr< const EventSetupImpl >> &)
void finishConfiguration()
bool hasNonconcurrentFinder_
std::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &, ActivityRegistry *, ParameterSet const *eventSetupPset=nullptr)
std::unique_ptr< EventSetupProvider > makeEventSetupProvider(ParameterSet const ¶ms, unsigned subProcessIndex, ActivityRegistry *)
bool isMatchingESSource(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
void readConfigurationParameters(ParameterSet const *eventSetupPset)
std::vector< propagate_const< std::shared_ptr< EventSetupProvider > > > providers_
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)
NumberOfConcurrentIOVs numberOfConcurrentIOVs_
void setMaxConcurrentIOVs(unsigned int nStreams, unsigned int nConcurrentLumis)