29 class ModuleCallingContext;
81 std::map<BranchID, bool>& oMap,
82 std::set<BranchID>& oMapperMissing) {
85 if (oMap.find(
id) == oMap.end()) {
90 markAncestors(
e, *pInfo, oMap, oMapperMissing);
92 oMapperMissing.insert(
id);
102 std::map<BranchID, bool> seenParentInPrincipal;
103 std::set<BranchID> missingFromMapper;
104 std::set<BranchID> missingProductProvenance;
106 std::map<BranchID, const BranchDescription*> idToBranchDescriptions;
110 idToBranchDescriptions[branchID] = branchDescription;
114 bool cannotFindProductProvenance =
false;
116 missingProductProvenance.insert(branchID);
117 cannotFindProductProvenance =
true;
121 missingFromMapper.insert(branchID);
124 if (cannotFindProductProvenance) {
128 seenParentInPrincipal[branchID] =
true;
134 std::set<BranchID> branchesInReg;
135 for (
auto const& product : prodList) {
136 branchesInReg.insert(product.second.branchID());
137 idToBranchDescriptions[product.second.branchID()] = &product.second;
140 std::set<BranchID> missingFromReg;
141 for (
auto const&
item : seenParentInPrincipal) {
142 if (branchesInReg.find(
item.first) == branchesInReg.end()) {
143 missingFromReg.insert(
item.first);
147 if (!missingFromMapper.empty()) {
148 LogError(
"ProvenanceChecker") <<
"Missing the following BranchIDs from ProductProvenanceRetriever\n";
149 for (std::set<BranchID>::iterator it = missingFromMapper.begin(), itEnd = missingFromMapper.end(); it != itEnd;
151 LogProblem(
"ProvenanceChecker") << *it <<
" " << *(idToBranchDescriptions[*it]);
155 if (!missingProductProvenance.empty()) {
156 LogError(
"ProvenanceChecker") <<
"The ProductResolvers for the following BranchIDs have no ProductProvenance\n";
157 for (std::set<BranchID>::iterator it = missingProductProvenance.begin(), itEnd = missingProductProvenance.end();
160 LogProblem(
"ProvenanceChecker") << *it <<
" " << *(idToBranchDescriptions[*it]);
164 if (!missingFromReg.empty()) {
165 LogError(
"ProvenanceChecker") <<
"Missing the following BranchIDs from ProductRegistry\n";
166 for (
auto const&
item : missingFromReg) {
171 if (!missingFromMapper.empty() || !missingProductProvenance.empty() || !missingFromReg.empty()) {
173 << (!missingFromMapper.empty() ?
"Having missing ancestors from ProductProvenanceRetriever.\n" :
"")
174 << (!missingProductProvenance.empty() ?
" Have missing ProductProvenance's from ProductResolver in Event.\n" 176 << (!missingFromReg.empty() ?
" Have missing info from ProductRegistry.\n" :
"");
190 descriptions.
add(
"provenanceChecker",
desc);
ProductProvenance const * productProvenance() const
BranchID const & branchID() const
std::map< BranchKey, BranchDescription > ProductList
TypeID unwrappedTypeID() const
std::vector< BranchID > const & parents() const
Log< level::Error, false > LogError
#define DEFINE_FWK_MODULE(type)
SelectedProductsForBranchType const & keptProducts() 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)
Provenance const * provenance() const noexcept(true)
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
void writeLuminosityBlock(LuminosityBlockForOutput const &) override
Log< level::Error, true > LogProblem
Parentage const & parentage() const
void writeRun(RunForOutput const &) override