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

Constructor & Destructor Documentation

◆ ReducedProvenanceReader()

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

Definition at line 1881 of file RootFile.cc.

1885  rootTree_(iRootTree),
1887  parentageIDLookup_(iParentageIDLookup),
1888  daqProvenanceHelper_(daqProvenanceHelper),
1889  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
1890  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
1891  provBranch_ =
1892  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
1893  }

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

1967  {
1968  {
1969  std::lock_guard<std::recursive_mutex> guard(*mutex_);
1970  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1971  me->rootTree_->fillBranchEntry(
1972  me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
1973  }
1974  std::set<ProductProvenance> retValue;
1975  if (daqProvenanceHelper_) {
1976  for (auto const& prov : provVector_) {
1977  BranchID bid(prov.branchID_);
1978  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
1979  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
1980  }
1981  } else {
1982  for (auto const& prov : provVector_) {
1983  if (prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
1985  << "ReducedProvenanceReader::ReadProvenance\n"
1986  << "The parentage ID index value " << prov.parentageIDIndex_
1987  << " is out of bounds. The maximum value is " << parentageIDLookup_.size() - 1 << ".\n"
1988  << "This should never happen.\n"
1989  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1990  }
1991  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
1992  }
1993  }
1994  return retValue;
1995  }

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

1956  {
1957  readProvenanceAsyncImpl(this,
1959  task,
1960  transitionIndex,
1961  writeTo,
1962  moduleCallingContext,
1963  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1964  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1965  }

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

Member Data Documentation

◆ acquirer_

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 1878 of file RootFile.cc.

Referenced by readProvenanceAsync().

◆ daqProvenanceHelper_

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1876 of file RootFile.cc.

Referenced by readProvenance().

◆ mutex_

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

Definition at line 1877 of file RootFile.cc.

Referenced by readProvenance().

◆ parentageIDLookup_

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

Definition at line 1875 of file RootFile.cc.

Referenced by readProvenance().

◆ pProvVector_

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1874 of file RootFile.cc.

◆ provBranch_

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

Definition at line 1872 of file RootFile.cc.

Referenced by ReducedProvenanceReader().

◆ provVector_

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1873 of file RootFile.cc.

Referenced by readProvenance().

◆ rootTree_

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

Definition at line 1871 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:1872
edm::DaqProvenanceHelper::mapParentageID
ParentageID const & mapParentageID(ParentageID const &phid) const
Definition: DaqProvenanceHelper.cc:182
edm::ReducedProvenanceReader::provVector_
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1873
edm::errors::LogicError
Definition: EDMException.h:37
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
edm::first
T first(std::pair< T, U > const &p)
Definition: ParameterSet.cc:210
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
edm::ReducedProvenanceReader::rootTree_
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1871
edm::SharedResourcesRegistry::instance
static SharedResourcesRegistry * instance()
Definition: SharedResourcesRegistry.cc:25
edm::ReducedProvenanceReader::parentageIDLookup_
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1875
edm::DaqProvenanceHelper::mapBranchID
BranchID const & mapBranchID(BranchID const &branchID) const
Definition: DaqProvenanceHelper.cc:191
edm::ReducedProvenanceReader::acquirer_
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1878
edm::BranchTypeToProductProvenanceBranchName
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:134
edm::ReducedProvenanceReader::daqProvenanceHelper_
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1876
Exception
Definition: hltDiff.cc:246
edm::ReducedProvenanceReader::pProvVector_
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:1874
edm::ProvenanceReaderBase::ProvenanceReaderBase
ProvenanceReaderBase()
Definition: ProductProvenanceRetriever.h:47
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:56
edm::ReducedProvenanceReader::ReducedProvenanceReader
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1881
edm::ReducedProvenanceReader::mutex_
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1877