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

Constructor & Destructor Documentation

◆ ReducedProvenanceReader()

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

Definition at line 1901 of file RootFile.cc.

1905  rootTree_(iRootTree),
1907  parentageIDLookup_(iParentageIDLookup),
1908  daqProvenanceHelper_(daqProvenanceHelper),
1909  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
1910  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
1911  provBranch_ =
1912  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
1913  }

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

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

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 ( WaitingTask task,
ModuleCallingContext const *  moduleCallingContext,
unsigned int  transitionIndex,
std::atomic< const std::set< ProductProvenance > * > &  writeTo 
) const
overrideprivatevirtual

Implements edm::ProvenanceReaderBase.

Definition at line 1973 of file RootFile.cc.

1976  {
1977  readProvenanceAsyncImpl(this,
1979  task,
1980  transitionIndex,
1981  writeTo,
1982  moduleCallingContext,
1983  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1984  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1985  }

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

Member Data Documentation

◆ acquirer_

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 1898 of file RootFile.cc.

Referenced by readProvenanceAsync().

◆ daqProvenanceHelper_

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1896 of file RootFile.cc.

Referenced by readProvenance().

◆ mutex_

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

Definition at line 1897 of file RootFile.cc.

Referenced by readProvenance().

◆ parentageIDLookup_

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

Definition at line 1895 of file RootFile.cc.

Referenced by readProvenance().

◆ pProvVector_

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1894 of file RootFile.cc.

◆ provBranch_

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

Definition at line 1892 of file RootFile.cc.

Referenced by ReducedProvenanceReader().

◆ provVector_

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1893 of file RootFile.cc.

Referenced by readProvenance().

◆ rootTree_

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

Definition at line 1891 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:1892
edm::DaqProvenanceHelper::mapParentageID
ParentageID const & mapParentageID(ParentageID const &phid) const
Definition: DaqProvenanceHelper.cc:182
edm::ReducedProvenanceReader::provVector_
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1893
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:1891
edm::SharedResourcesRegistry::instance
static SharedResourcesRegistry * instance()
Definition: SharedResourcesRegistry.cc:25
edm::ReducedProvenanceReader::parentageIDLookup_
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1895
edm::DaqProvenanceHelper::mapBranchID
BranchID const & mapBranchID(BranchID const &branchID) const
Definition: DaqProvenanceHelper.cc:191
edm::ReducedProvenanceReader::acquirer_
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1898
edm::BranchTypeToProductProvenanceBranchName
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:132
edm::ReducedProvenanceReader::daqProvenanceHelper_
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1896
Exception
Definition: hltDiff.cc:246
edm::ReducedProvenanceReader::pProvVector_
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:1894
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:1901
edm::ReducedProvenanceReader::mutex_
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1897