CMS 3D CMS Logo

ProductProvenanceRetriever.cc
Go to the documentation of this file.
4 
5 #include <cassert>
6 #include <limits>
7 
8 /*
9  ProductProvenanceRetriever
10 */
11 
12 namespace edm {
14  : ProductProvenanceLookup(), nextRetriever_(), provenanceReader_(), transitionIndex_(iTransitionIndex) {}
15 
17  edm::ProductRegistry const& iReg)
18  : ProductProvenanceLookup(iReg), nextRetriever_(), provenanceReader_(), transitionIndex_(iTransitionIndex) {}
19 
20  ProductProvenanceRetriever::ProductProvenanceRetriever(std::unique_ptr<ProvenanceReaderBase> reader)
22  nextRetriever_(),
23  provenanceReader_(reader.release()),
24  transitionIndex_(std::numeric_limits<unsigned int>::max()) {
26  }
27 
28  std::unique_ptr<const std::set<ProductProvenance>> ProductProvenanceRetriever::readProvenance() const {
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  }
35 
37  ModuleCallingContext const* moduleCallingContext) const {
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  }
45 
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());
60 
61  if (iFrom.nextRetriever_) {
62  if (not nextRetriever_) {
63  nextRetriever_ = std::make_shared<ProductProvenanceRetriever>(transitionIndex_);
64  }
65  nextRetriever_->deepCopy(*(iFrom.nextRetriever_));
66  }
67  }
68 
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  }
80 
81  void ProductProvenanceRetriever::mergeProvenanceRetrievers(std::shared_ptr<ProductProvenanceRetriever> other) {
83  }
84 
86  parentProcessRetriever_ = &provRetriever;
87  }
88 
90 } // namespace edm
edm::ProductProvenanceRetriever::readProvenanceAsync
void readProvenanceAsync(WaitingTaskHolder task, ModuleCallingContext const *moduleCallingContext) const
Definition: ProductProvenanceRetriever.cc:36
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::max
EventID const & max(EventID const &lh, EventID const &rh)
Definition: EventID.h:118
cms::cuda::assert
assert(be >=bs)
edm::ProductProvenanceLookup::parentProcessRetriever_
edm::propagate_const< ProductProvenanceLookup const * > parentProcessRetriever_
Definition: ProductProvenanceLookup.h:99
ProductRegistry.h
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::ProductProvenanceLookup::entryInfoSet_
std::vector< ProducedProvenanceInfo > entryInfoSet_
Definition: ProductProvenanceLookup.h:97
edm::ProductRegistry
Definition: ProductRegistry.h:37
EDMException.h
edm::ProductProvenanceLookup::readEntryInfoSet_
std::atomic< const std::set< ProductProvenance > * > readEntryInfoSet_
Definition: ProductProvenanceLookup.h:98
DQM.reader
reader
Definition: DQM.py:105
edm::ProductProvenanceRetriever::mergeParentProcessRetriever
void mergeParentProcessRetriever(ProductProvenanceRetriever const &provRetriever)
Definition: ProductProvenanceRetriever.cc:85
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:253
edm::ProductProvenanceRetriever::readProvenance
std::unique_ptr< const std::set< ProductProvenance > > readProvenance() const final
Definition: ProductProvenanceRetriever.cc:28
trackingPlots.other
other
Definition: trackingPlots.py:1464
edm::ProductProvenanceRetriever::reset
void reset()
Definition: ProductProvenanceRetriever.cc:69
edm::ProductProvenanceRetriever::mergeProvenanceRetrievers
void mergeProvenanceRetrievers(std::shared_ptr< ProductProvenanceRetriever > other)
Definition: ProductProvenanceRetriever.cc:81
fetchall_from_DQM_v2.release
release
Definition: fetchall_from_DQM_v2.py:92
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
createfilelist.int
int
Definition: createfilelist.py:10
edm::ProvenanceReaderBase::~ProvenanceReaderBase
virtual ~ProvenanceReaderBase()
Definition: ProductProvenanceRetriever.cc:89
ProductProvenanceRetriever.h
edm::ProductProvenanceRetriever::deepCopy
void deepCopy(ProductProvenanceRetriever const &)
Definition: ProductProvenanceRetriever.cc:46
edm::ProductProvenanceRetriever
Definition: ProductProvenanceRetriever.h:37
edm::ProductProvenanceRetriever::nextRetriever_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > nextRetriever_
Definition: ProductProvenanceRetriever.h:60
std
Definition: JetResolutionObject.h:76
edm::ProductProvenanceRetriever::transitionIndex_
unsigned int transitionIndex_
Definition: ProductProvenanceRetriever.h:62
edm::ProductProvenanceRetriever::ProductProvenanceRetriever
ProductProvenanceRetriever(unsigned int iTransitionIndex)
Definition: ProductProvenanceRetriever.cc:13
edm::ProductProvenanceRetriever::provenanceReader_
std::shared_ptr< const ProvenanceReaderBase > provenanceReader_
Definition: ProductProvenanceRetriever.h:61
edm::ProductProvenanceLookup
Definition: ProductProvenanceLookup.h:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29