CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 2171 of file RootFile.cc.

Constructor & Destructor Documentation

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

Definition at line 2195 of file RootFile.cc.

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

2199  rootTree_(iRootTree),
2201  parentageIDLookup_(iParentageIDLookup),
2202  daqProvenanceHelper_(daqProvenanceHelper),
2203  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
2204  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
2205  provBranch_ =
2206  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
2207  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:2187
U second(std::pair< T, U > const &p)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:2190
static SharedResourcesRegistry * instance()
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2185
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:2188
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:2189
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:2191
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:139
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:2186
T first(std::pair< T, U > const &p)
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2192

Member Function Documentation

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

Implements edm::ProvenanceReaderBase.

Definition at line 2283 of file RootFile.cc.

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

2283  {
2284  {
2285  std::lock_guard<std::recursive_mutex> guard(*mutex_);
2286  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
2287  me->rootTree_->fillBranchEntry(
2288  me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
2289  }
2290  std::set<ProductProvenance> retValue;
2291  if (daqProvenanceHelper_) {
2292  for (auto const& prov : provVector_) {
2293  BranchID bid(prov.branchID_);
2294  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
2295  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
2296  }
2297  } else {
2298  for (auto const& prov : provVector_) {
2299  if (prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
2301  << "ReducedProvenanceReader::ReadProvenance\n"
2302  << "The parentage ID index value " << prov.parentageIDIndex_
2303  << " is out of bounds. The maximum value is " << parentageIDLookup_.size() - 1 << ".\n"
2304  << "This should never happen.\n"
2305  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
2306  }
2307  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
2308  }
2309  }
2310  return retValue;
2311  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:2187
BranchID const & mapBranchID(BranchID const &branchID) const
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:2190
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:2189
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:2191
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:2195
ParentageID const & mapParentageID(ParentageID const &phid) const
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 2269 of file RootFile.cc.

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

2272  {
2273  readProvenanceAsyncImpl(this,
2275  task,
2276  transitionIndex,
2277  writeTo,
2278  moduleCallingContext,
2279  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2280  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2281  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:2185
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:2192

Member Data Documentation

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 2192 of file RootFile.cc.

Referenced by readProvenanceAsync().

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 2190 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 2191 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 2189 of file RootFile.cc.

Referenced by readProvenance().

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 2188 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 2186 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 2187 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 2185 of file RootFile.cc.

Referenced by readProvenance(), readProvenanceAsync(), and ReducedProvenanceReader().