27 namespace eventsetup {
32 boost::shared_ptr<EventSetupProvider>
54 esp->finishConfiguration();
68 std::for_each(
providers_.begin(),
providers_.end(), [&syncValue](boost::shared_ptr<EventSetupProvider>
const&
esp) {
69 esp->eventSetupForInstance(syncValue);
76 esp->forceCacheClear();
80 boost::shared_ptr<DataProxyProvider>
88 it->second.subProcessIndexes().push_back(subProcessIndex);
90 return it->second.provider();
94 return boost::shared_ptr<DataProxyProvider>();
99 auto newElement =
esproducers_.insert(std::pair<ParameterSetID, ESProducerInfo>(pset.
id(),
102 newElement->second.subProcessIndexes().push_back(subProcessIndex);
105 boost::shared_ptr<EventSetupRecordIntervalFinder>
113 it->second.subProcessIndexes().push_back(subProcessIndex);
115 return it->second.finder();
119 return boost::shared_ptr<EventSetupRecordIntervalFinder>();
124 auto newElement =
essources_.insert(std::pair<ParameterSetID, ESSourceInfo>(pset.
id(),
127 newElement->second.subProcessIndexes().push_back(subProcessIndex);
138 unsigned subProcessIndex,
139 unsigned precedingProcessIndex,
140 bool& firstProcessWithThisPSet,
141 bool& precedingHasMatchingPSet)
const {
146 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
148 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
149 if (iFound == subProcessIndexes.end()) {
153 if (iFound == subProcessIndexes.begin()) {
154 firstProcessWithThisPSet =
true;
155 precedingHasMatchingPSet =
false;
157 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
158 if (iFoundPreceding == iFound) {
159 firstProcessWithThisPSet =
false;
160 precedingHasMatchingPSet =
false;
162 firstProcessWithThisPSet =
false;
163 precedingHasMatchingPSet =
true;
169 <<
"EventSetupsController::lookForMatches\n"
170 <<
"Subprocess index not found. This should never happen\n"
171 <<
"Please report this to a Framework Developer\n";
176 unsigned subProcessIndex,
177 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 <<
"EventSetupsController::isFirstMatch\n"
198 <<
"Subprocess index not found. This should never happen\n"
199 <<
"Please report this to a Framework Developer\n";
205 unsigned subProcessIndex,
206 unsigned precedingProcessIndex)
const {
211 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
213 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
214 if (iFound == subProcessIndexes.end()) {
218 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
219 if (iFoundPreceding == iFound) {
222 return (++iFoundPreceding) == iFound;
226 <<
"EventSetupsController::isLastMatch\n"
227 <<
"Subprocess index not found. This should never happen\n"
228 <<
"Please report this to a Framework Developer\n";
234 unsigned subProcessIndex,
235 unsigned precedingProcessIndex)
const {
239 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
241 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
242 if (iFound == subProcessIndexes.end()) {
246 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
247 if (iFoundPreceding == iFound) {
254 <<
"EventSetupsController::lookForMatchingESSource\n"
255 <<
"Subprocess index not found. This should never happen\n"
256 <<
"Please report this to a Framework Developer\n";
262 unsigned subProcessIndex,
263 unsigned precedingProcessIndex)
const {
267 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
269 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
270 if (iFound == subProcessIndexes.end()) {
274 auto iFoundPreceding =
std::find(subProcessIndexes.begin(), iFound, precedingProcessIndex);
275 if (iFoundPreceding == iFound) {
282 <<
"EventSetupsController::lookForMatchingESSource\n"
283 <<
"Subprocess index not found. This should never happen\n"
284 <<
"Please report this to a Framework Developer\n";
290 unsigned subProcessIndex)
const {
295 std::vector<unsigned>
const& subProcessIndexes = it->second.subProcessIndexes();
297 auto iFound =
std::find(subProcessIndexes.begin(), subProcessIndexes.end(), subProcessIndex);
298 if (iFound == subProcessIndexes.end()) {
301 return it->second.pset();
304 <<
"EventSetupsController::getESProducerPSet\n"
305 <<
"Subprocess index not found. This should never happen\n"
306 <<
"Please report this to a Framework Developer\n";
316 if (esProvider != esProviderEnd) ++esProvider;
317 for ( ; esProvider != esProviderEnd; ++esProvider) {
326 std::set<ParameterSetIDHolder> sharingCheckDone;
333 std::map<EventSetupRecordKey, std::vector<ComponentDescription const*> > referencedESProducers;
339 for (
auto precedingESProvider =
providers_.begin();
340 precedingESProvider != esProvider;
341 ++precedingESProvider) {
343 (*esProvider)->checkESProducerSharing(**precedingESProvider, sharingCheckDone, referencedESProducers, *
this);
346 (*esProvider)->resetRecordToProxyPointers();
349 for ( ; esProvider != esProviderEnd; ++esProvider) {
350 (*esProvider)->clearInitializationData();
void lookForMatches(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex, bool &firstProcessWithThisPSet, bool &precedingHasMatchingPSet) const
bool isFirstMatch(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
bool isMatchingESProducer(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
void checkESProducerSharing()
ParameterSetID id() const
std::multimap< ParameterSetID, ESProducerInfo > esproducers_
bool isLastMatch(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
bool mustFinishConfiguration_
void putESSource(ParameterSet const &pset, boost::shared_ptr< EventSetupRecordIntervalFinder > const &component, unsigned subProcessIndex)
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 putESProducer(ParameterSet const &pset, boost::shared_ptr< DataProxyProvider > const &component, unsigned subProcessIndex)
void eventSetupForInstance(IOVSyncValue const &syncValue)
boost::shared_ptr< DataProxyProvider > getESProducerAndRegisterProcess(ParameterSet const &pset, unsigned subProcessIndex)
void fillEventSetupProvider(EventSetupsController &esController, EventSetupProvider &cp, ParameterSet ¶ms)
std::multimap< ParameterSetID, ESSourceInfo > essources_
boost::shared_ptr< EventSetupRecordIntervalFinder > getESSourceAndRegisterProcess(ParameterSet const &pset, unsigned subProcessIndex)
void forceCacheClear() const
std::vector< boost::shared_ptr< EventSetupProvider > > providers_
boost::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &)
bool isMatchingESSource(ParameterSetID const &psetID, unsigned subProcessIndex, unsigned precedingProcessIndex) const
std::auto_ptr< EventSetupProvider > makeEventSetupProvider(ParameterSet const ¶ms, unsigned subProcessIndex)
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)