51 std::pair<unsigned long long, std::map<eventsetup::DataKey, bool> > >
73 : m_printProviders(iPS.getUntrackedParameter<
bool>(
"printProviders")),
74 m_checkDuringBeginRun(iPS.getUntrackedParameter<
bool>(
"checkDuringBeginRun")),
75 m_checkDuringBeginLumi(iPS.getUntrackedParameter<
bool>(
"checkDuringBeginLumi")),
76 m_checkDuringEvent(iPS.getUntrackedParameter<
bool>(
"checkDuringEvent")) {}
89 desc.addUntracked<
bool>(
"printProviders",
false)
90 ->setComment(
"If 'true' also print which ES module provides the data");
91 desc.addUntracked<
bool>(
"checkDuringBeginRun",
false)
92 ->setComment(
"If 'true' check for retrieved data during each begin run is processed");
93 desc.addUntracked<
bool>(
"checkDuringBeginLumi",
false)
94 ->setComment(
"If 'true' check for retrieved data during each begin lumi is processed");
95 desc.addUntracked<
bool>(
"checkDuringEvent",
true)
96 ->setComment(
"If 'true' check for retrieved data during an event is processed");
97 descriptions.
add(
"PrintEventSetupDataRetrieval",
desc);
98 descriptions.
setComment(
"This analyzer reports when EventSetup data is retrieved by a module in the job.");
143 std::unique_ptr<LogSystem>
msg;
144 for (std::vector<eventsetup::EventSetupRecordKey>::const_iterator it =
m_recordKeys.begin(),
149 auto r = iES.
find(*it);
156 .insert(std::make_pair(*it, std::pair<
unsigned long long, std::map<eventsetup::DataKey, bool> >()))
158 itRetrievedData->second.first =
r->cacheIdentifier();
159 std::vector<eventsetup::DataKey>
keys;
160 r->fillRegisteredDataKeys(
keys);
161 for (std::vector<eventsetup::DataKey>::const_iterator itData =
keys.begin(), itDataEnd =
keys.end();
164 itRetrievedData->second.second.insert(std::make_pair(*itData,
false));
168 if (itRetrievedData->second.first !=
r->cacheIdentifier()) {
169 itRetrievedData->second.first =
r->cacheIdentifier();
170 for (std::map<eventsetup::DataKey, bool>::iterator itDatum = retrievedData.second.second.begin(),
171 itDatumEnd = retrievedData.second.second.end();
172 itDatum != itDatumEnd;
174 itDatum->second =
false;
178 for (std::map<eventsetup::DataKey, bool>::iterator itDatum = retrievedData.second.second.begin(),
179 itDatumEnd = retrievedData.second.second.end();
180 itDatum != itDatumEnd;
182 bool wasGotten =
r->wasGotten(itDatum->first);
183 if (wasGotten != itDatum->second) {
185 msg = std::make_unique<LogSystem>(
"ESContent");
188 itDatum->second = wasGotten;
189 *
msg <<
"Retrieved> record:" << it->name() <<
" data:" << itDatum->first.type().name() <<
" '" 190 << itDatum->first.name().value() <<
"'";
194 *
msg <<
" provider:" <<
d->type_ <<
" '" <<
d->label_ <<
"'";
#define DEFINE_FWK_MODULE(type)
void endRun(edm::Run const &, edm::EventSetup const &) override
const bool m_checkDuringEvent
const bool m_checkDuringBeginRun
std::map< eventsetup::EventSetupRecordKey, std::pair< unsigned long long, std::map< eventsetup::DataKey, bool > > > RetrievedDataMap
void fillAvailableRecordKeys(std::vector< eventsetup::EventSetupRecordKey > &oToFill) const
clears the oToFill vector and then fills it with the keys for all available records ...
RetrievedDataMap m_retrievedDataMap
std::vector< eventsetup::EventSetupRecordKey > m_recordKeys
Container::value_type value_type
const bool m_printProviders
void analyze(edm::Event const &, edm::EventSetup const &) override
PrintEventSetupDataRetrieval(edm::ParameterSet const &)
void setComment(std::string const &value)
const bool m_checkDuringBeginLumi
std::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &iKey) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void check(EventSetup const &)
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
void beginRun(edm::Run const &, edm::EventSetup const &) override