82 std::map<BranchID, bool>& oMap,
83 std::set<BranchID>& oMapperMissing) {
84 for(std::vector<BranchID>::const_iterator it = iInfo.
parentage().
parents().begin(),
89 if(oMap.find(*it) == oMap.end()) {
94 markAncestors(*pInfo, iMapper, oMap, oMapperMissing);
96 oMapperMissing.insert(*it);
108 std::map<BranchID, bool> seenParentInPrincipal;
109 std::set<BranchID> missingFromMapper;
110 std::set<BranchID> missingProductProvenance;
116 BranchID branchID = (*it)->branchDescription().branchID();
117 if((*it)->productUnavailable()) {
121 if(!(*it)->productProvenancePtr().get() ) {
122 missingProductProvenance.insert(branchID);
125 boost::shared_ptr<ProductProvenance> pInfo = mapperPtr->branchIDToProvenance(branchID);
127 missingFromMapper.insert(branchID);
129 markAncestors(*((*it)->productProvenancePtr()),*mapperPtr, seenParentInPrincipal, missingFromMapper);
131 seenParentInPrincipal[branchID] =
true;
138 std::set<BranchID> branchesInReg;
139 for(ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end();
142 branchesInReg.insert(it->second.branchID());
145 std::set<BranchID> missingFromPrincipal;
146 std::set<BranchID> missingFromReg;
147 for(std::map<BranchID, bool>::iterator it = seenParentInPrincipal.begin(), itEnd = seenParentInPrincipal.end();
151 missingFromPrincipal.insert(it->first);
153 if(branchesInReg.find(it->first) == branchesInReg.end()) {
154 missingFromReg.insert(it->first);
158 if(missingFromMapper.size()) {
159 LogError(
"ProvenanceChecker") <<
"Missing the following BranchIDs from BranchMapper\n";
160 for(std::set<BranchID>::iterator it = missingFromMapper.begin(), itEnd = missingFromMapper.end();
166 if(missingFromPrincipal.size()) {
167 LogError(
"ProvenanceChecker") <<
"Missing the following BranchIDs from EventPrincipal\n";
168 for(std::set<BranchID>::iterator it = missingFromPrincipal.begin(), itEnd = missingFromPrincipal.end();
175 if(missingProductProvenance.size()) {
176 LogError(
"ProvenanceChecker") <<
"The Groups for the following BranchIDs have no ProductProvenance\n";
177 for(std::set<BranchID>::iterator it = missingProductProvenance.begin(), itEnd = missingProductProvenance.end();
184 if(missingFromReg.size()) {
185 LogError(
"ProvenanceChecker") <<
"Missing the following BranchIDs from ProductRegistry\n";
186 for(std::set<BranchID>::iterator it = missingFromReg.begin(), itEnd = missingFromReg.end();
193 if(missingFromMapper.size() || missingFromPrincipal.size() || missingProductProvenance.size() || missingFromReg.size()) {
195 << (missingFromMapper.size() || missingFromPrincipal.size() ?
"Having missing ancestors" :
"")
196 << (missingFromMapper.size() ?
" from BranchMapper" :
"")
197 << (missingFromMapper.size() && missingFromPrincipal.size() ?
" and" :
"")
198 << (missingFromPrincipal.size() ?
" from EventPrincipal" :
"")
199 << (missingFromMapper.size() || missingFromPrincipal.size() ?
".\n" :
"")
200 << (missingProductProvenance.size() ?
" Have missing ProductProvenance's from Group in EventPrincipal.\n" :
"")
201 << (missingFromReg.size() ?
" Have missing info from ProductRegistry.\n" :
"");
216 descriptions.
add(
"provenanceChecker", desc);
ProductRegistry const & productRegistry() const
const_iterator end() const
#define DEFINE_FWK_MODULE(type)
std::map< BranchKey, BranchDescription > ProductList
virtual void writeRun(RunPrincipal const &)
std::vector< BranchID > const & parents() const
ProductList const & productList() const
OutputHandle getForOutput(BranchID const &bid, bool getProd) const
virtual ~ProvenanceCheckerOutputModule()
virtual void writeLuminosityBlock(LuminosityBlockPrincipal const &)
boost::shared_ptr< ProductProvenance > branchIDToProvenance(BranchID const &bid) const
virtual void write(EventPrincipal const &e)
const_iterator begin() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ProvenanceCheckerOutputModule(ParameterSet const &pset)
static void fillDescription(ParameterSetDescription &desc)
boost::filter_iterator< FilledGroupPtr, GroupCollection::const_iterator > const_iterator
author Stefano ARGIRO author Bill Tanenbaum
boost::shared_ptr< BranchMapper > branchMapperPtr() const
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Parentage const & parentage() const