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 std::set
< ProductProvenance
readProvenance (unsigned int) const override
 

Private Attributes

DaqProvenanceHelper const * daqProvenanceHelper_
 
std::vector< ParentageID > const & parentageIDLookup_
 
StoredProductProvenanceVector
const * 
pProvVector_
 
edm::propagate_const< TBranch * > provBranch_
 
StoredProductProvenanceVector provVector_
 
SharedResourcesAcquirer resourceAcquirer_
 
edm::propagate_const< RootTree * > rootTree_
 

Detailed Description

Definition at line 1810 of file RootFile.cc.

Constructor & Destructor Documentation

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

Definition at line 1824 of file RootFile.cc.

References edm::BranchTypeToProductProvenanceBranchName(), provBranch_, and rootTree_.

1827  :
1829  rootTree_(iRootTree),
1831  parentageIDLookup_(iParentageIDLookup),
1832  daqProvenanceHelper_(daqProvenanceHelper),
1833  resourceAcquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader())
1834  {
1835  provBranch_ = rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
1836  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1817
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1820
static SharedResourcesRegistry * instance()
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1815
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:1818
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1819
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:131
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:1816
SharedResourcesAcquirer resourceAcquirer_
Definition: RootFile.cc:1821

Member Function Documentation

std::set< ProductProvenance > edm::ReducedProvenanceReader::readProvenance ( unsigned int  transitionIndex) const
overrideprivatevirtual

Implements edm::ProvenanceReaderBase.

Definition at line 1839 of file RootFile.cc.

References daqProvenanceHelper_, Exception, edm::errors::LogicError, edm::DaqProvenanceHelper::mapBranchID(), edm::DaqProvenanceHelper::mapParentageID(), parentageIDLookup_, pProvVector_, provBranch_, provVector_, resourceAcquirer_, rootTree_, and edm::setRefCoreStreamer().

1839  {
1840  {
1841  std::lock_guard<SharedResourcesAcquirer> guard(resourceAcquirer_);
1842  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1843  me->rootTree_->fillBranchEntry(me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
1844  setRefCoreStreamer(true);
1845  }
1846  std::set<ProductProvenance> retValue;
1847  if(daqProvenanceHelper_) {
1848  for(auto const& prov : provVector_) {
1849  BranchID bid(prov.branchID_);
1850  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
1851  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
1852  }
1853  } else {
1854  for(auto const& prov : provVector_) {
1855  if(prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
1857  << "ReducedProvenanceReader::ReadProvenance\n"
1858  << "The parentage ID index value " << prov.parentageIDIndex_ << " is out of bounds. The maximum value is " << parentageIDLookup_.size()-1 << ".\n"
1859  << "This should never happen.\n"
1860  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1861  }
1862  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
1863  }
1864  }
1865  return retValue;
1866  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1817
BranchID const & mapBranchID(BranchID const &branchID) const
void setRefCoreStreamer(bool resetAll=false)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1820
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1819
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1824
ParentageID const & mapParentageID(ParentageID const &phid) const
SharedResourcesAcquirer resourceAcquirer_
Definition: RootFile.cc:1821

Member Data Documentation

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1820 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1819 of file RootFile.cc.

Referenced by readProvenance().

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1818 of file RootFile.cc.

Referenced by readProvenance().

edm::propagate_const<TBranch*> edm::ReducedProvenanceReader::provBranch_
private

Definition at line 1816 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1817 of file RootFile.cc.

Referenced by readProvenance().

SharedResourcesAcquirer edm::ReducedProvenanceReader::resourceAcquirer_
mutableprivate

Definition at line 1821 of file RootFile.cc.

Referenced by readProvenance().

edm::propagate_const<RootTree*> edm::ReducedProvenanceReader::rootTree_
private

Definition at line 1815 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().