CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::ProductProvenanceRetriever Class Reference

#include <ProductProvenanceRetriever.h>

Inheritance diagram for edm::ProductProvenanceRetriever:
edm::ProductProvenanceLookup

Public Member Functions

void deepCopy (ProductProvenanceRetriever const &)
 
void mergeParentProcessRetriever (ProductProvenanceRetriever const &provRetriever)
 
void mergeProvenanceRetrievers (std::shared_ptr< ProductProvenanceRetriever > other)
 
ProductProvenanceRetrieveroperator= (ProductProvenanceRetriever const &)=delete
 
 ProductProvenanceRetriever (unsigned int iTransitionIndex)
 
 ProductProvenanceRetriever (unsigned int iTransitionIndex, edm::ProductRegistry const &)
 
 ProductProvenanceRetriever (std::unique_ptr< ProvenanceReaderBase > reader)
 
void readProvenanceAsync (WaitingTaskHolder task, ModuleCallingContext const *moduleCallingContext) const
 
void reset ()
 
- Public Member Functions inherited from edm::ProductProvenanceLookup
ProductProvenance const * branchIDToProvenance (BranchID const &bid) const
 
ProductProvenance const * branchIDToProvenanceForProducedOnly (BranchID const &bid) const
 
void insertIntoSet (ProductProvenance provenanceProduct) const
 
ProductProvenanceLookupoperator= (ProductProvenanceLookup const &)=delete
 
 ProductProvenanceLookup ()
 
 ProductProvenanceLookup (edm::ProductRegistry const &)
 
void update (edm::ProductRegistry const &)
 
virtual ~ProductProvenanceLookup ()
 

Private Member Functions

const ProductProvenanceLookupnextRetriever () const final
 
std::unique_ptr< const std::set< ProductProvenance > > readProvenance () const final
 
void setTransitionIndex (unsigned int transitionIndex)
 

Private Attributes

edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_
 
std::shared_ptr< const ProvenanceReaderBaseprovenanceReader_
 
unsigned int transitionIndex_
 

Additional Inherited Members

- Protected Attributes inherited from edm::ProductProvenanceLookup
std::vector< ProducedProvenanceInfoentryInfoSet_
 
edm::propagate_const< ProductProvenanceLookup const * > parentProcessRetriever_
 
std::atomic< const std::set< ProductProvenance > * > readEntryInfoSet_
 

Detailed Description

Definition at line 37 of file ProductProvenanceRetriever.h.

Constructor & Destructor Documentation

◆ ProductProvenanceRetriever() [1/3]

edm::ProductProvenanceRetriever::ProductProvenanceRetriever ( unsigned int  iTransitionIndex)
explicit

Definition at line 13 of file ProductProvenanceRetriever.cc.

std::shared_ptr< const ProvenanceReaderBase > provenanceReader_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_

◆ ProductProvenanceRetriever() [2/3]

edm::ProductProvenanceRetriever::ProductProvenanceRetriever ( unsigned int  iTransitionIndex,
edm::ProductRegistry const &  iReg 
)

Definition at line 16 of file ProductProvenanceRetriever.cc.

std::shared_ptr< const ProvenanceReaderBase > provenanceReader_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_

◆ ProductProvenanceRetriever() [3/3]

edm::ProductProvenanceRetriever::ProductProvenanceRetriever ( std::unique_ptr< ProvenanceReaderBase reader)
explicit

Definition at line 20 of file ProductProvenanceRetriever.cc.

References cms::cuda::assert(), and provenanceReader_.

23  provenanceReader_(reader.release()),
26  }
reader
Definition: DQM.py:105
assert(be >=bs)
std::shared_ptr< const ProvenanceReaderBase > provenanceReader_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_

Member Function Documentation

◆ deepCopy()

void edm::ProductProvenanceRetriever::deepCopy ( ProductProvenanceRetriever const &  iFrom)

Definition at line 46 of file ProductProvenanceRetriever.cc.

References cms::cuda::assert(), edm::ProductProvenanceLookup::entryInfoSet_, nextRetriever_, provenanceReader_, edm::ProductProvenanceLookup::readEntryInfoSet_, and transitionIndex_.

46  {
47  if (iFrom.readEntryInfoSet_) {
48  if (readEntryInfoSet_) {
49  delete readEntryInfoSet_.exchange(nullptr);
50  }
51  readEntryInfoSet_ = new std::set<ProductProvenance>(*iFrom.readEntryInfoSet_);
52  } else {
53  if (readEntryInfoSet_) {
54  delete readEntryInfoSet_.load();
55  readEntryInfoSet_ = nullptr;
56  }
57  }
58  assert(iFrom.entryInfoSet_.empty());
59  provenanceReader_ = iFrom.provenanceReader_;
60 
61  if (iFrom.nextRetriever_) {
62  if (not nextRetriever_) {
63  nextRetriever_ = std::make_shared<ProductProvenanceRetriever>(transitionIndex_);
64  }
65  nextRetriever_->deepCopy(*(iFrom.nextRetriever_));
66  }
67  }
assert(be >=bs)
std::shared_ptr< const ProvenanceReaderBase > provenanceReader_
std::atomic< const std::set< ProductProvenance > * > readEntryInfoSet_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_

◆ mergeParentProcessRetriever()

void edm::ProductProvenanceRetriever::mergeParentProcessRetriever ( ProductProvenanceRetriever const &  provRetriever)

Definition at line 85 of file ProductProvenanceRetriever.cc.

References edm::ProductProvenanceLookup::parentProcessRetriever_.

85  {
86  parentProcessRetriever_ = &provRetriever;
87  }
edm::propagate_const< ProductProvenanceLookup const * > parentProcessRetriever_

◆ mergeProvenanceRetrievers()

void edm::ProductProvenanceRetriever::mergeProvenanceRetrievers ( std::shared_ptr< ProductProvenanceRetriever other)

Definition at line 81 of file ProductProvenanceRetriever.cc.

References nextRetriever_, and trackingPlots::other.

81  {
83  }
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_

◆ nextRetriever()

const ProductProvenanceLookup* edm::ProductProvenanceRetriever::nextRetriever ( ) const
inlinefinalprivatevirtual

Implements edm::ProductProvenanceLookup.

Definition at line 57 of file ProductProvenanceRetriever.h.

References nextRetriever_.

57 { return nextRetriever_.get(); }
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_

◆ operator=()

ProductProvenanceRetriever& edm::ProductProvenanceRetriever::operator= ( ProductProvenanceRetriever const &  )
delete

◆ readProvenance()

std::unique_ptr< const std::set< ProductProvenance > > edm::ProductProvenanceRetriever::readProvenance ( ) const
finalprivatevirtual

Implements edm::ProductProvenanceLookup.

Definition at line 28 of file ProductProvenanceRetriever.cc.

References provenanceReader_, groupFilesInBlocks::temp, and transitionIndex_.

28  {
29  std::unique_ptr<const std::set<ProductProvenance>> temp;
30  if (provenanceReader_) {
31  temp = std::make_unique<std::set<ProductProvenance> const>(provenanceReader_->readProvenance(transitionIndex_));
32  }
33  return temp;
34  }
std::shared_ptr< const ProvenanceReaderBase > provenanceReader_

◆ readProvenanceAsync()

void edm::ProductProvenanceRetriever::readProvenanceAsync ( WaitingTaskHolder  task,
ModuleCallingContext const *  moduleCallingContext 
) const

Definition at line 36 of file ProductProvenanceRetriever.cc.

References nextRetriever_, provenanceReader_, edm::ProductProvenanceLookup::readEntryInfoSet_, TrackValidation_cff::task, and transitionIndex_.

37  {
38  if (provenanceReader_ and nullptr == readEntryInfoSet_.load()) {
39  provenanceReader_->readProvenanceAsync(task, moduleCallingContext, transitionIndex_, readEntryInfoSet_);
40  }
41  if (nextRetriever_) {
42  nextRetriever_->readProvenanceAsync(task, moduleCallingContext);
43  }
44  }
std::shared_ptr< const ProvenanceReaderBase > provenanceReader_
std::atomic< const std::set< ProductProvenance > * > readEntryInfoSet_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_

◆ reset()

void edm::ProductProvenanceRetriever::reset ( void  )

Definition at line 69 of file ProductProvenanceRetriever.cc.

References MillePedeFileConverter_cfg::e, edm::ProductProvenanceLookup::entryInfoSet_, nextRetriever_, edm::ProductProvenanceLookup::parentProcessRetriever_, and edm::ProductProvenanceLookup::readEntryInfoSet_.

69  {
70  delete readEntryInfoSet_.load();
71  readEntryInfoSet_ = nullptr;
72  for (auto& e : entryInfoSet_) {
73  e.resetParentage();
74  }
75  if (nextRetriever_) {
76  nextRetriever_->reset();
77  }
78  parentProcessRetriever_ = nullptr;
79  }
std::atomic< const std::set< ProductProvenance > * > readEntryInfoSet_
edm::propagate_const< ProductProvenanceLookup const * > parentProcessRetriever_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_
std::vector< ProducedProvenanceInfo > entryInfoSet_

◆ setTransitionIndex()

void edm::ProductProvenanceRetriever::setTransitionIndex ( unsigned int  transitionIndex)
inlineprivate

Definition at line 58 of file ProductProvenanceRetriever.h.

References transitionIndex_.

58 { transitionIndex_ = transitionIndex; }

Member Data Documentation

◆ nextRetriever_

edm::propagate_const<std::shared_ptr<ProductProvenanceRetriever> > edm::ProductProvenanceRetriever::nextRetriever_
private

◆ provenanceReader_

std::shared_ptr<const ProvenanceReaderBase> edm::ProductProvenanceRetriever::provenanceReader_
private

◆ transitionIndex_

unsigned int edm::ProductProvenanceRetriever::transitionIndex_
private