30 class ModuleCallingContext;
87 std::map<BranchID, bool>& oMap,
88 std::set<BranchID>& oMapperMissing) {
91 if(oMap.find(
id) == oMap.end()) {
96 markAncestors(e, *pInfo, oMap, oMapperMissing);
98 oMapperMissing.insert(
id);
109 std::map<BranchID, bool> seenParentInPrincipal;
110 std::set<BranchID> missingFromMapper;
111 std::set<BranchID> missingProductProvenance;
113 std::map<BranchID, const BranchDescription*> idToBranchDescriptions;
117 idToBranchDescriptions[branchID] = branchDescription;
122 bool cannotFindProductProvenance=
false;
124 missingProductProvenance.insert(branchID);
125 cannotFindProductProvenance=
true;
129 missingFromMapper.insert(branchID);
132 if(cannotFindProductProvenance) {
136 seenParentInPrincipal[branchID] =
true;
142 std::set<BranchID> branchesInReg;
143 for(
auto const& product : prodList) {
144 branchesInReg.insert(product.second.branchID());
145 idToBranchDescriptions[product.second.branchID()] = &product.second;
148 std::set<BranchID> missingFromReg;
149 for(
auto const& item : seenParentInPrincipal) {
150 if(branchesInReg.find(item.first) == branchesInReg.end()) {
151 missingFromReg.insert(item.first);
155 if(!missingFromMapper.empty()) {
156 LogError(
"ProvenanceChecker") <<
"Missing the following BranchIDs from ProductProvenanceRetriever\n";
157 for(std::set<BranchID>::iterator it = missingFromMapper.begin(), itEnd = missingFromMapper.end();
160 LogProblem(
"ProvenanceChecker") << *it<<
" "<<*(idToBranchDescriptions[*it]);
164 if(!missingProductProvenance.empty()) {
165 LogError(
"ProvenanceChecker") <<
"The ProductResolvers for the following BranchIDs have no ProductProvenance\n";
166 for(std::set<BranchID>::iterator it = missingProductProvenance.begin(), itEnd = missingProductProvenance.end();
169 LogProblem(
"ProvenanceChecker") << *it<<
" "<<*(idToBranchDescriptions[*it]);
173 if(!missingFromReg.empty()) {
174 LogError(
"ProvenanceChecker") <<
"Missing the following BranchIDs from ProductRegistry\n";
175 for(
auto const& item : missingFromReg) {
176 LogProblem(
"ProvenanceChecker") << item <<
" " << *(idToBranchDescriptions[item]);
180 if(!missingFromMapper.empty() || !missingProductProvenance.empty() || !missingFromReg.empty()) {
182 << (!missingFromMapper.empty() ?
"Having missing ancestors from ProductProvenanceRetriever.\n" :
"")
183 << (!missingProductProvenance.empty() ?
" Have missing ProductProvenance's from ProductResolver in Event.\n" :
"")
184 << (!missingFromReg.empty() ?
" Have missing info from ProductRegistry.\n" :
"");
199 descriptions.
add(
"provenanceChecker", desc);
#define DEFINE_FWK_MODULE(type)
std::map< BranchKey, BranchDescription > ProductList
ProductProvenance const * productProvenance() const
SelectedProductsForBranchType const & keptProducts() const
std::vector< BranchID > const & parents() const
bool getByToken(EDGetToken token, TypeID const &typeID, BasicHandle &result) const
Provenance const * provenance() const
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