26 namespace eventsetup {
35 std::shared_ptr<EventSetupProvider> returnValue(
49 std::for_each(
providers_.begin(),
providers_.end(), [](std::shared_ptr<EventSetupProvider>
const& esp) {
50 esp->finishConfiguration();
66 std::for_each(
providers_.begin(),
providers_.end(), [&syncValue](std::shared_ptr<EventSetupProvider>
const& esp) {
67 esp->eventSetupForInstance(syncValue);
72 std::for_each(
providers_.begin(),
providers_.end(), [](std::shared_ptr<EventSetupProvider>
const& esp) {
73 esp->forceCacheClear();
79 if (not provider->isWithinValidityInterval(syncValue)) {
94 it->second.subProcessIndexes().push_back(subProcessIndex);
96 return it->second.provider();
100 return std::shared_ptr<DataProxyProvider>();
104 std::shared_ptr<DataProxyProvider>
const& component,
105 unsigned subProcessIndex) {
109 newElement->second.subProcessIndexes().push_back(subProcessIndex);
120 it->second.subProcessIndexes().push_back(subProcessIndex);
122 return it->second.finder();
126 return std::shared_ptr<EventSetupRecordIntervalFinder>();
130 std::shared_ptr<EventSetupRecordIntervalFinder>
const& component,
131 unsigned subProcessIndex) {
135 newElement->second.subProcessIndexes().push_back(subProcessIndex);
144 unsigned subProcessIndex,
145 unsigned precedingProcessIndex,
146 bool& firstProcessWithThisPSet,
147 bool& precedingHasMatchingPSet)
const {
150 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
152 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
153 if (iFound == subProcessIndexes.end()) {
157 if (iFound == subProcessIndexes.begin()) {
158 firstProcessWithThisPSet =
true;
159 precedingHasMatchingPSet =
false;
161 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
162 if (iFoundPreceding == iFound) {
163 firstProcessWithThisPSet =
false;
164 precedingHasMatchingPSet =
false;
166 firstProcessWithThisPSet =
false;
167 precedingHasMatchingPSet =
true;
173 <<
"Subprocess index not found. This should never happen\n" 174 <<
"Please report this to a Framework Developer\n";
178 unsigned subProcessIndex,
179 unsigned precedingProcessIndex)
const {
182 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
184 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
185 if (iFound == subProcessIndexes.end()) {
189 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
190 if (iFoundPreceding == iFound) {
193 return iFoundPreceding == subProcessIndexes.begin();
197 <<
"Subprocess index not found. This should never happen\n" 198 <<
"Please report this to a Framework Developer\n";
203 unsigned subProcessIndex,
204 unsigned precedingProcessIndex)
const {
207 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
209 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
210 if (iFound == subProcessIndexes.end()) {
214 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
215 if (iFoundPreceding == iFound) {
218 return (++iFoundPreceding) == iFound;
222 <<
"Subprocess index not found. This should never happen\n" 223 <<
"Please report this to a Framework Developer\n";
228 unsigned subProcessIndex,
229 unsigned precedingProcessIndex)
const {
232 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
234 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
235 if (iFound == subProcessIndexes.end()) {
239 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
240 if (iFoundPreceding == iFound) {
247 <<
"Subprocess index not found. This should never happen\n" 248 <<
"Please report this to a Framework Developer\n";
253 unsigned subProcessIndex,
254 unsigned precedingProcessIndex)
const {
257 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
259 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
260 if (iFound == subProcessIndexes.end()) {
264 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
265 if (iFoundPreceding == iFound) {
272 <<
"Subprocess index not found. This should never happen\n" 273 <<
"Please report this to a Framework Developer\n";
278 unsigned subProcessIndex)
const {
281 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
283 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
284 if (iFound == subProcessIndexes.end()) {
287 return it->second.pset();
290 <<
"Subprocess index not found. This should never happen\n" 291 <<
"Please report this to a Framework Developer\n";
299 if (esProvider != esProviderEnd)
301 for (; esProvider != esProviderEnd; ++esProvider) {
309 std::set<ParameterSetIDHolder> sharingCheckDone;
316 std::map<EventSetupRecordKey, std::vector<ComponentDescription const*> > referencedESProducers;
322 for (
auto precedingESProvider =
providers_.begin(); precedingESProvider != esProvider; ++precedingESProvider) {
323 (*esProvider)->checkESProducerSharing(**precedingESProvider, sharingCheckDone, referencedESProducers, *
this);
326 (*esProvider)->resetRecordToProxyPointers();
329 for (; esProvider != esProviderEnd; ++esProvider) {
330 (*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
void finishConfiguration()
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)