26 namespace eventsetup {
31 std::shared_ptr<EventSetupProvider>
52 std::for_each(
providers_.begin(),
providers_.end(), [](std::shared_ptr<EventSetupProvider>
const& esp) {
53 esp->finishConfiguration();
67 std::for_each(
providers_.begin(),
providers_.end(), [&syncValue](std::shared_ptr<EventSetupProvider>
const& esp) {
68 esp->eventSetupForInstance(syncValue);
74 std::for_each(
providers_.begin(),
providers_.end(), [](std::shared_ptr<EventSetupProvider>
const& esp) {
75 esp->forceCacheClear();
82 if( not provider->isWithinValidityInterval(syncValue)) {
89 std::shared_ptr<DataProxyProvider>
97 it->second.subProcessIndexes().push_back(subProcessIndex);
99 return it->second.provider();
103 return std::shared_ptr<DataProxyProvider>();
108 auto newElement =
esproducers_.insert(std::pair<ParameterSetID, ESProducerInfo>(pset.
id(),
111 newElement->second.subProcessIndexes().push_back(subProcessIndex);
114 std::shared_ptr<EventSetupRecordIntervalFinder>
122 it->second.subProcessIndexes().push_back(subProcessIndex);
124 return it->second.finder();
128 return std::shared_ptr<EventSetupRecordIntervalFinder>();
133 auto newElement =
essources_.insert(std::pair<ParameterSetID, ESSourceInfo>(pset.
id(),
136 newElement->second.subProcessIndexes().push_back(subProcessIndex);
147 unsigned subProcessIndex,
148 unsigned precedingProcessIndex,
149 bool& firstProcessWithThisPSet,
150 bool& precedingHasMatchingPSet)
const {
155 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
157 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
158 if (iFound == subProcessIndexes.end()) {
162 if (iFound == subProcessIndexes.begin()) {
163 firstProcessWithThisPSet =
true;
164 precedingHasMatchingPSet =
false;
166 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
167 if (iFoundPreceding == iFound) {
168 firstProcessWithThisPSet =
false;
169 precedingHasMatchingPSet =
false;
171 firstProcessWithThisPSet =
false;
172 precedingHasMatchingPSet =
true;
178 <<
"EventSetupsController::lookForMatches\n" 179 <<
"Subprocess index not found. This should never happen\n" 180 <<
"Please report this to a Framework Developer\n";
185 unsigned subProcessIndex,
186 unsigned precedingProcessIndex)
const {
191 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
193 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
194 if (iFound == subProcessIndexes.end()) {
198 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
199 if (iFoundPreceding == iFound) {
202 return iFoundPreceding == subProcessIndexes.begin();
206 <<
"EventSetupsController::isFirstMatch\n" 207 <<
"Subprocess index not found. This should never happen\n" 208 <<
"Please report this to a Framework Developer\n";
214 unsigned subProcessIndex,
215 unsigned precedingProcessIndex)
const {
220 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
222 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
223 if (iFound == subProcessIndexes.end()) {
227 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
228 if (iFoundPreceding == iFound) {
231 return (++iFoundPreceding) == iFound;
235 <<
"EventSetupsController::isLastMatch\n" 236 <<
"Subprocess index not found. This should never happen\n" 237 <<
"Please report this to a Framework Developer\n";
243 unsigned subProcessIndex,
244 unsigned precedingProcessIndex)
const {
248 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
250 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
251 if (iFound == subProcessIndexes.end()) {
255 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
256 if (iFoundPreceding == iFound) {
263 <<
"EventSetupsController::lookForMatchingESSource\n" 264 <<
"Subprocess index not found. This should never happen\n" 265 <<
"Please report this to a Framework Developer\n";
271 unsigned subProcessIndex,
272 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) {
291 <<
"EventSetupsController::lookForMatchingESSource\n" 292 <<
"Subprocess index not found. This should never happen\n" 293 <<
"Please report this to a Framework Developer\n";
299 unsigned subProcessIndex)
const {
304 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
306 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
307 if (iFound == subProcessIndexes.end()) {
310 return it->second.pset();
313 <<
"EventSetupsController::getESProducerPSet\n" 314 <<
"Subprocess index not found. This should never happen\n" 315 <<
"Please report this to a Framework Developer\n";
325 if (esProvider != esProviderEnd) ++esProvider;
326 for ( ; esProvider != esProviderEnd; ++esProvider) {
335 std::set<ParameterSetIDHolder> sharingCheckDone;
342 std::map<EventSetupRecordKey, std::vector<ComponentDescription const*> > referencedESProducers;
348 for (
auto precedingESProvider =
providers_.begin();
349 precedingESProvider != esProvider;
350 ++precedingESProvider) {
352 (*esProvider)->checkESProducerSharing(**precedingESProvider, sharingCheckDone, referencedESProducers, *
this);
355 (*esProvider)->resetRecordToProxyPointers();
358 for ( ; esProvider != esProviderEnd; ++esProvider) {
359 (*esProvider)->clearInitializationData();
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
bool isMatchingESProducer(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
void checkESProducerSharing()
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
std::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &, ActivityRegistry *)
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 eventSetupForInstance(IOVSyncValue const &syncValue)
std::shared_ptr< DataProxyProvider > getESProducerAndRegisterProcess(ParameterSet const &pset, unsigned subProcessIndex)
void fillEventSetupProvider(EventSetupsController &esController, EventSetupProvider &cp, ParameterSet ¶ms)
std::multimap< ParameterSetID, ESSourceInfo > essources_
bool isWithinValidityInterval(IOVSyncValue const &syncValue) const
void forceCacheClear() const
std::unique_ptr< EventSetupProvider > makeEventSetupProvider(ParameterSet const ¶ms, unsigned subProcessIndex, ActivityRegistry *)
bool isMatchingESSource(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
std::vector< std::shared_ptr< EventSetupProvider > > providers_
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)