CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::ReducedProvenanceReader Class Reference
Inheritance diagram for edm::ReducedProvenanceReader:
edm::ProvenanceReaderBase

Public Member Functions

 ReducedProvenanceReader (RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
 
- Public Member Functions inherited from edm::ProvenanceReaderBase
 ProvenanceReaderBase ()
 
virtual ~ProvenanceReaderBase ()
 

Private Member Functions

virtual void readProvenance (ProductProvenanceRetriever const &provRetriever, unsigned int) const override
 

Private Attributes

DaqProvenanceHelper const * daqProvenanceHelper_
 
std::vector< ParentageID > const & parentageIDLookup_
 
StoredProductProvenanceVectorpProvVector_
 
TBranch * provBranch_
 
StoredProductProvenanceVector provVector_
 
SharedResourcesAcquirer resourceAcquirer_
 
RootTreerootTree_
 

Detailed Description

Definition at line 1759 of file RootFile.cc.

Constructor & Destructor Documentation

edm::ReducedProvenanceReader::ReducedProvenanceReader ( RootTree iRootTree,
std::vector< ParentageID > const &  iParentageIDLookup,
DaqProvenanceHelper const *  daqProvenanceHelper 
)

Definition at line 1773 of file RootFile.cc.

References edm::RootTree::branchType(), edm::BranchTypeToProductProvenanceBranchName(), provBranch_, rootTree_, and edm::RootTree::tree().

1776  :
1778  rootTree_(iRootTree),
1780  parentageIDLookup_(iParentageIDLookup),
1781  daqProvenanceHelper_(daqProvenanceHelper),
1782  resourceAcquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader())
1783  {
1785  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1766
StoredProductProvenanceVector * pProvVector_
Definition: RootFile.cc:1767
TTree const * tree() const
Definition: RootTree.h:137
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1769
static SharedResourcesRegistry * instance()
BranchType branchType() const
Definition: RootTree.h:151
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1768
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:130
SharedResourcesAcquirer resourceAcquirer_
Definition: RootFile.cc:1770

Member Function Documentation

void edm::ReducedProvenanceReader::readProvenance ( ProductProvenanceRetriever const &  provRetriever,
unsigned int  transitionIndex 
) const
overrideprivatevirtual

Implements edm::ProvenanceReaderBase.

Definition at line 1788 of file RootFile.cc.

References daqProvenanceHelper_, edm::RootTree::entryNumberForIndex(), edm::hlt::Exception, edm::RootTree::fillBranchEntry(), edm::ProductProvenanceRetriever::insertIntoSet(), edm::errors::LogicError, edm::DaqProvenanceHelper::mapBranchID(), edm::DaqProvenanceHelper::mapParentageID(), parentageIDLookup_, pProvVector_, provBranch_, provVector_, resourceAcquirer_, rootTree_, and edm::setRefCoreStreamer().

1788  {
1789  {
1790  std::lock_guard<SharedResourcesAcquirer> guard(resourceAcquirer_);
1791  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1792  me->rootTree_->fillBranchEntry(me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
1793  setRefCoreStreamer(true);
1794  }
1795  if(daqProvenanceHelper_) {
1796  for(auto const& prov : provVector_) {
1797  BranchID bid(prov.branchID_);
1798  provRetriever.insertIntoSet(ProductProvenance(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
1799  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_])));
1800  }
1801  } else {
1802  for(auto const& prov : provVector_) {
1803  if(prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
1805  << "ReducedProvenanceReader::ReadProvenance\n"
1806  << "The parentage ID index value " << prov.parentageIDIndex_ << " is out of bounds. The maximum value is " << parentageIDLookup_.size()-1 << ".\n"
1807  << "This should never happen.\n"
1808  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1809  }
1810  provRetriever.insertIntoSet(ProductProvenance(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]));
1811  }
1812  }
1813  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1766
BranchID const & mapBranchID(BranchID const &branchID) const
void setRefCoreStreamer(bool resetAll=false)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1769
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1768
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1773
ParentageID const & mapParentageID(ParentageID const &phid) const
SharedResourcesAcquirer resourceAcquirer_
Definition: RootFile.cc:1770

Member Data Documentation

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1769 of file RootFile.cc.

Referenced by readProvenance().

std::vector<ParentageID> const& edm::ReducedProvenanceReader::parentageIDLookup_
private

Definition at line 1768 of file RootFile.cc.

Referenced by readProvenance().

StoredProductProvenanceVector* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1767 of file RootFile.cc.

Referenced by readProvenance().

TBranch* edm::ReducedProvenanceReader::provBranch_
private

Definition at line 1765 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1766 of file RootFile.cc.

Referenced by readProvenance().

SharedResourcesAcquirer edm::ReducedProvenanceReader::resourceAcquirer_
mutableprivate

Definition at line 1770 of file RootFile.cc.

Referenced by readProvenance().

RootTree* edm::ReducedProvenanceReader::rootTree_
private

Definition at line 1764 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().