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

Constructor & Destructor Documentation

◆ ReducedProvenanceReader()

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

Definition at line 2231 of file RootFile.cc.

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

2235  rootTree_(iRootTree),
2237  parentageIDLookup_(iParentageIDLookup),
2238  daqProvenanceHelper_(daqProvenanceHelper),
2239  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
2240  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
2241  provBranch_ =
2242  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
2243  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:2223
U second(std::pair< T, U > const &p)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:2226
static SharedResourcesRegistry * instance()
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2221
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:2224
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:139
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:2225
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:2227
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:2222
T first(std::pair< T, U > const &p)
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2228

Member Function Documentation

◆ readProvenance()

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

Implements edm::ProvenanceReaderBase.

Definition at line 2320 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_.

2320  {
2321  {
2322  std::lock_guard<std::recursive_mutex> guard(*mutex_);
2323  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
2324  me->rootTree_->fillBranchEntry(
2325  me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
2326  }
2327  std::set<ProductProvenance> retValue;
2328  if (daqProvenanceHelper_) {
2329  for (auto const& prov : provVector_) {
2330  BranchID bid(prov.branchID_);
2331  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
2332  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
2333  }
2334  } else {
2335  for (auto const& prov : provVector_) {
2336  if (prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
2338  << "ReducedProvenanceReader::ReadProvenance\n"
2339  << "The parentage ID index value " << prov.parentageIDIndex_
2340  << " is out of bounds. The maximum value is " << parentageIDLookup_.size() - 1 << ".\n"
2341  << "This should never happen.\n"
2342  << "Please report this to the framework developers.";
2343  }
2344  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
2345  }
2346  }
2347  return retValue;
2348  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:2223
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:2226
BranchID const & mapBranchID(BranchID const &branchID) const
ParentageID const & mapParentageID(ParentageID const &phid) const
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:2225
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:2227
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:2231

◆ readProvenanceAsync()

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

Implements edm::ProvenanceReaderBase.

Definition at line 2305 of file RootFile.cc.

References TrackValidation_cff::task.

2309  {
2310  readProvenanceAsyncImpl(this,
2312  task,
2313  transitionIndex,
2314  writeTo,
2315  moduleCallingContext,
2316  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2317  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2318  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2221
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2228

Member Data Documentation

◆ acquirer_

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 2228 of file RootFile.cc.

◆ daqProvenanceHelper_

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 2226 of file RootFile.cc.

Referenced by readProvenance().

◆ mutex_

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

Definition at line 2227 of file RootFile.cc.

Referenced by readProvenance().

◆ parentageIDLookup_

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

Definition at line 2225 of file RootFile.cc.

Referenced by readProvenance().

◆ pProvVector_

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 2224 of file RootFile.cc.

◆ provBranch_

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

Definition at line 2222 of file RootFile.cc.

Referenced by ReducedProvenanceReader().

◆ provVector_

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 2223 of file RootFile.cc.

Referenced by readProvenance().

◆ rootTree_

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

Definition at line 2221 of file RootFile.cc.

Referenced by ReducedProvenanceReader().