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

Constructor & Destructor Documentation

◆ ReducedProvenanceReader()

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

Definition at line 2179 of file RootFile.cc.

2183  rootTree_(iRootTree),
2185  parentageIDLookup_(iParentageIDLookup),
2186  daqProvenanceHelper_(daqProvenanceHelper),
2187  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
2188  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
2189  provBranch_ =
2190  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
2191  }

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

Member Function Documentation

◆ readProvenance()

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

Implements edm::ProvenanceReaderBase.

Definition at line 2267 of file RootFile.cc.

2267  {
2268  {
2269  std::lock_guard<std::recursive_mutex> guard(*mutex_);
2270  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
2271  me->rootTree_->fillBranchEntry(
2272  me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
2273  }
2274  std::set<ProductProvenance> retValue;
2275  if (daqProvenanceHelper_) {
2276  for (auto const& prov : provVector_) {
2277  BranchID bid(prov.branchID_);
2278  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
2279  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
2280  }
2281  } else {
2282  for (auto const& prov : provVector_) {
2283  if (prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
2285  << "ReducedProvenanceReader::ReadProvenance\n"
2286  << "The parentage ID index value " << prov.parentageIDIndex_
2287  << " is out of bounds. The maximum value is " << parentageIDLookup_.size() - 1 << ".\n"
2288  << "This should never happen.\n"
2289  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
2290  }
2291  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
2292  }
2293  }
2294  return retValue;
2295  }

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

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

2256  {
2257  readProvenanceAsyncImpl(this,
2259  task,
2260  transitionIndex,
2261  writeTo,
2262  moduleCallingContext,
2263  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2264  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2265  }

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

Member Data Documentation

◆ acquirer_

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 2176 of file RootFile.cc.

Referenced by readProvenanceAsync().

◆ daqProvenanceHelper_

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 2174 of file RootFile.cc.

Referenced by readProvenance().

◆ mutex_

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

Definition at line 2175 of file RootFile.cc.

Referenced by readProvenance().

◆ parentageIDLookup_

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

Definition at line 2173 of file RootFile.cc.

Referenced by readProvenance().

◆ pProvVector_

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 2172 of file RootFile.cc.

◆ provBranch_

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

Definition at line 2170 of file RootFile.cc.

Referenced by ReducedProvenanceReader().

◆ provVector_

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 2171 of file RootFile.cc.

Referenced by readProvenance().

◆ rootTree_

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

Definition at line 2169 of file RootFile.cc.

Referenced by readProvenanceAsync(), and ReducedProvenanceReader().

edm::SharedResourcesAcquirer::serialQueueChain
SerialTaskQueueChain & serialQueueChain() const
Definition: SharedResourcesAcquirer.h:54
edm::ReducedProvenanceReader::provBranch_
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:2170
edm::DaqProvenanceHelper::mapParentageID
ParentageID const & mapParentageID(ParentageID const &phid) const
Definition: DaqProvenanceHelper.cc:182
edm::ReducedProvenanceReader::provVector_
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:2171
edm::errors::LogicError
Definition: EDMException.h:37
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::first
T first(std::pair< T, U > const &p)
Definition: ParameterSet.cc:217
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:253
edm::ReducedProvenanceReader::rootTree_
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2169
edm::SharedResourcesRegistry::instance
static SharedResourcesRegistry * instance()
Definition: SharedResourcesRegistry.cc:25
edm::ReducedProvenanceReader::parentageIDLookup_
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:2173
edm::DaqProvenanceHelper::mapBranchID
BranchID const & mapBranchID(BranchID const &branchID) const
Definition: DaqProvenanceHelper.cc:191
edm::ReducedProvenanceReader::acquirer_
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2176
edm::BranchTypeToProductProvenanceBranchName
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:139
edm::ReducedProvenanceReader::daqProvenanceHelper_
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:2174
Exception
Definition: hltDiff.cc:245
edm::ReducedProvenanceReader::pProvVector_
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:2172
edm::ProvenanceReaderBase::ProvenanceReaderBase
ProvenanceReaderBase()
Definition: ProductProvenanceRetriever.h:28
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
edm::ReducedProvenanceReader::ReducedProvenanceReader
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:2179
edm::ReducedProvenanceReader::mutex_
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:2175