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

Constructor & Destructor Documentation

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

Definition at line 1867 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, and rootTree_.

1870  :
1872  rootTree_(iRootTree),
1874  parentageIDLookup_(iParentageIDLookup),
1875  daqProvenanceHelper_(daqProvenanceHelper),
1876  mutex_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().second),
1877  acquirer_(SharedResourcesRegistry::instance()->createAcquirerForSourceDelayedReader().first)
1878  {
1879  provBranch_ = rootTree_->tree()->GetBranch(BranchTypeToProductProvenanceBranchName(rootTree_->branchType()).c_str());
1880  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1859
U second(std::pair< T, U > const &p)
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1862
static SharedResourcesRegistry * instance()
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1857
StoredProductProvenanceVector const * pProvVector_
Definition: RootFile.cc:1860
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1861
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1863
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:131
edm::propagate_const< TBranch * > provBranch_
Definition: RootFile.cc:1858
T first(std::pair< T, U > const &p)
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1864

Member Function Documentation

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

Implements edm::ProvenanceReaderBase.

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

1945  {
1946  {
1947  std::lock_guard<std::recursive_mutex> guard(*mutex_);
1948  ReducedProvenanceReader* me = const_cast<ReducedProvenanceReader*>(this);
1949  me->rootTree_->fillBranchEntry(me->provBranch_, me->rootTree_->entryNumberForIndex(transitionIndex), me->pProvVector_);
1950  }
1951  std::set<ProductProvenance> retValue;
1952  if(daqProvenanceHelper_) {
1953  for(auto const& prov : provVector_) {
1954  BranchID bid(prov.branchID_);
1955  retValue.emplace(daqProvenanceHelper_->mapBranchID(BranchID(prov.branchID_)),
1956  daqProvenanceHelper_->mapParentageID(parentageIDLookup_[prov.parentageIDIndex_]));
1957  }
1958  } else {
1959  for(auto const& prov : provVector_) {
1960  if(prov.parentageIDIndex_ >= parentageIDLookup_.size()) {
1962  << "ReducedProvenanceReader::ReadProvenance\n"
1963  << "The parentage ID index value " << prov.parentageIDIndex_ << " is out of bounds. The maximum value is " << parentageIDLookup_.size()-1 << ".\n"
1964  << "This should never happen.\n"
1965  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1966  }
1967  retValue.emplace(BranchID(prov.branchID_), parentageIDLookup_[prov.parentageIDIndex_]);
1968  }
1969  }
1970  return retValue;
1971  }
StoredProductProvenanceVector provVector_
Definition: RootFile.cc:1859
BranchID const & mapBranchID(BranchID const &branchID) const
DaqProvenanceHelper const * daqProvenanceHelper_
Definition: RootFile.cc:1862
std::vector< ParentageID > const & parentageIDLookup_
Definition: RootFile.cc:1861
std::shared_ptr< std::recursive_mutex > mutex_
Definition: RootFile.cc:1863
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
Definition: RootFile.cc:1867
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 1929 of file RootFile.cc.

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

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

1933  {
1934  readProvenanceAsyncImpl(this,
1936  task,
1937  transitionIndex,
1938  writeTo,
1939  moduleCallingContext,
1940  rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1941  rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1942  }
edm::propagate_const< RootTree * > rootTree_
Definition: RootFile.cc:1857
SerialTaskQueueChain & serialQueueChain() const
SharedResourcesAcquirer acquirer_
Definition: RootFile.cc:1864

Member Data Documentation

SharedResourcesAcquirer edm::ReducedProvenanceReader::acquirer_
private

Definition at line 1864 of file RootFile.cc.

Referenced by readProvenanceAsync().

DaqProvenanceHelper const* edm::ReducedProvenanceReader::daqProvenanceHelper_
private

Definition at line 1862 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1863 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1861 of file RootFile.cc.

Referenced by readProvenance().

StoredProductProvenanceVector const* edm::ReducedProvenanceReader::pProvVector_
private

Definition at line 1860 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1858 of file RootFile.cc.

Referenced by readProvenance(), and ReducedProvenanceReader().

StoredProductProvenanceVector edm::ReducedProvenanceReader::provVector_
private

Definition at line 1859 of file RootFile.cc.

Referenced by readProvenance().

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

Definition at line 1857 of file RootFile.cc.

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