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 (WaitingTaskHolder 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 1882 of file RootFile.cc.

Constructor & Destructor Documentation

◆ ReducedProvenanceReader()

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

Definition at line 1906 of file RootFile.cc.

1910  rootTree_(iRootTree),
1912  parentageIDLookup_(iParentageIDLookup),
1913  daqProvenanceHelper_(daqProvenanceHelper),
1914  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
1915  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
1916  provBranch_ =
1917  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
1918  }

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

Member Function Documentation

◆ readProvenance()

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

Implements edm::ProvenanceReaderBase.

Definition at line 1994 of file RootFile.cc.

1994  {
1995  {
1996  std::lock_guard<std::recursive_mutex> guard(*mutex_);
1997  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1998  me->rootTree_->fillBranchEntry(
1999  me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
2000  }
2001  std::set<ProductProvenance> retValue;
2002  if (daqProvenanceHelper_) {
2003  for (auto const& prov : provVector_) {
2004  BranchID bid(prov.branchID_);
2005  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
2006  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
2007  }
2008  } else {
2009  for (auto const& prov : provVector_) {
2010  if (prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
2012  << "ReducedProvenanceReader::ReadProvenance\n"
2013  << "The parentage ID index value " << prov.parentageIDIndex_
2014  << " is out of bounds. The maximum value is " << parentageIDLookup_.size() - 1 << ".\n"
2015  << "This should never happen.\n"
2016  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
2017  }
2018  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
2019  }
2020  }
2021  return retValue;
2022  }

References daqProvenanceHelper_, Exception, edm::errors::LogicError, edm::DaqProvenanceHelper::mapBranchID(), edm::DaqProvenanceHelper::mapParentageID(), hlt_dqm_clientPB-live_cfg::me, mutex_, parentageIDLookup_, and provVector_.

◆ readProvenanceAsync()

void edm::ReducedProvenanceReader::readProvenanceAsync ( WaitingTaskHolder  task,
ModuleCallingContext const *  moduleCallingContext,
unsigned int  transitionIndex,
std::atomic< const std::set< ProductProvenance > * > &  writeTo 
) const
overrideprivatevirtual

Implements edm::ProvenanceReaderBase.

Definition at line 1980 of file RootFile.cc.

1983  {
1984  readProvenanceAsyncImpl(this,
1986  task,
1987  transitionIndex,
1988  writeTo,
1989  moduleCallingContext,
1990  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1991  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1992  }

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

Member Data Documentation

◆ acquirer_

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 1903 of file RootFile.cc.

Referenced by readProvenanceAsync().

◆ daqProvenanceHelper_

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1901 of file RootFile.cc.

Referenced by readProvenance().

◆ mutex_

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

Definition at line 1902 of file RootFile.cc.

Referenced by readProvenance().

◆ parentageIDLookup_

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

Definition at line 1900 of file RootFile.cc.

Referenced by readProvenance().

◆ pProvVector_

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1899 of file RootFile.cc.

◆ provBranch_

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

Definition at line 1897 of file RootFile.cc.

Referenced by ReducedProvenanceReader().

◆ provVector_

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1898 of file RootFile.cc.

Referenced by readProvenance().

◆ rootTree_

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

Definition at line 1896 of file RootFile.cc.

Referenced by readProvenanceAsync(), and ReducedProvenanceReader().

edm::SharedResourcesAcquirer::serialQueueChain
SerialTaskQueueChain & serialQueueChain() const
Definition: SharedResourcesAcquirer.h:54
edm::ReducedProvenanceReader::provBranch_
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:1897
edm::DaqProvenanceHelper::mapParentageID
ParentageID const & mapParentageID(ParentageID const &phid) const
Definition: DaqProvenanceHelper.cc:182
edm::ReducedProvenanceReader::provVector_
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1898
edm::errors::LogicError
Definition: EDMException.h:37
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::first
T first(std::pair< T, U > const &p)
Definition: ParameterSet.cc:217
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
edm::ReducedProvenanceReader::rootTree_
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1896
edm::SharedResourcesRegistry::instance
static SharedResourcesRegistry * instance()
Definition: SharedResourcesRegistry.cc:25
edm::ReducedProvenanceReader::parentageIDLookup_
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1900
edm::DaqProvenanceHelper::mapBranchID
BranchID const & mapBranchID(BranchID const &branchID) const
Definition: DaqProvenanceHelper.cc:191
edm::ReducedProvenanceReader::acquirer_
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1903
edm::BranchTypeToProductProvenanceBranchName
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:132
edm::ReducedProvenanceReader::daqProvenanceHelper_
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1901
Exception
Definition: hltDiff.cc:245
edm::ReducedProvenanceReader::pProvVector_
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:1899
edm::ProvenanceReaderBase::ProvenanceReaderBase
ProvenanceReaderBase()
Definition: ProductProvenanceRetriever.h:47
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
edm::ReducedProvenanceReader::ReducedProvenanceReader
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1906
edm::ReducedProvenanceReader::mutex_
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1902