CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

edm::BranchMapper Class Reference

#include <BranchMapper.h>

List of all members.

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< BranchMappernextMapper_
boost::scoped_ptr
< ProvenanceReaderBase
provenanceReader_

Detailed Description

Definition at line 28 of file BranchMapper.h.


Member Typedef Documentation

typedef std::set<ProductProvenance> edm::BranchMapper::eiSet [private]

Definition at line 47 of file BranchMapper.h.


Constructor & Destructor Documentation

edm::BranchMapper::BranchMapper ( )

Definition at line 12 of file BranchMapper.cc.

edm::BranchMapper::BranchMapper ( std::unique_ptr< ProvenanceReaderBase reader) [explicit]

Definition at line 19 of file BranchMapper.cc.

References provenanceReader_.

edm::BranchMapper::~BranchMapper ( )

Definition at line 27 of file BranchMapper.cc.

{}

Member Function Documentation

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)

Definition at line 53 of file BranchMapper.cc.

References nextMapper_.

                                                                {
    nextMapper_ = 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;
  }

Member Data Documentation

bool edm::BranchMapper::delayedRead_ [mutable, private]

Definition at line 51 of file BranchMapper.h.

Referenced by readProvenance(), and reset().

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().