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();
79 std::shared_ptr<DataProxyProvider>
87 it->second.subProcessIndexes().push_back(subProcessIndex);
89 return it->second.provider();
93 return std::shared_ptr<DataProxyProvider>();
98 auto newElement =
esproducers_.insert(std::pair<ParameterSetID, ESProducerInfo>(pset.
id(),
101 newElement->second.subProcessIndexes().push_back(subProcessIndex);
104 std::shared_ptr<EventSetupRecordIntervalFinder>
112 it->second.subProcessIndexes().push_back(subProcessIndex);
114 return it->second.finder();
118 return std::shared_ptr<EventSetupRecordIntervalFinder>();
123 auto newElement =
essources_.insert(std::pair<ParameterSetID, ESSourceInfo>(pset.
id(),
126 newElement->second.subProcessIndexes().push_back(subProcessIndex);
137 unsigned subProcessIndex,
138 unsigned precedingProcessIndex,
139 bool& firstProcessWithThisPSet,
140 bool& precedingHasMatchingPSet)
const {
145 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
147 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
148 if (iFound == subProcessIndexes.end()) {
152 if (iFound == subProcessIndexes.begin()) {
153 firstProcessWithThisPSet =
true;
154 precedingHasMatchingPSet =
false;
156 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
157 if (iFoundPreceding == iFound) {
158 firstProcessWithThisPSet =
false;
159 precedingHasMatchingPSet =
false;
161 firstProcessWithThisPSet =
false;
162 precedingHasMatchingPSet =
true;
168 <<
"EventSetupsController::lookForMatches\n"
169 <<
"Subprocess index not found. This should never happen\n"
170 <<
"Please report this to a Framework Developer\n";
175 unsigned subProcessIndex,
176 unsigned precedingProcessIndex)
const {
181 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
183 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
184 if (iFound == subProcessIndexes.end()) {
188 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
189 if (iFoundPreceding == iFound) {
192 return iFoundPreceding == subProcessIndexes.begin();
196 <<
"EventSetupsController::isFirstMatch\n"
197 <<
"Subprocess index not found. This should never happen\n"
198 <<
"Please report this to a Framework Developer\n";
204 unsigned subProcessIndex,
205 unsigned precedingProcessIndex)
const {
210 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
212 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
213 if (iFound == subProcessIndexes.end()) {
217 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
218 if (iFoundPreceding == iFound) {
221 return (++iFoundPreceding) == iFound;
225 <<
"EventSetupsController::isLastMatch\n"
226 <<
"Subprocess index not found. This should never happen\n"
227 <<
"Please report this to a Framework Developer\n";
233 unsigned subProcessIndex,
234 unsigned precedingProcessIndex)
const {
238 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
240 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
241 if (iFound == subProcessIndexes.end()) {
245 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
246 if (iFoundPreceding == iFound) {
253 <<
"EventSetupsController::lookForMatchingESSource\n"
254 <<
"Subprocess index not found. This should never happen\n"
255 <<
"Please report this to a Framework Developer\n";
261 unsigned subProcessIndex,
262 unsigned precedingProcessIndex)
const {
266 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
268 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
269 if (iFound == subProcessIndexes.end()) {
273 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
274 if (iFoundPreceding == iFound) {
281 <<
"EventSetupsController::lookForMatchingESSource\n"
282 <<
"Subprocess index not found. This should never happen\n"
283 <<
"Please report this to a Framework Developer\n";
289 unsigned subProcessIndex)
const {
294 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
296 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
297 if (iFound == subProcessIndexes.end()) {
300 return it->second.pset();
303 <<
"EventSetupsController::getESProducerPSet\n"
304 <<
"Subprocess index not found. This should never happen\n"
305 <<
"Please report this to a Framework Developer\n";
315 if (esProvider != esProviderEnd) ++esProvider;
316 for ( ; esProvider != esProviderEnd; ++esProvider) {
325 std::set<ParameterSetIDHolder> sharingCheckDone;
332 std::map<EventSetupRecordKey, std::vector<ComponentDescription const*> > referencedESProducers;
338 for (
auto precedingESProvider =
providers_.begin();
339 precedingESProvider != esProvider;
340 ++precedingESProvider) {
342 (*esProvider)->checkESProducerSharing(**precedingESProvider, sharingCheckDone, referencedESProducers, *
this);
345 (*esProvider)->resetRecordToProxyPointers();
348 for ( ; esProvider != esProviderEnd; ++esProvider) {
349 (*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)
std::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &)
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
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_
void forceCacheClear() const
bool isMatchingESSource(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
std::vector< std::shared_ptr< EventSetupProvider > > providers_
std::auto_ptr< EventSetupProvider > makeEventSetupProvider(ParameterSet const ¶ms, unsigned subProcessIndex)
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)