109 std::map<BranchID, bool> seenParentInPrincipal;
110 std::set<BranchID> missingFromMapper;
111 std::set<BranchID> missingProductProvenance;
113 std::map<BranchID, const BranchDescription*> idToBranchDescriptions;
115 BranchDescription
const* branchDescription = product.first;
116 BranchID branchID = branchDescription->branchID();
117 idToBranchDescriptions[branchID] = branchDescription;
118 TypeID
const& tid(branchDescription->unwrappedTypeID());
121 e.getByToken(token, tid, bh);
122 bool cannotFindProductProvenance=
false;
123 if(!(bh.provenance() and bh.provenance()->productProvenance())) {
124 missingProductProvenance.insert(branchID);
125 cannotFindProductProvenance=
true;
127 ProductProvenance
const* pInfo =
e.getProvenance(branchID).productProvenance();
129 missingFromMapper.insert(branchID);
132 if(cannotFindProductProvenance) {
135 markAncestors(
e, *(bh.provenance()->productProvenance()), seenParentInPrincipal, missingFromMapper);
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" :
"");
std::map< BranchKey, BranchDescription > ProductList
SelectedProductsForBranchType const & keptProducts() const