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

Constructor & Destructor Documentation

◆ ReducedProvenanceReader()

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

Definition at line 2213 of file RootFile.cc.

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

2217  rootTree_(iRootTree),
2219  parentageIDLookup_(iParentageIDLookup),
2220  daqProvenanceHelper_(daqProvenanceHelper),
2221  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
2222  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
2223  provBranch_ =
2224  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
2225  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:2205
U second(std::pair< T, U > const &p)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:2208
static SharedResourcesRegistry * instance()
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2203
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:2206
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:139
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:2207
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:2209
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:2204
T first(std::pair< T, U > const &p)
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2210

Member Function Documentation

◆ readProvenance()

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

Implements edm::ProvenanceReaderBase.

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

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

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

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

2290  {
2291  readProvenanceAsyncImpl(this,
2293  task,
2294  transitionIndex,
2295  writeTo,
2296  moduleCallingContext,
2297  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2298  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2299  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2203
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2210

Member Data Documentation

◆ acquirer_

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 2210 of file RootFile.cc.

Referenced by readProvenanceAsync().

◆ daqProvenanceHelper_

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 2208 of file RootFile.cc.

Referenced by readProvenance().

◆ mutex_

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

Definition at line 2209 of file RootFile.cc.

Referenced by readProvenance().

◆ parentageIDLookup_

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

Definition at line 2207 of file RootFile.cc.

Referenced by readProvenance().

◆ pProvVector_

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 2206 of file RootFile.cc.

◆ provBranch_

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

Definition at line 2204 of file RootFile.cc.

Referenced by ReducedProvenanceReader().

◆ provVector_

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 2205 of file RootFile.cc.

Referenced by readProvenance().

◆ rootTree_

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

Definition at line 2203 of file RootFile.cc.

Referenced by readProvenanceAsync(), and ReducedProvenanceReader().