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

Constructor & Destructor Documentation

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

Definition at line 1853 of file RootFile.cc.

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

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

Member Function Documentation

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

Implements edm::ProvenanceReaderBase.

Definition at line 1931 of file RootFile.cc.

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

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

1931  {
1932  {
1933  std::lock_guard<std::recursive_mutex> guard(*mutex_);
1934  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1935  me->rootTree_->fillBranchEntry(me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
1936  }
1937  std::set<ProductProvenance> retValue;
1938  if(daqProvenanceHelper_) {
1939  for(auto const& prov : provVector_) {
1940  BranchID bid(prov.branchID_);
1941  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
1942  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
1943  }
1944  } else {
1945  for(auto const& prov : provVector_) {
1946  if(prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
1948  << "ReducedProvenanceReader::ReadProvenance\n"
1949  << "The parentage ID index value " << prov.parentageIDIndex_ << " is out of bounds. The maximum value is " << parentageIDLookup_.size()-1 << ".\n"
1950  << "This should never happen.\n"
1951  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1952  }
1953  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
1954  }
1955  }
1956  return retValue;
1957  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1845
BranchID const & mapBranchID(BranchID const &branchID) const
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1848
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1847
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1849
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1853
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 1915 of file RootFile.cc.

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

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

1919  {
1920  readProvenanceAsyncImpl(this,
1922  task,
1923  transitionIndex,
1924  writeTo,
1925  moduleCallingContext,
1926  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1927  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1928  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1843
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1850

Member Data Documentation

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 1850 of file RootFile.cc.

Referenced by readProvenanceAsync().

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1848 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1849 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1847 of file RootFile.cc.

Referenced by readProvenance().

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1846 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1844 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1845 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1843 of file RootFile.cc.

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