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 (WaitingTask *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 1865 of file RootFile.cc.

Constructor & Destructor Documentation

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

Definition at line 1889 of file RootFile.cc.

References edm::BranchTypeToProductProvenanceBranchName(), edm::ModuleCallingContext::getStreamContext(), edm::ServiceRegistry::instance(), eostools::move(), cmsPerfStripChart::operate(), edm::ServiceRegistry::presentToken(), provBranch_, edm::SerialTaskQueueChain::push(), dttmaxenums::R, rootTree_, and TrackValidation_cff::task.

1893  rootTree_(iRootTree),
1895  parentageIDLookup_(iParentageIDLookup),
1896  daqProvenanceHelper_(daqProvenanceHelper),
1897  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
1898  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
1899  provBranch_ =
1900  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
1901  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1881
U second(std::pair< T, U > const &p)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1884
static SharedResourcesRegistry * instance()
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1879
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:1882
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1883
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1885
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:132
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:1880
T first(std::pair< T, U > const &p)
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1886

Member Function Documentation

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

Implements edm::ProvenanceReaderBase.

Definition at line 1975 of file RootFile.cc.

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

Referenced by edm::FullProvenanceReader::~FullProvenanceReader().

1975  {
1976  {
1977  std::lock_guard<std::recursive_mutex> guard(*mutex_);
1978  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1979  me->rootTree_->fillBranchEntry(
1980  me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
1981  }
1982  std::set<ProductProvenance> retValue;
1983  if (daqProvenanceHelper_) {
1984  for (auto const& prov : provVector_) {
1985  BranchID bid(prov.branchID_);
1986  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
1987  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
1988  }
1989  } else {
1990  for (auto const& prov : provVector_) {
1991  if (prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
1993  << "ReducedProvenanceReader::ReadProvenance\n"
1994  << "The parentage ID index value " << prov.parentageIDIndex_
1995  << " is out of bounds. The maximum value is " << parentageIDLookup_.size() - 1 << ".\n"
1996  << "This should never happen.\n"
1997  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1998  }
1999  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
2000  }
2001  }
2002  return retValue;
2003  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1881
BranchID const & mapBranchID(BranchID const &branchID) const
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1884
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1883
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1885
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1889
ParentageID const & mapParentageID(ParentageID const &phid) const
void edm::ReducedProvenanceReader::readProvenanceAsync ( WaitingTask task,
ModuleCallingContext const *  moduleCallingContext,
unsigned int  transitionIndex,
std::atomic< const std::set< ProductProvenance > * > &  writeTo 
) const
overrideprivatevirtual

Implements edm::ProvenanceReaderBase.

Definition at line 1961 of file RootFile.cc.

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

Referenced by edm::FullProvenanceReader::~FullProvenanceReader().

1964  {
1965  readProvenanceAsyncImpl(this,
1967  task,
1968  transitionIndex,
1969  writeTo,
1970  moduleCallingContext,
1971  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1972  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1973  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1879
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1886

Member Data Documentation

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 1886 of file RootFile.cc.

Referenced by readProvenanceAsync().

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1884 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1885 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1883 of file RootFile.cc.

Referenced by readProvenance().

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1882 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1880 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1881 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1879 of file RootFile.cc.

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