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

Constructor & Destructor Documentation

◆ ReducedProvenanceReader()

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

Definition at line 2220 of file RootFile.cc.

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

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

Member Function Documentation

◆ readProvenance()

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

Implements edm::ProvenanceReaderBase.

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

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

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

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

2297  {
2298  readProvenanceAsyncImpl(this,
2300  task,
2301  transitionIndex,
2302  writeTo,
2303  moduleCallingContext,
2304  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2305  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2306  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2210
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2217

Member Data Documentation

◆ acquirer_

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 2217 of file RootFile.cc.

Referenced by readProvenanceAsync().

◆ daqProvenanceHelper_

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 2215 of file RootFile.cc.

Referenced by readProvenance().

◆ mutex_

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

Definition at line 2216 of file RootFile.cc.

Referenced by readProvenance().

◆ parentageIDLookup_

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

Definition at line 2214 of file RootFile.cc.

Referenced by readProvenance().

◆ pProvVector_

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 2213 of file RootFile.cc.

◆ provBranch_

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

Definition at line 2211 of file RootFile.cc.

Referenced by ReducedProvenanceReader().

◆ provVector_

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 2212 of file RootFile.cc.

Referenced by readProvenance().

◆ rootTree_

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

Definition at line 2210 of file RootFile.cc.

Referenced by readProvenanceAsync(), and ReducedProvenanceReader().