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

Constructor & Destructor Documentation

◆ ReducedProvenanceReader()

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

Definition at line 2224 of file RootFile.cc.

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

2228  rootTree_(iRootTree),
2230  parentageIDLookup_(iParentageIDLookup),
2231  daqProvenanceHelper_(daqProvenanceHelper),
2232  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
2233  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
2234  provBranch_ =
2235  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
2236  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:2216
U second(std::pair< T, U > const &p)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:2219
static SharedResourcesRegistry * instance()
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2214
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:2217
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:139
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:2218
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:2220
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:2215
T first(std::pair< T, U > const &p)
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2221

Member Function Documentation

◆ readProvenance()

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

Implements edm::ProvenanceReaderBase.

Definition at line 2312 of file RootFile.cc.

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

2312  {
2313  {
2314  std::lock_guard<std::recursive_mutex> guard(*mutex_);
2315  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
2316  me->rootTree_->fillBranchEntry(
2317  me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
2318  }
2319  std::set<ProductProvenance> retValue;
2320  if (daqProvenanceHelper_) {
2321  for (auto const& prov : provVector_) {
2322  BranchID bid(prov.branchID_);
2323  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
2324  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
2325  }
2326  } else {
2327  for (auto const& prov : provVector_) {
2328  if (prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
2330  << "ReducedProvenanceReader::ReadProvenance\n"
2331  << "The parentage ID index value " << prov.parentageIDIndex_
2332  << " is out of bounds. The maximum value is " << parentageIDLookup_.size() - 1 << ".\n"
2333  << "This should never happen.\n"
2334  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
2335  }
2336  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
2337  }
2338  }
2339  return retValue;
2340  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:2216
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:2219
BranchID const & mapBranchID(BranchID const &branchID) const
ParentageID const & mapParentageID(ParentageID const &phid) const
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:2218
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:2220
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:2224

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

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

2301  {
2302  readProvenanceAsyncImpl(this,
2304  task,
2305  transitionIndex,
2306  writeTo,
2307  moduleCallingContext,
2308  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2309  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2310  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2214
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2221

Member Data Documentation

◆ acquirer_

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 2221 of file RootFile.cc.

Referenced by readProvenanceAsync().

◆ daqProvenanceHelper_

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 2219 of file RootFile.cc.

Referenced by readProvenance().

◆ mutex_

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

Definition at line 2220 of file RootFile.cc.

Referenced by readProvenance().

◆ parentageIDLookup_

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

Definition at line 2218 of file RootFile.cc.

Referenced by readProvenance().

◆ pProvVector_

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 2217 of file RootFile.cc.

◆ provBranch_

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

Definition at line 2215 of file RootFile.cc.

Referenced by ReducedProvenanceReader().

◆ provVector_

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 2216 of file RootFile.cc.

Referenced by readProvenance().

◆ rootTree_

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

Definition at line 2214 of file RootFile.cc.

Referenced by readProvenanceAsync(), and ReducedProvenanceReader().