CMS 3D CMS Logo

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

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

Private Member Functions

void readProvenanceAsync (WaitingTask *task, ModuleCallingContext const *moduleCallingContext, unsigned int transitionIndex, std::atomic< const std::set< ProductProvenance > * > &writeTo) const override
 

Private Attributes

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

Detailed Description

Definition at line 1832 of file RootFile.cc.

Constructor & Destructor Documentation

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

Definition at line 1854 of file RootFile.cc.

References edm::BranchTypeToProductProvenanceBranchName(), edm::WaitingTaskHolder::doneWaiting(), edm::ModuleCallingContext::getStreamContext(), edm::ServiceRegistry::instance(), cmsPerfStripChart::operate(), edm::ServiceRegistry::presentToken(), provBranch_, edm::SerialTaskQueueChain::push(), dttmaxenums::R, and rootTree_.

1857  :
1859  rootTree_(iRootTree),
1861  parentageIDLookup_(iParentageIDLookup),
1862  daqProvenanceHelper_(daqProvenanceHelper),
1863  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
1864  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first)
1865  {
1866  provBranch_ = rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
1867  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1846
U second(std::pair< T, U > const &p)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1849
static SharedResourcesRegistry * instance()
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1844
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:1847
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1848
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1850
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:131
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:1845
T first(std::pair< T, U > const &p)
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1851

Member Function Documentation

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

Implements edm::ProvenanceReaderBase.

Definition at line 1937 of file RootFile.cc.

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

Referenced by edm::FullProvenanceReader::~FullProvenanceReader().

1937  {
1938  {
1939  std::lock_guard<std::recursive_mutex> guard(*mutex_);
1940  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1941  me->rootTree_->fillBranchEntry(me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
1942  setRefCoreStreamer(true);
1943  }
1944  std::set<ProductProvenance> retValue;
1945  if(daqProvenanceHelper_) {
1946  for(auto const& prov : provVector_) {
1947  BranchID bid(prov.branchID_);
1948  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
1949  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
1950  }
1951  } else {
1952  for(auto const& prov : provVector_) {
1953  if(prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
1955  << "ReducedProvenanceReader::ReadProvenance\n"
1956  << "The parentage ID index value " << prov.parentageIDIndex_ << " is out of bounds. The maximum value is " << parentageIDLookup_.size()-1 << ".\n"
1957  << "This should never happen.\n"
1958  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1959  }
1960  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
1961  }
1962  }
1963  return retValue;
1964  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1846
BranchID const & mapBranchID(BranchID const &branchID) const
void setRefCoreStreamer(bool resetAll=false)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1849
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1848
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1850
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1854
ParentageID const & mapParentageID(ParentageID const &phid) const
void edm::ReducedProvenanceReader::readProvenanceAsync ( WaitingTask task,
ModuleCallingContext const *  moduleCallingContext,
unsigned int  transitionIndex,
std::atomic< const std::set< ProductProvenance > * > &  writeTo 
) const
overrideprivatevirtual

Implements edm::ProvenanceReaderBase.

Definition at line 1921 of file RootFile.cc.

References acquirer_, rootTree_, and edm::SharedResourcesAcquirer::serialQueueChain().

Referenced by edm::FullProvenanceReader::~FullProvenanceReader().

1925  {
1926  readProvenanceAsyncImpl(this,
1928  task,
1929  transitionIndex,
1930  writeTo,
1931  moduleCallingContext,
1932  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1933  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1934  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1844
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1851

Member Data Documentation

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 1851 of file RootFile.cc.

Referenced by readProvenanceAsync().

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1849 of file RootFile.cc.

Referenced by readProvenance().

std::shared_ptr<std::recursive_mutex> edm::ReducedProvenanceReader::mutex_
private

Definition at line 1850 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1848 of file RootFile.cc.

Referenced by readProvenance().

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1847 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1845 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1846 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1844 of file RootFile.cc.

Referenced by readProvenance(), readProvenanceAsync(), and ReducedProvenanceReader().