#include <BranchMapper.h>
Public Member Functions | |
ProductProvenance const * | branchIDToProvenance (BranchID const &bid) const |
BranchMapper () | |
BranchMapper (std::unique_ptr< ProvenanceReaderBase > reader) | |
void | insertIntoSet (ProductProvenance const &provenanceProduct) const |
void | mergeMappers (boost::shared_ptr< BranchMapper > other) |
void | reset () |
~BranchMapper () | |
Private Types | |
typedef std::set < ProductProvenance > | eiSet |
Private Member Functions | |
void | readProvenance () const |
Private Attributes | |
bool | delayedRead_ |
eiSet | entryInfoSet_ |
boost::shared_ptr< BranchMapper > | nextMapper_ |
boost::scoped_ptr < ProvenanceReaderBase > | provenanceReader_ |
Definition at line 28 of file BranchMapper.h.
typedef std::set<ProductProvenance> edm::BranchMapper::eiSet [private] |
Definition at line 47 of file BranchMapper.h.
edm::BranchMapper::BranchMapper | ( | ) |
Definition at line 12 of file BranchMapper.cc.
: entryInfoSet_(), nextMapper_(), delayedRead_(false), provenanceReader_() { }
edm::BranchMapper::BranchMapper | ( | std::unique_ptr< ProvenanceReaderBase > | reader | ) | [explicit] |
Definition at line 19 of file BranchMapper.cc.
References provenanceReader_.
: entryInfoSet_(), nextMapper_(), delayedRead_(true), provenanceReader_(reader.release()) { assert(provenanceReader_); }
edm::BranchMapper::~BranchMapper | ( | ) |
Definition at line 27 of file BranchMapper.cc.
{}
ProductProvenance const * edm::BranchMapper::branchIDToProvenance | ( | BranchID const & | bid | ) | const |
Definition at line 58 of file BranchMapper.cc.
References entryInfoSet_, nextMapper_, and readProvenance().
Referenced by edm::RootOutputFile::insertAncestors().
{ readProvenance(); ProductProvenance ei(bid); eiSet::const_iterator it = entryInfoSet_.find(ei); if(it == entryInfoSet_.end()) { if(nextMapper_) { return nextMapper_->branchIDToProvenance(bid); } else { return 0; } } return &*it; }
void edm::BranchMapper::insertIntoSet | ( | ProductProvenance const & | provenanceProduct | ) | const |
Definition at line 44 of file BranchMapper.cc.
References entryInfoSet_.
Referenced by edm::FullProvenanceReader::readProvenance().
{ //NOTE:do not read provenance here because we only need the full // provenance when someone tries to access it not when doing the insert // doing the delay saves 20% of time when doing an analysis job //readProvenance(); entryInfoSet_.insert(entryInfo); }
void edm::BranchMapper::mergeMappers | ( | boost::shared_ptr< BranchMapper > | other | ) |
void edm::BranchMapper::readProvenance | ( | ) | const [private] |
Definition at line 30 of file BranchMapper.cc.
References delayedRead_, and provenanceReader_.
Referenced by branchIDToProvenance().
{ if(delayedRead_ && provenanceReader_) { provenanceReader_->readProvenance(*this); delayedRead_ = false; // only read once } }
void edm::BranchMapper::reset | ( | void | ) |
Definition at line 38 of file BranchMapper.cc.
References delayedRead_, and entryInfoSet_.
{ entryInfoSet_.clear(); delayedRead_ = true; }
bool edm::BranchMapper::delayedRead_ [mutable, private] |
Definition at line 51 of file BranchMapper.h.
Referenced by readProvenance(), and reset().
eiSet edm::BranchMapper::entryInfoSet_ [mutable, private] |
Definition at line 49 of file BranchMapper.h.
Referenced by branchIDToProvenance(), insertIntoSet(), and reset().
boost::shared_ptr<BranchMapper> edm::BranchMapper::nextMapper_ [private] |
Definition at line 50 of file BranchMapper.h.
Referenced by branchIDToProvenance(), and mergeMappers().
boost::scoped_ptr<ProvenanceReaderBase> edm::BranchMapper::provenanceReader_ [mutable, private] |
Definition at line 52 of file BranchMapper.h.
Referenced by BranchMapper(), and readProvenance().