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 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 2319 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_.

2319  {
2320  {
2321  std::lock_guard<std::recursive_mutex> guard(*mutex_);
2322  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
2323  me->rootTree_->fillBranchEntry(
2324  me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
2325  }
2326  std::set<ProductProvenance> retValue;
2327  if (daqProvenanceHelper_) {
2328  for (auto const& prov : provVector_) {
2329  BranchID bid(prov.branchID_);
2330  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
2331  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
2332  }
2333  } else {
2334  for (auto const& prov : provVector_) {
2335  if (prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
2337  << "ReducedProvenanceReader::ReadProvenance\n"
2338  << "The parentage ID index value " << prov.parentageIDIndex_
2339  << " is out of bounds. The maximum value is " << parentageIDLookup_.size() - 1 << ".\n"
2340  << "This should never happen.\n"
2341  << "Please report this to the framework developers.";
2342  }
2343  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
2344  }
2345  }
2346  return retValue;
2347  }
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
overrideprivatevirtual

Implements edm::ProvenanceReaderBase.

Definition at line 2305 of file RootFile.cc.

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

2308  {
2309  readProvenanceAsyncImpl(this,
2311  task,
2312  transitionIndex,
2313  writeTo,
2314  moduleCallingContext,
2315  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2316  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2317  }
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.

Referenced by readProvenanceAsync().

◆ 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 readProvenanceAsync(), and ReducedProvenanceReader().