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

Constructor & Destructor Documentation

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

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

1882  rootTree_(iRootTree),
1884  parentageIDLookup_(iParentageIDLookup),
1885  daqProvenanceHelper_(daqProvenanceHelper),
1886  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
1887  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first) {
1888  provBranch_ =
1889  rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
1890  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1870
U second(std::pair< T, U > const &p)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1873
static SharedResourcesRegistry * instance()
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1868
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:1871
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1872
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1874
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:132
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:1869
T first(std::pair< T, U > const &p)
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1875

Member Function Documentation

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

Implements edm::ProvenanceReaderBase.

Definition at line 1964 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().

1964  {
1965  {
1966  std::lock_guard<std::recursive_mutex> guard(*mutex_);
1967  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1968  me->rootTree_->fillBranchEntry(
1969  me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
1970  }
1971  std::set<ProductProvenance> retValue;
1972  if (daqProvenanceHelper_) {
1973  for (auto const& prov : provVector_) {
1974  BranchID bid(prov.branchID_);
1975  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
1976  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
1977  }
1978  } else {
1979  for (auto const& prov : provVector_) {
1980  if (prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
1982  << "ReducedProvenanceReader::ReadProvenance\n"
1983  << "The parentage ID index value " << prov.parentageIDIndex_
1984  << " is out of bounds. The maximum value is " << parentageIDLookup_.size() - 1 << ".\n"
1985  << "This should never happen.\n"
1986  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1987  }
1988  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
1989  }
1990  }
1991  return retValue;
1992  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1870
BranchID const & mapBranchID(BranchID const &branchID) const
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1873
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1872
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1874
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1878
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 1950 of file RootFile.cc.

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

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

1953  {
1954  readProvenanceAsyncImpl(this,
1956  task,
1957  transitionIndex,
1958  writeTo,
1959  moduleCallingContext,
1960  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1961  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1962  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1868
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1875

Member Data Documentation

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 1875 of file RootFile.cc.

Referenced by readProvenanceAsync().

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1873 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1874 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1872 of file RootFile.cc.

Referenced by readProvenance().

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1871 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1869 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1870 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1868 of file RootFile.cc.

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