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 1849 of file RootFile.cc.

Constructor & Destructor Documentation

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

Definition at line 1863 of file RootFile.cc.

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

1866  :
1868  rootTree_(iRootTree),
1870  parentageIDLookup_(iParentageIDLookup),
1871  daqProvenanceHelper_(daqProvenanceHelper),
1872  resourceAcquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader())
1873  {
1875  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1856
StoredProductProvenanceVector * pProvVector_
Definition: RootFile.cc:1857
TTree const * tree() const
Definition: RootTree.h:140
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1859
static SharedResourcesRegistry * instance()
BranchType branchType() const
Definition: RootTree.h:154
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1858
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:131
SharedResourcesAcquirer resourceAcquirer_
Definition: RootFile.cc:1860

Member Function Documentation

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

Implements edm::ProvenanceReaderBase.

Definition at line 1878 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().

1878  {
1879  {
1880  std::lock_guard<SharedResourcesAcquirer> guard(resourceAcquirer_);
1881  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1882  me->rootTree_->fillBranchEntry(me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
1883  setRefCoreStreamer(true);
1884  }
1885  if(daqProvenanceHelper_) {
1886  for(auto const& prov : provVector_) {
1887  BranchID bid(prov.branchID_);
1888  provRetriever.insertIntoSet(ProductProvenance(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
1889  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_])));
1890  }
1891  } else {
1892  for(auto const& prov : provVector_) {
1893  if(prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
1895  << "ReducedProvenanceReader::ReadProvenance\n"
1896  << "The parentage ID index value " << prov.parentageIDIndex_ << " is out of bounds. The maximum value is " << parentageIDLookup_.size()-1 << ".\n"
1897  << "This should never happen.\n"
1898  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1899  }
1900  provRetriever.insertIntoSet(ProductProvenance(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]));
1901  }
1902  }
1903  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1856
BranchID const & mapBranchID(BranchID const &branchID) const
void setRefCoreStreamer(bool resetAll=false)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1859
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1858
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1863
ParentageID const & mapParentageID(ParentageID const &phid) const
SharedResourcesAcquirer resourceAcquirer_
Definition: RootFile.cc:1860

Member Data Documentation

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1859 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1858 of file RootFile.cc.

Referenced by readProvenance().

StoredProductProvenanceVector* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1857 of file RootFile.cc.

Referenced by readProvenance().

TBranch* edm::ReducedProvenanceReader::provBranch_
private

Definition at line 1855 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1856 of file RootFile.cc.

Referenced by readProvenance().

SharedResourcesAcquirer edm::ReducedProvenanceReader::resourceAcquirer_
mutableprivate

Definition at line 1860 of file RootFile.cc.

Referenced by readProvenance().

RootTree* edm::ReducedProvenanceReader::rootTree_
private

Definition at line 1854 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().