29 class ModuleCallingContext;
80 std::map<BranchID, bool>& oMap,
81 std::set<BranchID>& oMapperMissing) {
84 if (oMap.find(
id) == oMap.end()) {
89 markAncestors(e, *pInfo, oMap, oMapperMissing);
91 oMapperMissing.insert(
id);
101 std::map<BranchID, bool> seenParentInPrincipal;
102 std::set<BranchID> missingFromMapper;
103 std::set<BranchID> missingProductProvenance;
105 std::map<BranchID, const BranchDescription*> idToBranchDescriptions;
109 idToBranchDescriptions[branchID] = branchDescription;
113 bool cannotFindProductProvenance =
false;
115 missingProductProvenance.insert(branchID);
116 cannotFindProductProvenance =
true;
120 missingFromMapper.insert(branchID);
123 if (cannotFindProductProvenance) {
127 seenParentInPrincipal[branchID] =
true;
133 std::set<BranchID> branchesInReg;
134 for (
auto const& product : prodList) {
135 branchesInReg.insert(product.second.branchID());
136 idToBranchDescriptions[product.second.branchID()] = &product.second;
139 std::set<BranchID> missingFromReg;
140 for (
auto const& item : seenParentInPrincipal) {
141 if (branchesInReg.find(item.first) == branchesInReg.end()) {
142 missingFromReg.insert(item.first);
146 if (!missingFromMapper.empty()) {
147 LogError(
"ProvenanceChecker") <<
"Missing the following BranchIDs from ProductProvenanceRetriever\n";
148 for (std::set<BranchID>::iterator it = missingFromMapper.begin(), itEnd = missingFromMapper.end(); it != itEnd;
150 LogProblem(
"ProvenanceChecker") << *it <<
" " << *(idToBranchDescriptions[*it]);
154 if (!missingProductProvenance.empty()) {
155 LogError(
"ProvenanceChecker") <<
"The ProductResolvers for the following BranchIDs have no ProductProvenance\n";
156 for (std::set<BranchID>::iterator it = missingProductProvenance.begin(), itEnd = missingProductProvenance.end();
159 LogProblem(
"ProvenanceChecker") << *it <<
" " << *(idToBranchDescriptions[*it]);
163 if (!missingFromReg.empty()) {
164 LogError(
"ProvenanceChecker") <<
"Missing the following BranchIDs from ProductRegistry\n";
165 for (
auto const& item : missingFromReg) {
166 LogProblem(
"ProvenanceChecker") << item <<
" " << *(idToBranchDescriptions[item]);
170 if (!missingFromMapper.empty() || !missingProductProvenance.empty() || !missingFromReg.empty()) {
172 << (!missingFromMapper.empty() ?
"Having missing ancestors from ProductProvenanceRetriever.\n" :
"")
173 << (!missingProductProvenance.empty() ?
" Have missing ProductProvenance's from ProductResolver in Event.\n" 175 << (!missingFromReg.empty() ?
" Have missing info from ProductRegistry.\n" :
"");
189 descriptions.
add(
"provenanceChecker", desc);
BasicHandle getByToken(EDGetToken token, TypeID const &typeID) const
std::map< BranchKey, BranchDescription > ProductList
Provenance const * provenance() const (true)
ProductProvenance const * productProvenance() const
SelectedProductsForBranchType const & keptProducts() const
std::vector< BranchID > const & parents() const
#define DEFINE_FWK_MODULE(type)
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
TypeID unwrappedTypeID() const
BranchID const & branchID() const
Provenance getProvenance(BranchID const &theID) const
~ProvenanceCheckerOutputModule() override
void write(EventForOutput const &e) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ProvenanceCheckerOutputModule(ParameterSet const &pset)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Parentage const & parentage() const
void writeLuminosityBlock(LuminosityBlockForOutput const &) override
void writeRun(RunForOutput const &) override