From 5b753800d343cb4a7e73f60c4802b27116f78181 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 25 Nov 2019 12:47:31 -0600 Subject: [PATCH 01/12] Use std::move in EventPrincipal::fillEventPrincipal The variable being moved was already being passed as a R value reference. --- FWCore/Framework/src/EventPrincipal.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FWCore/Framework/src/EventPrincipal.cc b/FWCore/Framework/src/EventPrincipal.cc index d6aff3d89ce98..25c307a303b9f 100644 --- a/FWCore/Framework/src/EventPrincipal.cc +++ b/FWCore/Framework/src/EventPrincipal.cc @@ -63,13 +63,13 @@ namespace edm { ProductProvenanceRetriever const& provRetriever, DelayedReader* reader, bool deepCopyRetriever) { - eventSelectionIDs_ = eventSelectionIDs; + eventSelectionIDs_ = std::move(eventSelectionIDs); if (deepCopyRetriever) { provRetrieverPtr_->deepCopy(provRetriever); } else { provRetrieverPtr_->mergeParentProcessRetriever(provRetriever); } - branchListIndexes_ = branchListIndexes; + branchListIndexes_ = std::move(branchListIndexes); if (branchIDListHelper_->hasProducedProducts()) { // Add index into BranchIDListRegistry for products produced this process branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex()); @@ -81,8 +81,8 @@ namespace edm { ProcessHistoryRegistry const& processHistoryRegistry, EventSelectionIDVector&& eventSelectionIDs, BranchListIndexes&& branchListIndexes) { - eventSelectionIDs_ = eventSelectionIDs; - branchListIndexes_ = branchListIndexes; + eventSelectionIDs_ = std::move(eventSelectionIDs); + branchListIndexes_ = std::move(branchListIndexes); if (branchIDListHelper_->hasProducedProducts()) { // Add index into BranchIDListRegistry for products produced this process branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex()); From 61321005763d62a804c0fdae9adf43d8715d0591 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 25 Nov 2019 12:49:37 -0600 Subject: [PATCH 02/12] Replace std::map with std::vector in EventPrincipal The map index was already a dense packed integral value, BranchListIndex. --- FWCore/Framework/interface/EventPrincipal.h | 2 +- FWCore/Framework/src/EventPrincipal.cc | 23 +++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/FWCore/Framework/interface/EventPrincipal.h b/FWCore/Framework/interface/EventPrincipal.h index bd3080d836945..c6bd8b3586aff 100644 --- a/FWCore/Framework/interface/EventPrincipal.h +++ b/FWCore/Framework/interface/EventPrincipal.h @@ -172,7 +172,7 @@ namespace edm { BranchListIndexes branchListIndexes_; - std::map branchListIndexToProcessIndex_; + std::vector branchListIndexToProcessIndex_; StreamID streamID_; }; diff --git a/FWCore/Framework/src/EventPrincipal.cc b/FWCore/Framework/src/EventPrincipal.cc index 25c307a303b9f..d7d956d8a8e5f 100644 --- a/FWCore/Framework/src/EventPrincipal.cc +++ b/FWCore/Framework/src/EventPrincipal.cc @@ -109,10 +109,13 @@ namespace edm { } // Fill in helper map for Branch to ProductID mapping - ProcessIndex pix = 0; - for (auto const& blindex : branchListIndexes_) { - branchListIndexToProcessIndex_.insert(std::make_pair(blindex, pix)); - ++pix; + if(not branchListIndexes_.empty()) { + ProcessIndex pix = 0; + branchListIndexToProcessIndex_.resize(1+*std::max_element(branchListIndexes_.begin(), branchListIndexes_.end()) ,std::numeric_limits::max()); + for (auto const& blindex : branchListIndexes_) { + branchListIndexToProcessIndex_[blindex]= pix; + ++pix; + } } // Fill in the product ID's in the product holders. @@ -203,11 +206,13 @@ namespace edm { IndexRange range = branchIDListHelper_->branchIDToIndexMap().equal_range(bid); for (Iter it = range.first; it != range.second; ++it) { BranchListIndex blix = it->second.first; - std::map::const_iterator i = branchListIndexToProcessIndex_.find(blix); - if (i != branchListIndexToProcessIndex_.end()) { - ProductIndex productIndex = it->second.second; - ProcessIndex processIndex = i->second; - return ProductID(processIndex + 1, productIndex + 1); + if( blix < branchListIndexToProcessIndex_.size()) { + auto v = branchListIndexToProcessIndex_[blix]; + if (v != std::numeric_limits::max()) { + ProductIndex productIndex = it->second.second; + ProcessIndex processIndex = v; + return ProductID(processIndex + 1, productIndex + 1); + } } } // cannot throw, because some products may legitimately not have product ID's (e.g. pile-up). From ff4d56a0028f9431fbecb232283b8c39865d1877 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 25 Nov 2019 16:32:45 -0600 Subject: [PATCH 03/12] code format --- FWCore/Framework/src/EventPrincipal.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/FWCore/Framework/src/EventPrincipal.cc b/FWCore/Framework/src/EventPrincipal.cc index d7d956d8a8e5f..da91276d42ca4 100644 --- a/FWCore/Framework/src/EventPrincipal.cc +++ b/FWCore/Framework/src/EventPrincipal.cc @@ -109,11 +109,12 @@ namespace edm { } // Fill in helper map for Branch to ProductID mapping - if(not branchListIndexes_.empty()) { + if (not branchListIndexes_.empty()) { ProcessIndex pix = 0; - branchListIndexToProcessIndex_.resize(1+*std::max_element(branchListIndexes_.begin(), branchListIndexes_.end()) ,std::numeric_limits::max()); + branchListIndexToProcessIndex_.resize(1 + *std::max_element(branchListIndexes_.begin(), branchListIndexes_.end()), + std::numeric_limits::max()); for (auto const& blindex : branchListIndexes_) { - branchListIndexToProcessIndex_[blindex]= pix; + branchListIndexToProcessIndex_[blindex] = pix; ++pix; } } @@ -206,7 +207,7 @@ namespace edm { IndexRange range = branchIDListHelper_->branchIDToIndexMap().equal_range(bid); for (Iter it = range.first; it != range.second; ++it) { BranchListIndex blix = it->second.first; - if( blix < branchListIndexToProcessIndex_.size()) { + if (blix < branchListIndexToProcessIndex_.size()) { auto v = branchListIndexToProcessIndex_[blix]; if (v != std::numeric_limits::max()) { ProductIndex productIndex = it->second.second; From a50129de9e2ac886879c0d7fafdf73740c25ed45 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 25 Nov 2019 16:41:04 -0600 Subject: [PATCH 04/12] Removed ProcessHistory from StableProvenance The ProcessHistory is shared by all data products in the Event, therefore not needed by each data product. This avoids the need to set the history for each data product each time we have a new event. --- DataFormats/Common/interface/ProductData.h | 7 +---- DataFormats/Provenance/interface/Provenance.h | 6 ---- .../Provenance/interface/StableProvenance.h | 7 ----- .../Provenance/src/StableProvenance.cc | 13 +------- FWCore/Common/interface/Provenance.h | 5 +-- FWCore/Common/src/Provenance.cc | 8 ++--- .../Framework/interface/ProductResolverBase.h | 14 ++------- .../interface/getProducerParameterSet.h | 3 +- FWCore/Framework/src/EventPrincipal.cc | 1 - .../Framework/src/LuminosityBlockPrincipal.cc | 4 --- FWCore/Framework/src/ProductResolvers.cc | 31 ++++--------------- FWCore/Framework/src/ProductResolvers.h | 30 ++++-------------- FWCore/Framework/src/RunPrincipal.cc | 1 - .../Framework/src/getProducerParameterSet.cc | 19 +++++------- .../test/stubs/TestPRegisterModule2.cc | 1 - .../Framework/test/stubs/TestTriggerNames.cc | 2 +- .../test/SwitchProducerProvenanceAnalyzer.cc | 5 ++- FWCore/Integration/test/TestFindProduct.cc | 2 +- FWCore/Modules/src/AsciiOutputModule.cc | 24 +++++++------- FWCore/Modules/src/EventContentAnalyzer.cc | 30 +++++++++--------- 20 files changed, 63 insertions(+), 150 deletions(-) diff --git a/DataFormats/Common/interface/ProductData.h b/DataFormats/Common/interface/ProductData.h index c8b24d15fe322..5a7eec30c750e 100644 --- a/DataFormats/Common/interface/ProductData.h +++ b/DataFormats/Common/interface/ProductData.h @@ -52,14 +52,9 @@ namespace edm { void unsafe_resetProductData() const { wrapper_.reset(); } - void setProcessHistory(ProcessHistory const& ph) { prov_.setProcessHistory(ph); } - - void setProvenance(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) { + void setProvenance(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) { prov_.setProductID(pid); prov_.setStore(provRetriever); - prov_.setProcessHistory(ph); } void setMergeableRunProductMetadata(MergeableRunProductMetadataBase const* mrpm) { diff --git a/DataFormats/Provenance/interface/Provenance.h b/DataFormats/Provenance/interface/Provenance.h index 0b806db87b08c..0ef5a9d7ed53d 100644 --- a/DataFormats/Provenance/interface/Provenance.h +++ b/DataFormats/Provenance/interface/Provenance.h @@ -58,10 +58,6 @@ namespace edm { std::string const& productInstanceName() const { return stable().productInstanceName(); } std::string const& friendlyClassName() const { return stable().friendlyClassName(); } ProductProvenanceRetriever const* store() const { return store_; } - ProcessHistory const& processHistory() const { return stable().processHistory(); } - ProcessHistory const* processHistoryPtr() const { return stable().processHistoryPtr(); } - bool getProcessConfiguration(ProcessConfiguration& pc) const { return stable().getProcessConfiguration(pc); } - ReleaseVersion releaseVersion() const { return stable().releaseVersion(); } std::set const& branchAliases() const { return stable().branchAliases(); } // Usually branchID() and originalBranchID() return exactly the same result. @@ -80,8 +76,6 @@ namespace edm { void setStore(ProductProvenanceRetriever const* store) { store_ = store; } - void setProcessHistory(ProcessHistory const& ph) { stable().setProcessHistory(ph); } - ProductID const& productID() const { return stable().productID(); } void setProductID(ProductID const& pid) { stable().setProductID(pid); } diff --git a/DataFormats/Provenance/interface/StableProvenance.h b/DataFormats/Provenance/interface/StableProvenance.h index edc905202e9f4..94c4f6fdf8de3 100644 --- a/DataFormats/Provenance/interface/StableProvenance.h +++ b/DataFormats/Provenance/interface/StableProvenance.h @@ -45,16 +45,10 @@ namespace edm { std::string const& processName() const { return branchDescription().processName(); } std::string const& productInstanceName() const { return branchDescription().productInstanceName(); } std::string const& friendlyClassName() const { return branchDescription().friendlyClassName(); } - ProcessHistory const& processHistory() const { return *processHistory_; } - ProcessHistory const* processHistoryPtr() const { return processHistory_; } - bool getProcessConfiguration(ProcessConfiguration& pc) const; - ReleaseVersion releaseVersion() const; std::set const& branchAliases() const { return branchDescription().branchAliases(); } void write(std::ostream& os) const; - void setProcessHistory(ProcessHistory const& ph) { processHistory_ = &ph; } - ProductID const& productID() const { return productID_; } void setProductID(ProductID const& pid) { productID_ = pid; } @@ -66,7 +60,6 @@ namespace edm { private: std::shared_ptr branchDescription_; ProductID productID_; - ProcessHistory const* processHistory_; // We don't own this }; inline std::ostream& operator<<(std::ostream& os, StableProvenance const& p) { diff --git a/DataFormats/Provenance/src/StableProvenance.cc b/DataFormats/Provenance/src/StableProvenance.cc index a28cf874628ce..cd73bff7b9ed7 100644 --- a/DataFormats/Provenance/src/StableProvenance.cc +++ b/DataFormats/Provenance/src/StableProvenance.cc @@ -14,17 +14,7 @@ namespace edm { StableProvenance::StableProvenance() : StableProvenance{std::shared_ptr(), ProductID()} {} StableProvenance::StableProvenance(std::shared_ptr const& p, ProductID const& pid) - : branchDescription_(p), productID_(pid), processHistory_() {} - - bool StableProvenance::getProcessConfiguration(ProcessConfiguration& pc) const { - return processHistory_->getConfigurationForProcess(processName(), pc); - } - - ReleaseVersion StableProvenance::releaseVersion() const { - ProcessConfiguration pc; - assert(getProcessConfiguration(pc)); - return pc.releaseVersion(); - } + : branchDescription_(p), productID_(pid) {} void StableProvenance::write(std::ostream& os) const { // This is grossly inadequate, but it is not critical for the first pass. @@ -38,6 +28,5 @@ namespace edm { void StableProvenance::swap(StableProvenance& iOther) { branchDescription_.swap(iOther.branchDescription_); productID_.swap(iOther.productID_); - std::swap(processHistory_, iOther.processHistory_); } } // namespace edm diff --git a/FWCore/Common/interface/Provenance.h b/FWCore/Common/interface/Provenance.h index 280915e2aef7e..7274f9c56b5b4 100644 --- a/FWCore/Common/interface/Provenance.h +++ b/FWCore/Common/interface/Provenance.h @@ -6,7 +6,8 @@ namespace edm { class ParameterSet; - std::string moduleName(Provenance const& provenance); - ParameterSet const& parameterSet(Provenance const& provenance); + class ProcessHistory; + std::string moduleName(Provenance const& provenance, ProcessHistory const& history); + ParameterSet const& parameterSet(Provenance const& provenance, ProcessHistory const& history); } // namespace edm #endif diff --git a/FWCore/Common/src/Provenance.cc b/FWCore/Common/src/Provenance.cc index 66c560025c197..34a36c473053e 100644 --- a/FWCore/Common/src/Provenance.cc +++ b/FWCore/Common/src/Provenance.cc @@ -8,9 +8,9 @@ namespace edm { static std::string const source("source"); static std::string const triggerResultsInserter("TriggerResultsInserter"); - ParameterSet const& parameterSet(Provenance const& provenance) { + ParameterSet const& parameterSet(Provenance const& provenance, ProcessHistory const& history) { ProcessConfiguration pc; - provenance.getProcessConfiguration(pc); + history.getConfigurationForProcess(provenance.processName(), pc); ParameterSet const& processParameterSet = *pset::Registry::instance()->getMapped(pc.parameterSetID()); std::string const& label = provenance.moduleLabel(); if (!processParameterSet.existsAs(label)) { @@ -24,11 +24,11 @@ namespace edm { return processParameterSet.getParameterSet(label); } - std::string moduleName(Provenance const& provenance) { + std::string moduleName(Provenance const& provenance, ProcessHistory const& history) { // Trigger results ia a special case if (provenance.moduleLabel() == triggerResults) { return triggerResultsInserter; } - return parameterSet(provenance).getParameter("@module_type"); + return parameterSet(provenance, history).getParameter("@module_type"); } } // namespace edm diff --git a/FWCore/Framework/interface/ProductResolverBase.h b/FWCore/Framework/interface/ProductResolverBase.h index 810505a20c8d8..94f042dedd413 100644 --- a/FWCore/Framework/interface/ProductResolverBase.h +++ b/FWCore/Framework/interface/ProductResolverBase.h @@ -136,10 +136,8 @@ namespace edm { StableProvenance const* stableProvenance() const { return &provenance()->stable(); } // Initializes the event independent portion of the provenance, plus the process history ID, the product ID, and the provRetriever. - void setProvenance(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) { - setProvenance_(provRetriever, ph, pid); + void setProvenance(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) { + setProvenance_(provRetriever, pid); } // Initializes the portion of the provenance related to mergeable run products. @@ -147,9 +145,6 @@ namespace edm { setMergeableRunProductMetadata_(mrpm); } - // Initializes the process history. - void setProcessHistory(ProcessHistory const& ph) { setProcessHistory_(ph); } - // Write the product to the stream. void write(std::ostream& os) const; @@ -201,11 +196,8 @@ namespace edm { virtual void resetBranchDescription_(std::shared_ptr bd) = 0; virtual Provenance const* provenance_() const = 0; virtual std::string const& resolvedModuleLabel_() const = 0; - virtual void setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) = 0; + virtual void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) = 0; virtual void setMergeableRunProductMetadata_(MergeableRunProductMetadata const*); - virtual void setProcessHistory_(ProcessHistory const& ph) = 0; virtual ProductProvenance const* productProvenancePtr_() const = 0; virtual void resetProductData_(bool deleteEarly) = 0; virtual bool singleProduct_() const = 0; diff --git a/FWCore/Framework/interface/getProducerParameterSet.h b/FWCore/Framework/interface/getProducerParameterSet.h index cfa541ac615f3..deec137cf8f12 100644 --- a/FWCore/Framework/interface/getProducerParameterSet.h +++ b/FWCore/Framework/interface/getProducerParameterSet.h @@ -25,7 +25,8 @@ namespace edm { class ParameterSet; class Provenance; + class ProcessHistory; - ParameterSet const* getProducerParameterSet(Provenance const& provenance); + ParameterSet const* getProducerParameterSet(Provenance const& provenance, ProcessHistory const&); } // namespace edm #endif diff --git a/FWCore/Framework/src/EventPrincipal.cc b/FWCore/Framework/src/EventPrincipal.cc index da91276d42ca4..66348945a6255 100644 --- a/FWCore/Framework/src/EventPrincipal.cc +++ b/FWCore/Framework/src/EventPrincipal.cc @@ -128,7 +128,6 @@ namespace edm { // in the ProductID lookup so we need the alias BranchID. auto const& bd = prod->branchDescription(); prod->setProvenance(productProvenanceRetrieverPtr(), - processHistory(), branchIDToProductID(bd.isAlias() ? bd.originalBranchID() : bd.branchID())); } } diff --git a/FWCore/Framework/src/LuminosityBlockPrincipal.cc b/FWCore/Framework/src/LuminosityBlockPrincipal.cc index 37f3fccf4620c..09aa1b7214020 100644 --- a/FWCore/Framework/src/LuminosityBlockPrincipal.cc +++ b/FWCore/Framework/src/LuminosityBlockPrincipal.cc @@ -16,10 +16,6 @@ namespace edm { void LuminosityBlockPrincipal::fillLuminosityBlockPrincipal(ProcessHistoryRegistry const& processHistoryRegistry, DelayedReader* reader) { fillPrincipal(aux_.processHistoryID(), processHistoryRegistry, reader); - - for (auto& prod : *this) { - prod->setProcessHistory(processHistory()); - } } void LuminosityBlockPrincipal::put(BranchDescription const& bd, std::unique_ptr edp) const { diff --git a/FWCore/Framework/src/ProductResolvers.cc b/FWCore/Framework/src/ProductResolvers.cc index 64a5c595d73e9..4f550cff50501 100644 --- a/FWCore/Framework/src/ProductResolvers.cc +++ b/FWCore/Framework/src/ProductResolvers.cc @@ -539,9 +539,8 @@ namespace edm { } void DataManagingProductResolver::setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, ProductID const& pid) { - productData_.setProvenance(provRetriever, ph, pid); + productData_.setProvenance(provRetriever, pid); } void DataManagingProductResolver::setMergeableRunProductMetadataInProductData( @@ -549,8 +548,6 @@ namespace edm { productData_.setMergeableRunProductMetadata(mrpm); } - void DataManagingProductResolver::setProcessHistory_(ProcessHistory const& ph) { productData_.setProcessHistory(ph); } - ProductProvenance const* DataManagingProductResolver::productProvenancePtr_() const { return provenance()->productProvenance(); } @@ -568,14 +565,10 @@ namespace edm { bool DataManagingProductResolver::singleProduct_() const { return true; } - void AliasProductResolver::setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) { - realProduct_.setProvenance(provRetriever, ph, pid); + void AliasProductResolver::setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) { + realProduct_.setProvenance(provRetriever, pid); } - void AliasProductResolver::setProcessHistory_(ProcessHistory const& ph) { realProduct_.setProcessHistory(ph); } - ProductProvenance const* AliasProductResolver::productProvenancePtr_() const { return provenance()->productProvenance(); } @@ -658,11 +651,10 @@ namespace edm { } void SwitchBaseProductResolver::setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, ProductID const& pid) { // insertIntoSet is const, so let's exploit that to fake the getting of the "input" product provRetriever->insertIntoSet(ProductProvenance(branchDescription().branchID(), parentageID_)); - productData_.setProvenance(provRetriever, ph, pid); + productData_.setProvenance(provRetriever, pid); } void SwitchBaseProductResolver::resetProductData_(bool deleteEarly) { @@ -742,13 +734,10 @@ namespace edm { } void ParentProcessProductResolver::setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, ProductID const& pid) { provRetriever_ = provRetriever; } - void ParentProcessProductResolver::setProcessHistory_(ProcessHistory const& ph) {} - ProductProvenance const* ParentProcessProductResolver::productProvenancePtr_() const { return provRetriever_ ? provRetriever_->branchIDToProvenance(bd_->originalBranchID()) : nullptr; } @@ -1013,11 +1002,7 @@ namespace edm { setCache(skipCurrentProcess, newCacheIndex, nullptr); } - void NoProcessProductResolver::setProvenance_(ProductProvenanceRetriever const*, - ProcessHistory const&, - ProductID const&) {} - - void NoProcessProductResolver::setProcessHistory_(ProcessHistory const&) {} + void NoProcessProductResolver::setProvenance_(ProductProvenanceRetriever const*, ProductID const&) {} ProductProvenance const* NoProcessProductResolver::productProvenancePtr_() const { return nullptr; } @@ -1125,11 +1110,7 @@ namespace edm { ->prefetchAsync(waitTask, principal, skipCurrentProcess, token, sra, mcc); } - void SingleChoiceNoProcessProductResolver::setProvenance_(ProductProvenanceRetriever const*, - ProcessHistory const&, - ProductID const&) {} - - void SingleChoiceNoProcessProductResolver::setProcessHistory_(ProcessHistory const&) {} + void SingleChoiceNoProcessProductResolver::setProvenance_(ProductProvenanceRetriever const*, ProductID const&) {} ProductProvenance const* SingleChoiceNoProcessProductResolver::productProvenancePtr_() const { return nullptr; } diff --git a/FWCore/Framework/src/ProductResolvers.h b/FWCore/Framework/src/ProductResolvers.h index 00b8f06c81295..3bc329d01d578 100644 --- a/FWCore/Framework/src/ProductResolvers.h +++ b/FWCore/Framework/src/ProductResolvers.h @@ -89,10 +89,7 @@ namespace edm { Provenance const* provenance_() const final { return &productData_.provenance(); } std::string const& resolvedModuleLabel_() const final { return moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) final; - void setProcessHistory_(ProcessHistory const& ph) final; + void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) final; ProductProvenance const* productProvenancePtr_() const final; bool singleProduct_() const final; @@ -249,10 +246,7 @@ namespace edm { Provenance const* provenance_() const final { return realProduct_.provenance(); } std::string const& resolvedModuleLabel_() const override { return realProduct_.moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) override; - void setProcessHistory_(ProcessHistory const& ph) override; + void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) override; ProductProvenance const* productProvenancePtr_() const override; void resetProductData_(bool deleteEarly) override; bool singleProduct_() const override; @@ -297,10 +291,7 @@ namespace edm { } Provenance const* provenance_() const final { return &productData_.provenance(); } std::string const& resolvedModuleLabel_() const final { return moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) final; - void setProcessHistory_(ProcessHistory const& ph) final { productData_.setProcessHistory(ph); } + void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) final; ProductProvenance const* productProvenancePtr_() const final { return provenance()->productProvenance(); } void resetProductData_(bool deleteEarly) final; bool singleProduct_() const final { return true; } @@ -413,10 +404,7 @@ namespace edm { void resetBranchDescription_(std::shared_ptr bd) override { bd_ = bd; } Provenance const* provenance_() const final { return realProduct_->provenance(); } std::string const& resolvedModuleLabel_() const override { return realProduct_->moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) override; - void setProcessHistory_(ProcessHistory const& ph) override; + void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) override; ProductProvenance const* productProvenancePtr_() const override; void resetProductData_(bool deleteEarly) override; bool singleProduct_() const override; @@ -479,10 +467,7 @@ namespace edm { Provenance const* provenance_() const override; std::string const& resolvedModuleLabel_() const override { return moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) override; - void setProcessHistory_(ProcessHistory const& ph) override; + void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) override; ProductProvenance const* productProvenancePtr_() const override; void resetProductData_(bool deleteEarly) override; bool singleProduct_() const override; @@ -539,10 +524,7 @@ namespace edm { Provenance const* provenance_() const override; std::string const& resolvedModuleLabel_() const override { return moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProcessHistory const& ph, - ProductID const& pid) override; - void setProcessHistory_(ProcessHistory const& ph) override; + void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) override; ProductProvenance const* productProvenancePtr_() const override; void resetProductData_(bool deleteEarly) override; bool singleProduct_() const override; diff --git a/FWCore/Framework/src/RunPrincipal.cc b/FWCore/Framework/src/RunPrincipal.cc index 397cea9a9037f..8c67ef9b24b3c 100644 --- a/FWCore/Framework/src/RunPrincipal.cc +++ b/FWCore/Framework/src/RunPrincipal.cc @@ -28,7 +28,6 @@ namespace edm { fillPrincipal(aux_->processHistoryID(), processHistoryRegistry, reader); for (auto& prod : *this) { - prod->setProcessHistory(processHistory()); prod->setMergeableRunProductMetadata(mergeableRunProductMetadataPtr_.get()); } } diff --git a/FWCore/Framework/src/getProducerParameterSet.cc b/FWCore/Framework/src/getProducerParameterSet.cc index b713e4c838a84..4ef7b4f91b6ef 100644 --- a/FWCore/Framework/src/getProducerParameterSet.cc +++ b/FWCore/Framework/src/getProducerParameterSet.cc @@ -13,23 +13,20 @@ namespace edm { - ParameterSet const* getProducerParameterSet(Provenance const& provenance) { + ParameterSet const* getProducerParameterSet(Provenance const& provenance, ProcessHistory const& processHistory) { const std::shared_ptr& branchDescription = provenance.constBranchDescriptionPtr(); if (branchDescription) { std::string const& process = branchDescription->processName(); std::string const& label = branchDescription->moduleLabel(); - ProcessHistory const* processHistory = provenance.processHistoryPtr(); - if (processHistory) { - for (ProcessConfiguration const& pc : *processHistory) { - if (pc.processName() == process) { - ParameterSetID const& psetID = pc.parameterSetID(); - pset::Registry const* psetRegistry = pset::Registry::instance(); - ParameterSet const* processPset = psetRegistry->getMapped(psetID); - if (processPset) { - return &processPset->getParameterSet(label); - } + for (ProcessConfiguration const& pc : processHistory) { + if (pc.processName() == process) { + ParameterSetID const& psetID = pc.parameterSetID(); + pset::Registry const* psetRegistry = pset::Registry::instance(); + ParameterSet const* processPset = psetRegistry->getMapped(psetID); + if (processPset) { + return &processPset->getParameterSet(label); } } } diff --git a/FWCore/Framework/test/stubs/TestPRegisterModule2.cc b/FWCore/Framework/test/stubs/TestPRegisterModule2.cc index 3d40b0ebe8311..b4b1a118891ea 100644 --- a/FWCore/Framework/test/stubs/TestPRegisterModule2.cc +++ b/FWCore/Framework/test/stubs/TestPRegisterModule2.cc @@ -39,7 +39,6 @@ void TestPRegisterModule2::produce(Event& e, EventSetup const&) { edm::TypeID stringID(stringprod); CPPUNIT_ASSERT(stringID.friendlyClassName() == (*pd)->friendlyClassName()); CPPUNIT_ASSERT((*pd)->moduleLabel() == "m1"); - CPPUNIT_ASSERT((*pd)->releaseVersion() == getReleaseVersion()); ++pd; CPPUNIT_ASSERT(pd != plist.end()); diff --git a/FWCore/Framework/test/stubs/TestTriggerNames.cc b/FWCore/Framework/test/stubs/TestTriggerNames.cc index 86c69b20d5399..e8fafbddc9bc2 100644 --- a/FWCore/Framework/test/stubs/TestTriggerNames.cc +++ b/FWCore/Framework/test/stubs/TestTriggerNames.cc @@ -183,7 +183,7 @@ namespace edmtest { // Test this by getting this parameter set and verifying the trigger // paths are the correct size. if (!streamerSource_) { - ParameterSet const& trigpset = parameterSet(*prod[index].provenance()); + ParameterSet const& trigpset = parameterSet(*prod[index].provenance(), e.processHistory()); Strings trigpaths = trigpset.getParameter("@trigger_paths"); if (trigpaths.size() != expected_trigger_previous_.size()) { throw cms::Exception("Test Failure") diff --git a/FWCore/Integration/test/SwitchProducerProvenanceAnalyzer.cc b/FWCore/Integration/test/SwitchProducerProvenanceAnalyzer.cc index e9cd362d1ab88..001521e2fc063 100644 --- a/FWCore/Integration/test/SwitchProducerProvenanceAnalyzer.cc +++ b/FWCore/Integration/test/SwitchProducerProvenanceAnalyzer.cc @@ -55,8 +55,7 @@ namespace edmtest { assert(provenance != nullptr); auto const* productProvenance = provenance->productProvenance(); assert(productProvenance != nullptr); - auto const* processHistory = provenance->processHistoryPtr(); - assert(processHistory != nullptr); + auto const& processHistory = iEvent.processHistory(); edm::pset::Registry const* psetRegistry = edm::pset::Registry::instance(); assert(psetRegistry != nullptr); @@ -67,7 +66,7 @@ namespace edmtest { assert(productProvenance->branchID() == provenance->branchID()); // Check that the provenance of the Switch itself is recorded correctly - for (edm::ProcessConfiguration const& pc : *processHistory) { + for (edm::ProcessConfiguration const& pc : processHistory) { if (pc.processName() == provenance->processName()) { edm::ParameterSetID const& psetID = pc.parameterSetID(); edm::ParameterSet const* processPSet = psetRegistry->getMapped(psetID); diff --git a/FWCore/Integration/test/TestFindProduct.cc b/FWCore/Integration/test/TestFindProduct.cc index 65fb603291fc9..cc2d5f19d4b63 100644 --- a/FWCore/Integration/test/TestFindProduct.cc +++ b/FWCore/Integration/test/TestFindProduct.cc @@ -126,7 +126,7 @@ namespace edmtest { } if (runProducerParameterCheck_) { - edm::ParameterSet const* producerPset = edm::getProducerParameterSet(*hToken.provenance()); + edm::ParameterSet const* producerPset = edm::getProducerParameterSet(*hToken.provenance(), e.processHistory()); int par = producerPset->getParameter("ivalue"); // These expected values are just from knowing the values in the // configuration files for this test. diff --git a/FWCore/Modules/src/AsciiOutputModule.cc b/FWCore/Modules/src/AsciiOutputModule.cc index 611147138f876..4fe1e9b77dbde 100644 --- a/FWCore/Modules/src/AsciiOutputModule.cc +++ b/FWCore/Modules/src/AsciiOutputModule.cc @@ -88,20 +88,18 @@ namespace edm { BranchDescription const& desc2 = prov.branchDescription(); std::string const& process = desc2.processName(); std::string const& label = desc2.moduleLabel(); - ProcessHistory const* processHistory = prov.processHistoryPtr(); - - if (processHistory) { - for (ProcessConfiguration const& pc : *processHistory) { - if (pc.processName() == process) { - ParameterSetID const& psetID = pc.parameterSetID(); - pset::Registry const* psetRegistry = pset::Registry::instance(); - ParameterSet const* processPset = psetRegistry->getMapped(psetID); - if (processPset) { - if (desc.isAlias()) { - LogAbsolute("AsciiOut") << "Alias PSet\n" << processPset->getParameterSet(desc.moduleLabel()); - } - LogAbsolute("AsciiOut") << processPset->getParameterSet(label) << "\n"; + ProcessHistory const& processHistory = e.processHistory(); + + for (ProcessConfiguration const& pc : processHistory) { + if (pc.processName() == process) { + ParameterSetID const& psetID = pc.parameterSetID(); + pset::Registry const* psetRegistry = pset::Registry::instance(); + ParameterSet const* processPset = psetRegistry->getMapped(psetID); + if (processPset) { + if (desc.isAlias()) { + LogAbsolute("AsciiOut") << "Alias PSet\n" << processPset->getParameterSet(desc.moduleLabel()); } + LogAbsolute("AsciiOut") << processPset->getParameterSet(label) << "\n"; } } } diff --git a/FWCore/Modules/src/EventContentAnalyzer.cc b/FWCore/Modules/src/EventContentAnalyzer.cc index 9689b529077f9..e0428cbf27528 100644 --- a/FWCore/Modules/src/EventContentAnalyzer.cc +++ b/FWCore/Modules/src/EventContentAnalyzer.cc @@ -379,23 +379,21 @@ namespace edm { aliasForModLabel = iEvent.getProvenance(productProvenance->branchID()).moduleLabel(); LogAbsolute("EventContent") << "Is an alias for " << aliasForModLabel; } - ProcessHistory const* processHistory = prov.processHistoryPtr(); - if (processHistory) { - for (ProcessConfiguration const& pc : *processHistory) { - if (pc.processName() == prov.processName()) { - ParameterSetID const& psetID = pc.parameterSetID(); - pset::Registry const* psetRegistry = pset::Registry::instance(); - ParameterSet const* processPset = psetRegistry->getMapped(psetID); - if (processPset) { - if (processPset->existsAs(modLabel)) { - if (isAlias) { - LogAbsolute("EventContent") << "Alias PSet"; - } - LogAbsolute("EventContent") << processPset->getParameterSet(modLabel); - } - if (isAlias and processPset->existsAs(aliasForModLabel)) { - LogAbsolute("EventContent") << processPset->getParameterSet(aliasForModLabel); + ProcessHistory const& processHistory = iEvent.processHistory(); + for (ProcessConfiguration const& pc : processHistory) { + if (pc.processName() == prov.processName()) { + ParameterSetID const& psetID = pc.parameterSetID(); + pset::Registry const* psetRegistry = pset::Registry::instance(); + ParameterSet const* processPset = psetRegistry->getMapped(psetID); + if (processPset) { + if (processPset->existsAs(modLabel)) { + if (isAlias) { + LogAbsolute("EventContent") << "Alias PSet"; } + LogAbsolute("EventContent") << processPset->getParameterSet(modLabel); + } + if (isAlias and processPset->existsAs(aliasForModLabel)) { + LogAbsolute("EventContent") << processPset->getParameterSet(aliasForModLabel); } } } From def96cead89ce4a04bc54656c8251eacb1b1634c Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 27 Nov 2019 09:11:57 -0600 Subject: [PATCH 05/12] Reduced dependency on ProcessHistoryRegistry The code is actually dependent on ProcessHistory and not on ProcessHistoryRegistry (which is just one particular way of getting the ProcessHistory). --- DataFormats/FWLite/interface/HistoryGetterBase.h | 2 +- DataFormats/Provenance/src/Provenance.cc | 1 - .../Provenance/test/indexIntoFile1_t.cppunit.cc | 1 - .../Provenance/test/indexIntoFile2_t.cppunit.cc | 1 - .../Provenance/test/indexIntoFile3_t.cppunit.cc | 1 - .../Provenance/test/indexIntoFile4_t.cppunit.cc | 1 - .../Provenance/test/indexIntoFile5_t.cppunit.cc | 1 - .../Provenance/test/indexIntoFile_t.cppunit.cc | 1 - FWCore/Framework/interface/EventPrincipal.h | 7 +++---- FWCore/Framework/interface/HistoryAppender.h | 1 - .../Framework/interface/LuminosityBlockPrincipal.h | 4 +--- FWCore/Framework/interface/Principal.h | 3 +-- FWCore/Framework/interface/RunPrincipal.h | 1 + FWCore/Framework/src/Event.cc | 1 - FWCore/Framework/src/EventForOutput.cc | 1 - FWCore/Framework/src/EventPrincipal.cc | 14 ++++++++------ FWCore/Framework/src/HistoryAppender.cc | 1 - FWCore/Framework/src/InputSource.cc | 3 ++- FWCore/Framework/src/LuminosityBlockPrincipal.cc | 4 ++-- FWCore/Framework/src/OccurrenceForOutput.cc | 1 - FWCore/Framework/src/Principal.cc | 8 +++----- FWCore/Framework/src/RunPrincipal.cc | 3 ++- FWCore/Framework/src/SubProcess.cc | 4 ++-- FWCore/Framework/test/Event_t.cpp | 2 +- .../test/event_getrefbeforeput_t.cppunit.cc | 7 ++----- FWCore/Framework/test/eventprincipal_t.cppunit.cc | 4 +--- FWCore/Framework/test/generichandle_t.cppunit.cc | 7 ++----- FWCore/Framework/test/global_filter_t.cppunit.cc | 4 +--- .../test/global_outputmodule_t.cppunit.cc | 4 +--- FWCore/Framework/test/global_producer_t.cppunit.cc | 4 +--- FWCore/Framework/test/limited_filter_t.cppunit.cc | 4 +--- .../test/limited_outputmodule_t.cppunit.cc | 4 +--- .../Framework/test/limited_producer_t.cppunit.cc | 4 +--- .../Framework/test/one_outputmodule_t.cppunit.cc | 4 +--- FWCore/Framework/test/stream_filter_t.cppunit.cc | 4 +--- FWCore/Framework/test/stream_producer_t.cppunit.cc | 4 +--- FWCore/Integration/test/ThrowingSource.cc | 3 ++- FWCore/Modules/src/TestSource.cc | 4 +++- FWCore/Sources/interface/IDGeneratorSourceBase.h | 4 +++- FWCore/Sources/src/RawInputSource.cc | 4 +++- FWCore/TFWLiteSelector/src/TFWLiteSelectorBasic.cc | 3 ++- FWCore/TestProcessor/src/TestProcessor.cc | 2 +- IOPool/Input/src/RootFile.cc | 6 ++++-- IOPool/Streamer/src/StreamerInputSource.cc | 3 ++- 44 files changed, 61 insertions(+), 89 deletions(-) diff --git a/DataFormats/FWLite/interface/HistoryGetterBase.h b/DataFormats/FWLite/interface/HistoryGetterBase.h index 7461fcba0adeb..a1323420d2f99 100644 --- a/DataFormats/FWLite/interface/HistoryGetterBase.h +++ b/DataFormats/FWLite/interface/HistoryGetterBase.h @@ -18,7 +18,7 @@ // Created: Wed Feb 10 11:15:16 CST 2010 // -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" +#include "DataFormats/Provenance/interface/ProcessHistory.h" namespace fwlite { class HistoryGetterBase { diff --git a/DataFormats/Provenance/src/Provenance.cc b/DataFormats/Provenance/src/Provenance.cc index adfdebd760a0e..f644bf7bb9deb 100644 --- a/DataFormats/Provenance/src/Provenance.cc +++ b/DataFormats/Provenance/src/Provenance.cc @@ -3,7 +3,6 @@ #include "DataFormats/Provenance/interface/MergeableRunProductMetadataBase.h" #include "DataFormats/Provenance/interface/ProductProvenanceRetriever.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/Registry.h" diff --git a/DataFormats/Provenance/test/indexIntoFile1_t.cppunit.cc b/DataFormats/Provenance/test/indexIntoFile1_t.cppunit.cc index 0a0ab806a2d25..91cb7fad7b79a 100644 --- a/DataFormats/Provenance/test/indexIntoFile1_t.cppunit.cc +++ b/DataFormats/Provenance/test/indexIntoFile1_t.cppunit.cc @@ -7,7 +7,6 @@ #include "DataFormats/Provenance/interface/ProcessHistoryID.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" #include "DataFormats/Provenance/interface/ProcessHistory.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/IndexIntoFile.h" diff --git a/DataFormats/Provenance/test/indexIntoFile2_t.cppunit.cc b/DataFormats/Provenance/test/indexIntoFile2_t.cppunit.cc index 907de42124aff..c3236e79aa2d5 100644 --- a/DataFormats/Provenance/test/indexIntoFile2_t.cppunit.cc +++ b/DataFormats/Provenance/test/indexIntoFile2_t.cppunit.cc @@ -7,7 +7,6 @@ #include "DataFormats/Provenance/interface/ProcessHistoryID.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" #include "DataFormats/Provenance/interface/ProcessHistory.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/IndexIntoFile.h" diff --git a/DataFormats/Provenance/test/indexIntoFile3_t.cppunit.cc b/DataFormats/Provenance/test/indexIntoFile3_t.cppunit.cc index d4de0c5bbbde6..857d27f0210b9 100644 --- a/DataFormats/Provenance/test/indexIntoFile3_t.cppunit.cc +++ b/DataFormats/Provenance/test/indexIntoFile3_t.cppunit.cc @@ -7,7 +7,6 @@ #include "DataFormats/Provenance/interface/ProcessHistoryID.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" #include "DataFormats/Provenance/interface/ProcessHistory.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/IndexIntoFile.h" diff --git a/DataFormats/Provenance/test/indexIntoFile4_t.cppunit.cc b/DataFormats/Provenance/test/indexIntoFile4_t.cppunit.cc index 6ec18a6cbf0a4..9233a7c96df6e 100644 --- a/DataFormats/Provenance/test/indexIntoFile4_t.cppunit.cc +++ b/DataFormats/Provenance/test/indexIntoFile4_t.cppunit.cc @@ -7,7 +7,6 @@ #include "DataFormats/Provenance/interface/ProcessHistoryID.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" #include "DataFormats/Provenance/interface/ProcessHistory.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/IndexIntoFile.h" diff --git a/DataFormats/Provenance/test/indexIntoFile5_t.cppunit.cc b/DataFormats/Provenance/test/indexIntoFile5_t.cppunit.cc index c661d77c7969f..846399661ebba 100644 --- a/DataFormats/Provenance/test/indexIntoFile5_t.cppunit.cc +++ b/DataFormats/Provenance/test/indexIntoFile5_t.cppunit.cc @@ -7,7 +7,6 @@ #include "DataFormats/Provenance/interface/ProcessHistoryID.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" #include "DataFormats/Provenance/interface/ProcessHistory.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/IndexIntoFile.h" diff --git a/DataFormats/Provenance/test/indexIntoFile_t.cppunit.cc b/DataFormats/Provenance/test/indexIntoFile_t.cppunit.cc index e506fcbaf896d..fab1b41dd7b3b 100644 --- a/DataFormats/Provenance/test/indexIntoFile_t.cppunit.cc +++ b/DataFormats/Provenance/test/indexIntoFile_t.cppunit.cc @@ -7,7 +7,6 @@ #include "DataFormats/Provenance/interface/ProcessHistoryID.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" #include "DataFormats/Provenance/interface/ProcessHistory.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/IndexIntoFile.h" diff --git a/FWCore/Framework/interface/EventPrincipal.h b/FWCore/Framework/interface/EventPrincipal.h index c6bd8b3586aff..7a84b50d759cb 100644 --- a/FWCore/Framework/interface/EventPrincipal.h +++ b/FWCore/Framework/interface/EventPrincipal.h @@ -40,7 +40,6 @@ namespace edm { class StreamContext; class ThinnedAssociation; class ThinnedAssociationsHelper; - class ProcessHistoryRegistry; class RunPrincipal; class EventPrincipal : public Principal { @@ -61,15 +60,15 @@ namespace edm { ~EventPrincipal() override {} void fillEventPrincipal(EventAuxiliary const& aux, - ProcessHistoryRegistry const& processHistoryRegistry, + ProcessHistory const* processHistory, DelayedReader* reader = nullptr); void fillEventPrincipal(EventAuxiliary const& aux, - ProcessHistoryRegistry const& processHistoryRegistry, + ProcessHistory const* processHistory, EventSelectionIDVector&& eventSelectionIDs, BranchListIndexes&& branchListIndexes); //provRetriever is changed via a call to ProductProvenanceRetriever::deepSwap void fillEventPrincipal(EventAuxiliary const& aux, - ProcessHistoryRegistry const& processHistoryRegistry, + ProcessHistory const* processHistory, EventSelectionIDVector&& eventSelectionIDs, BranchListIndexes&& branchListIndexes, ProductProvenanceRetriever const& provRetriever, diff --git a/FWCore/Framework/interface/HistoryAppender.h b/FWCore/Framework/interface/HistoryAppender.h index 11ade9f95d2f5..836e3f3fb07b3 100644 --- a/FWCore/Framework/interface/HistoryAppender.h +++ b/FWCore/Framework/interface/HistoryAppender.h @@ -9,7 +9,6 @@ namespace edm { class ProcessConfiguration; - class ProcessHistoryRegistry; class HistoryAppender { public: diff --git a/FWCore/Framework/interface/LuminosityBlockPrincipal.h b/FWCore/Framework/interface/LuminosityBlockPrincipal.h index 43f4d4aee7df8..4f71d35bb61b3 100644 --- a/FWCore/Framework/interface/LuminosityBlockPrincipal.h +++ b/FWCore/Framework/interface/LuminosityBlockPrincipal.h @@ -26,7 +26,6 @@ namespace edm { class HistoryAppender; class ModuleCallingContext; - class ProcessHistoryRegistry; class RunPrincipal; class LuminosityBlockPrincipal : public Principal { @@ -41,8 +40,7 @@ namespace edm { ~LuminosityBlockPrincipal() override {} - void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const& processHistoryRegistry, - DelayedReader* reader = nullptr); + void fillLuminosityBlockPrincipal(ProcessHistory const* processHistory, DelayedReader* reader = nullptr); RunPrincipal const& runPrincipal() const { return *runPrincipal_; } diff --git a/FWCore/Framework/interface/Principal.h b/FWCore/Framework/interface/Principal.h index eae9e2c0ca751..c3187b558e94f 100644 --- a/FWCore/Framework/interface/Principal.h +++ b/FWCore/Framework/interface/Principal.h @@ -43,7 +43,6 @@ namespace edm { class HistoryAppender; class MergeableRunProductMetadata; class ModuleCallingContext; - class ProcessHistoryRegistry; class ProductResolverIndexHelper; class EDConsumerBase; class SharedResourcesAcquirer; @@ -81,7 +80,7 @@ namespace edm { void adjustIndexesAfterProductRegistryAddition(); - void fillPrincipal(ProcessHistoryID const& hist, ProcessHistoryRegistry const& phr, DelayedReader* reader); + void fillPrincipal(ProcessHistoryID const& hist, ProcessHistory const* phr, DelayedReader* reader); void clearPrincipal(); diff --git a/FWCore/Framework/interface/RunPrincipal.h b/FWCore/Framework/interface/RunPrincipal.h index c250dd5c97464..ef1e51553e7be 100644 --- a/FWCore/Framework/interface/RunPrincipal.h +++ b/FWCore/Framework/interface/RunPrincipal.h @@ -29,6 +29,7 @@ namespace edm { class MergeableRunProductProcesses; class MergeableRunProductMetadata; class ModuleCallingContext; + class ProcessHistoryRegistry; class RunPrincipal : public Principal { public: diff --git a/FWCore/Framework/src/Event.cc b/FWCore/Framework/src/Event.cc index ecc9f6843f3ae..978fd3b955e87 100644 --- a/FWCore/Framework/src/Event.cc +++ b/FWCore/Framework/src/Event.cc @@ -1,7 +1,6 @@ #include "FWCore/Framework/interface/Event.h" #include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/Provenance.h" #include "DataFormats/Provenance/interface/StableProvenance.h" #include "DataFormats/Provenance/interface/ParentageRegistry.h" diff --git a/FWCore/Framework/src/EventForOutput.cc b/FWCore/Framework/src/EventForOutput.cc index 4892ea83c994f..6f318cb281e71 100644 --- a/FWCore/Framework/src/EventForOutput.cc +++ b/FWCore/Framework/src/EventForOutput.cc @@ -1,7 +1,6 @@ #include "FWCore/Framework/interface/EventForOutput.h" #include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "FWCore/Common/interface/TriggerResultsByName.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/LuminosityBlockForOutput.h" diff --git a/FWCore/Framework/src/EventPrincipal.cc b/FWCore/Framework/src/EventPrincipal.cc index 66348945a6255..47aea85c18852 100644 --- a/FWCore/Framework/src/EventPrincipal.cc +++ b/FWCore/Framework/src/EventPrincipal.cc @@ -57,7 +57,7 @@ namespace edm { } void EventPrincipal::fillEventPrincipal(EventAuxiliary const& aux, - ProcessHistoryRegistry const& processHistoryRegistry, + ProcessHistory const* processHistory, EventSelectionIDVector&& eventSelectionIDs, BranchListIndexes&& branchListIndexes, ProductProvenanceRetriever const& provRetriever, @@ -74,11 +74,11 @@ namespace edm { // Add index into BranchIDListRegistry for products produced this process branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex()); } - fillEventPrincipal(aux, processHistoryRegistry, reader); + fillEventPrincipal(aux, processHistory, reader); } void EventPrincipal::fillEventPrincipal(EventAuxiliary const& aux, - ProcessHistoryRegistry const& processHistoryRegistry, + ProcessHistory const* processHistory, EventSelectionIDVector&& eventSelectionIDs, BranchListIndexes&& branchListIndexes) { eventSelectionIDs_ = std::move(eventSelectionIDs); @@ -87,18 +87,18 @@ namespace edm { // Add index into BranchIDListRegistry for products produced this process branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex()); } - fillEventPrincipal(aux, processHistoryRegistry, nullptr); + fillEventPrincipal(aux, processHistory, nullptr); } void EventPrincipal::fillEventPrincipal(EventAuxiliary const& aux, - ProcessHistoryRegistry const& processHistoryRegistry, + ProcessHistory const* processHistory, DelayedReader* reader) { if (aux.event() == invalidEventNumber) { throw Exception(errors::LogicError) << "EventPrincipal::fillEventPrincipal, Invalid event number provided in " "EventAuxiliary, It is illegal for the event number to be 0\n"; } - fillPrincipal(aux.processHistoryID(), processHistoryRegistry, reader); + fillPrincipal(aux.processHistoryID(), processHistory, reader); aux_ = aux; aux_.setProcessHistoryID(processHistoryID()); @@ -126,6 +126,8 @@ namespace edm { // Under that condition, we want the ProductID to be the same as the original. // If not, then we've internally changed the original BranchID to the alias BranchID // in the ProductID lookup so we need the alias BranchID. + + // NOTE:productProvenanceRetrieverPtr() always returns the same pointer auto const& bd = prod->branchDescription(); prod->setProvenance(productProvenanceRetrieverPtr(), branchIDToProductID(bd.isAlias() ? bd.originalBranchID() : bd.branchID())); diff --git a/FWCore/Framework/src/HistoryAppender.cc b/FWCore/Framework/src/HistoryAppender.cc index 87b127b1b0c5e..ed17193e2b235 100644 --- a/FWCore/Framework/src/HistoryAppender.cc +++ b/FWCore/Framework/src/HistoryAppender.cc @@ -1,6 +1,5 @@ #include "FWCore/Framework/interface/HistoryAppender.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "FWCore/Utilities/interface/EDMException.h" #include diff --git a/FWCore/Framework/src/InputSource.cc b/FWCore/Framework/src/InputSource.cc index dd736b78da2ff..da5807c023004 100644 --- a/FWCore/Framework/src/InputSource.cc +++ b/FWCore/Framework/src/InputSource.cc @@ -274,7 +274,8 @@ namespace edm { } void InputSource::readLuminosityBlock_(LuminosityBlockPrincipal& lumiPrincipal) { - lumiPrincipal.fillLuminosityBlockPrincipal(processHistoryRegistry()); + auto history = processHistoryRegistry().getMapped(lumiPrincipal.aux().processHistoryID()); + lumiPrincipal.fillLuminosityBlockPrincipal(history); } void InputSource::readEvent(EventPrincipal& ep, StreamContext& streamContext) { diff --git a/FWCore/Framework/src/LuminosityBlockPrincipal.cc b/FWCore/Framework/src/LuminosityBlockPrincipal.cc index 09aa1b7214020..4f6f6347ea337 100644 --- a/FWCore/Framework/src/LuminosityBlockPrincipal.cc +++ b/FWCore/Framework/src/LuminosityBlockPrincipal.cc @@ -13,9 +13,9 @@ namespace edm { runPrincipal_(), index_(index) {} - void LuminosityBlockPrincipal::fillLuminosityBlockPrincipal(ProcessHistoryRegistry const& processHistoryRegistry, + void LuminosityBlockPrincipal::fillLuminosityBlockPrincipal(ProcessHistory const* processHistory, DelayedReader* reader) { - fillPrincipal(aux_.processHistoryID(), processHistoryRegistry, reader); + fillPrincipal(aux_.processHistoryID(), processHistory, reader); } void LuminosityBlockPrincipal::put(BranchDescription const& bd, std::unique_ptr edp) const { diff --git a/FWCore/Framework/src/OccurrenceForOutput.cc b/FWCore/Framework/src/OccurrenceForOutput.cc index 1462ee25bb5bd..2e80769afe670 100644 --- a/FWCore/Framework/src/OccurrenceForOutput.cc +++ b/FWCore/Framework/src/OccurrenceForOutput.cc @@ -1,7 +1,6 @@ #include "FWCore/Framework/interface/OccurrenceForOutput.h" #include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/Provenance.h" #include "DataFormats/Provenance/interface/StableProvenance.h" #include "FWCore/Common/interface/TriggerResultsByName.h" diff --git a/FWCore/Framework/src/Principal.cc b/FWCore/Framework/src/Principal.cc index 3318003f396a5..cf52c4a3e06d2 100644 --- a/FWCore/Framework/src/Principal.cc +++ b/FWCore/Framework/src/Principal.cc @@ -4,7 +4,6 @@ #include "FWCore/Framework/interface/Principal.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductResolverIndexHelper.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Common/interface/FunctorHandleExceptionFactory.h" @@ -393,7 +392,7 @@ namespace edm { // Set the principal for the Event, Lumi, or Run. void Principal::fillPrincipal(ProcessHistoryID const& hist, - ProcessHistoryRegistry const& processHistoryRegistry, + ProcessHistory const* processHistory, DelayedReader* reader) { //increment identifier here since clearPrincipal isn't called for Run/Lumi cacheIdentifier_ = nextIdentifier(); @@ -403,8 +402,7 @@ namespace edm { if (historyAppender_ && productRegistry().anyProductProduced()) { if ((not processHistoryPtr_) || (processHistoryIDBeforeConfig_ != hist)) { - processHistoryPtr_ = historyAppender_->appendToProcessHistory( - hist, processHistoryRegistry.getMapped(hist), *processConfiguration_); + processHistoryPtr_ = historyAppender_->appendToProcessHistory(hist, processHistory, *processConfiguration_); processHistoryID_ = processHistoryPtr_->id(); processHistoryIDBeforeConfig_ = hist; } @@ -414,7 +412,7 @@ namespace edm { if (hist.isValid()) { //does not own the pointer auto noDel = [](void const*) {}; - inputProcessHistory = std::shared_ptr(processHistoryRegistry.getMapped(hist), noDel); + inputProcessHistory = std::shared_ptr(processHistory, noDel); if (inputProcessHistory.get() == nullptr) { throw Exception(errors::LogicError) << "Principal::fillPrincipal\n" << "Input ProcessHistory not found in registry\n" diff --git a/FWCore/Framework/src/RunPrincipal.cc b/FWCore/Framework/src/RunPrincipal.cc index 8c67ef9b24b3c..f2f56768cbd31 100644 --- a/FWCore/Framework/src/RunPrincipal.cc +++ b/FWCore/Framework/src/RunPrincipal.cc @@ -25,7 +25,8 @@ namespace edm { void RunPrincipal::fillRunPrincipal(ProcessHistoryRegistry const& processHistoryRegistry, DelayedReader* reader) { m_reducedHistoryID = processHistoryRegistry.reducedProcessHistoryID(aux_->processHistoryID()); - fillPrincipal(aux_->processHistoryID(), processHistoryRegistry, reader); + auto history = processHistoryRegistry.getMapped(aux_->processHistoryID()); + fillPrincipal(aux_->processHistoryID(), history, reader); for (auto& prod : *this) { prod->setMergeableRunProductMetadata(mergeableRunProductMetadataPtr_.get()); diff --git a/FWCore/Framework/src/SubProcess.cc b/FWCore/Framework/src/SubProcess.cc index a51fcbfd6a978..bf16df9024a58 100644 --- a/FWCore/Framework/src/SubProcess.cc +++ b/FWCore/Framework/src/SubProcess.cc @@ -361,7 +361,7 @@ namespace edm { bool deepCopyRetriever = false; ep.fillEventPrincipal( aux, - processHistoryRegistry, + &principal.processHistory(), std::move(esids), std::move(bli), *(principal.productProvenanceRetrieverPtr()), //NOTE: this transfers the per product provenance @@ -504,7 +504,7 @@ namespace edm { auto& processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_ + lbpp->index()]; inUseLumiPrincipals_[principal.index()] = lbpp; processHistoryRegistry.registerProcessHistory(principal.processHistory()); - lbpp->fillLuminosityBlockPrincipal(processHistoryRegistry, principal.reader()); + lbpp->fillLuminosityBlockPrincipal(&principal.processHistory(), principal.reader()); lbpp->setRunPrincipal(principalCache_.runPrincipalPtr()); LuminosityBlockPrincipal& lbp = *lbpp; propagateProducts(InLumi, principal, lbp); diff --git a/FWCore/Framework/test/Event_t.cpp b/FWCore/Framework/test/Event_t.cpp index 4f409f04fdd8f..f57128a2a74f2 100644 --- a/FWCore/Framework/test/Event_t.cpp +++ b/FWCore/Framework/test/Event_t.cpp @@ -458,7 +458,7 @@ void testEvent::setUp() { const_cast(eventAux.processHistoryID()) = processHistoryID; principal_.reset(new edm::EventPrincipal( preg, branchIDListHelper_, thinnedAssociationsHelper_, pc, &historyAppender_, edm::StreamID::invalidStreamID())); - principal_->fillEventPrincipal(eventAux, processHistoryRegistry_); + principal_->fillEventPrincipal(eventAux, processHistoryRegistry_.getMapped(eventAux.processHistoryID())); principal_->setLuminosityBlockPrincipal(lbp_.get()); ModuleCallingContext mcc(currentModuleDescription_.get()); currentEvent_.reset(new Event(*principal_, *currentModuleDescription_, &mcc)); diff --git a/FWCore/Framework/test/event_getrefbeforeput_t.cppunit.cc b/FWCore/Framework/test/event_getrefbeforeput_t.cppunit.cc index 74f1ce88a5541..27d68eb9ba414 100644 --- a/FWCore/Framework/test/event_getrefbeforeput_t.cppunit.cc +++ b/FWCore/Framework/test/event_getrefbeforeput_t.cppunit.cc @@ -8,7 +8,6 @@ Test of the EventPrincipal class. #include "DataFormats/Provenance/interface/ModuleDescription.h" #include "DataFormats/Provenance/interface/RunAuxiliary.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchDescription.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" @@ -86,8 +85,7 @@ void testEventGetRefBeforePut::failGetProductNotRegisteredTest() { edm::EventAuxiliary eventAux(col, uuid, fakeTime, true); edm::EventPrincipal ep( pregc, branchIDListHelper, thinnedAssociationsHelper, pc, &historyAppender_, edm::StreamID::invalidStreamID()); - edm::ProcessHistoryRegistry phr; - ep.fillEventPrincipal(eventAux, phr); + ep.fillEventPrincipal(eventAux, nullptr); ep.setLuminosityBlockPrincipal(lbp.get()); try { edm::ParameterSet pset; @@ -181,8 +179,7 @@ void testEventGetRefBeforePut::getRefTest() { edm::EventAuxiliary eventAux(col, uuid, fakeTime, true); edm::EventPrincipal ep( pregc, branchIDListHelper, thinnedAssociationsHelper, pc, &historyAppender_, edm::StreamID::invalidStreamID()); - edm::ProcessHistoryRegistry phr; - ep.fillEventPrincipal(eventAux, phr); + ep.fillEventPrincipal(eventAux, nullptr); ep.setLuminosityBlockPrincipal(lbp.get()); edm::RefProd refToProd; diff --git a/FWCore/Framework/test/eventprincipal_t.cppunit.cc b/FWCore/Framework/test/eventprincipal_t.cppunit.cc index eb9654f0bef4b..9aa297ef1cae8 100644 --- a/FWCore/Framework/test/eventprincipal_t.cppunit.cc +++ b/FWCore/Framework/test/eventprincipal_t.cppunit.cc @@ -13,7 +13,6 @@ Test of the EventPrincipal class. #include "DataFormats/Provenance/interface/ParameterSetID.h" #include "DataFormats/Provenance/interface/Parentage.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductID.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/Timestamp.h" @@ -187,8 +186,7 @@ void test_ep::setUp() { *process, &historyAppender_, edm::StreamID::invalidStreamID())); - edm::ProcessHistoryRegistry phr; - pEvent_->fillEventPrincipal(eventAux, phr); + pEvent_->fillEventPrincipal(eventAux, nullptr); pEvent_->setLuminosityBlockPrincipal(lbp_.get()); pEvent_->put(branchFromRegistry, std::move(product), prov); } diff --git a/FWCore/Framework/test/generichandle_t.cppunit.cc b/FWCore/Framework/test/generichandle_t.cppunit.cc index b36f771914550..ce4b0f39f76d5 100644 --- a/FWCore/Framework/test/generichandle_t.cppunit.cc +++ b/FWCore/Framework/test/generichandle_t.cppunit.cc @@ -8,7 +8,6 @@ Test of GenericHandle class. #include "DataFormats/Provenance/interface/EventAuxiliary.h" #include "DataFormats/Provenance/interface/LuminosityBlockAuxiliary.h" #include "DataFormats/Provenance/interface/ModuleDescription.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/RunAuxiliary.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -90,8 +89,7 @@ void testGenericHandle::failgetbyLabelTest() { edm::EventAuxiliary eventAux(id, uuid, time, true); edm::EventPrincipal ep( preg, branchIDListHelper, thinnedAssociationsHelper, pc, &historyAppender_, edm::StreamID::invalidStreamID()); - edm::ProcessHistoryRegistry phr; - ep.fillEventPrincipal(eventAux, phr); + ep.fillEventPrincipal(eventAux, nullptr); ep.setLuminosityBlockPrincipal(lbp.get()); edm::GenericHandle h("edmtest::DummyProduct"); bool didThrow = true; @@ -174,8 +172,7 @@ void testGenericHandle::getbyLabelTest() { edm::EventAuxiliary eventAux(col, uuid, fakeTime, true); edm::EventPrincipal ep( pregc, branchIDListHelper, thinnedAssociationsHelper, pc, &historyAppender_, edm::StreamID::invalidStreamID()); - edm::ProcessHistoryRegistry phr; - ep.fillEventPrincipal(eventAux, phr); + ep.fillEventPrincipal(eventAux, nullptr); ep.setLuminosityBlockPrincipal(lbp.get()); edm::BranchDescription const& branchFromRegistry = it->second; std::vector const ids; diff --git a/FWCore/Framework/test/global_filter_t.cppunit.cc b/FWCore/Framework/test/global_filter_t.cppunit.cc index 35b7509e08038..5cdc452c5a508 100644 --- a/FWCore/Framework/test/global_filter_t.cppunit.cc +++ b/FWCore/Framework/test/global_filter_t.cppunit.cc @@ -15,7 +15,6 @@ #include "FWCore/Framework/src/ModuleHolder.h" #include "FWCore/Framework/src/PreallocationConfiguration.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -372,8 +371,7 @@ testGlobalFilter::testGlobalFilter() edm::EventAuxiliary eventAux(eventID, uuid, now, true); m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr)); - edm::ProcessHistoryRegistry phr; - m_ep->fillEventPrincipal(eventAux, phr); + m_ep->fillEventPrincipal(eventAux, nullptr); m_ep->setLuminosityBlockPrincipal(m_lbp.get()); m_actReg.reset(new edm::ActivityRegistry); diff --git a/FWCore/Framework/test/global_outputmodule_t.cppunit.cc b/FWCore/Framework/test/global_outputmodule_t.cppunit.cc index 76fcb750afc7e..79c66e2f75beb 100644 --- a/FWCore/Framework/test/global_outputmodule_t.cppunit.cc +++ b/FWCore/Framework/test/global_outputmodule_t.cppunit.cc @@ -12,7 +12,6 @@ #include "FWCore/Framework/src/OutputModuleCommunicatorT.h" #include "FWCore/Framework/src/WorkerT.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -167,8 +166,7 @@ testGlobalOutputModule::testGlobalOutputModule() edm::EventAuxiliary eventAux(eventID, uuid, now, true); m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr)); - edm::ProcessHistoryRegistry phr; - m_ep->fillEventPrincipal(eventAux, phr); + m_ep->fillEventPrincipal(eventAux, nullptr); m_ep->setLuminosityBlockPrincipal(m_lbp.get()); m_actReg.reset(new edm::ActivityRegistry); diff --git a/FWCore/Framework/test/global_producer_t.cppunit.cc b/FWCore/Framework/test/global_producer_t.cppunit.cc index 7a4473c8e9bd1..600214c44f294 100644 --- a/FWCore/Framework/test/global_producer_t.cppunit.cc +++ b/FWCore/Framework/test/global_producer_t.cppunit.cc @@ -15,7 +15,6 @@ #include "FWCore/Framework/src/ModuleHolder.h" #include "FWCore/Framework/src/PreallocationConfiguration.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -336,8 +335,7 @@ testGlobalProducer::testGlobalProducer() edm::EventAuxiliary eventAux(eventID, uuid, now, true); m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr)); - edm::ProcessHistoryRegistry phr; - m_ep->fillEventPrincipal(eventAux, phr); + m_ep->fillEventPrincipal(eventAux, nullptr); m_ep->setLuminosityBlockPrincipal(m_lbp.get()); m_actReg.reset(new edm::ActivityRegistry); diff --git a/FWCore/Framework/test/limited_filter_t.cppunit.cc b/FWCore/Framework/test/limited_filter_t.cppunit.cc index a5a6892884b80..257b020fc59c0 100644 --- a/FWCore/Framework/test/limited_filter_t.cppunit.cc +++ b/FWCore/Framework/test/limited_filter_t.cppunit.cc @@ -15,7 +15,6 @@ #include "FWCore/Framework/src/ModuleHolder.h" #include "FWCore/Framework/src/PreallocationConfiguration.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -400,8 +399,7 @@ testLimitedFilter::testLimitedFilter() edm::EventAuxiliary eventAux(eventID, uuid, now, true); m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr)); - edm::ProcessHistoryRegistry phr; - m_ep->fillEventPrincipal(eventAux, phr); + m_ep->fillEventPrincipal(eventAux, nullptr); m_ep->setLuminosityBlockPrincipal(m_lbp.get()); m_actReg.reset(new edm::ActivityRegistry); diff --git a/FWCore/Framework/test/limited_outputmodule_t.cppunit.cc b/FWCore/Framework/test/limited_outputmodule_t.cppunit.cc index c7b0c682dd974..6370b28c508f2 100644 --- a/FWCore/Framework/test/limited_outputmodule_t.cppunit.cc +++ b/FWCore/Framework/test/limited_outputmodule_t.cppunit.cc @@ -12,7 +12,6 @@ #include "FWCore/Framework/src/OutputModuleCommunicatorT.h" #include "FWCore/Framework/src/WorkerT.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -166,8 +165,7 @@ testLimitedOutputModule::testLimitedOutputModule() edm::EventAuxiliary eventAux(eventID, uuid, now, true); m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr)); - edm::ProcessHistoryRegistry phr; - m_ep->fillEventPrincipal(eventAux, phr); + m_ep->fillEventPrincipal(eventAux, nullptr); m_ep->setLuminosityBlockPrincipal(m_lbp.get()); m_actReg.reset(new edm::ActivityRegistry); diff --git a/FWCore/Framework/test/limited_producer_t.cppunit.cc b/FWCore/Framework/test/limited_producer_t.cppunit.cc index c92ce4136021e..dc48c80a3365d 100644 --- a/FWCore/Framework/test/limited_producer_t.cppunit.cc +++ b/FWCore/Framework/test/limited_producer_t.cppunit.cc @@ -15,7 +15,6 @@ #include "FWCore/Framework/src/ModuleHolder.h" #include "FWCore/Framework/src/PreallocationConfiguration.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -367,8 +366,7 @@ testLimitedProducer::testLimitedProducer() edm::EventAuxiliary eventAux(eventID, uuid, now, true); m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr)); - edm::ProcessHistoryRegistry phr; - m_ep->fillEventPrincipal(eventAux, phr); + m_ep->fillEventPrincipal(eventAux, nullptr); m_ep->setLuminosityBlockPrincipal(m_lbp.get()); m_actReg.reset(new edm::ActivityRegistry); diff --git a/FWCore/Framework/test/one_outputmodule_t.cppunit.cc b/FWCore/Framework/test/one_outputmodule_t.cppunit.cc index f99ca94123cf3..53957a5fb76e6 100644 --- a/FWCore/Framework/test/one_outputmodule_t.cppunit.cc +++ b/FWCore/Framework/test/one_outputmodule_t.cppunit.cc @@ -14,7 +14,6 @@ #include "FWCore/Framework/src/OutputModuleCommunicatorT.h" #include "FWCore/Framework/src/WorkerT.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -261,8 +260,7 @@ testOneOutputModule::testOneOutputModule() edm::EventAuxiliary eventAux(eventID, uuid, now, true); m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr)); - edm::ProcessHistoryRegistry phr; - m_ep->fillEventPrincipal(eventAux, phr); + m_ep->fillEventPrincipal(eventAux, nullptr); m_ep->setLuminosityBlockPrincipal(m_lbp.get()); m_actReg.reset(new edm::ActivityRegistry); diff --git a/FWCore/Framework/test/stream_filter_t.cppunit.cc b/FWCore/Framework/test/stream_filter_t.cppunit.cc index cdb2f3b4d02b5..c83831971d376 100644 --- a/FWCore/Framework/test/stream_filter_t.cppunit.cc +++ b/FWCore/Framework/test/stream_filter_t.cppunit.cc @@ -16,7 +16,6 @@ #include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/stream/EDProducerAdaptor.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -418,8 +417,7 @@ testStreamFilter::testStreamFilter() assert(pID->value() == 0); m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr, *pID)); - edm::ProcessHistoryRegistry phr; - m_ep->fillEventPrincipal(eventAux, phr); + m_ep->fillEventPrincipal(eventAux, nullptr); m_ep->setLuminosityBlockPrincipal(m_lbp.get()); m_actReg.reset(new edm::ActivityRegistry); diff --git a/FWCore/Framework/test/stream_producer_t.cppunit.cc b/FWCore/Framework/test/stream_producer_t.cppunit.cc index 530f45cc4581e..044d355e3043e 100644 --- a/FWCore/Framework/test/stream_producer_t.cppunit.cc +++ b/FWCore/Framework/test/stream_producer_t.cppunit.cc @@ -16,7 +16,6 @@ #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/stream/EDProducerAdaptor.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h" @@ -382,8 +381,7 @@ testStreamProducer::testStreamProducer() assert(pID->value() == 0); m_ep.reset(new edm::EventPrincipal(m_prodReg, m_idHelper, m_associationsHelper, m_procConfig, nullptr, *pID)); - edm::ProcessHistoryRegistry phr; - m_ep->fillEventPrincipal(eventAux, phr); + m_ep->fillEventPrincipal(eventAux, nullptr); m_ep->setLuminosityBlockPrincipal(m_lbp.get()); m_actReg.reset(new edm::ActivityRegistry); diff --git a/FWCore/Integration/test/ThrowingSource.cc b/FWCore/Integration/test/ThrowingSource.cc index 69a3e424c3138..a9010263b1cb9 100644 --- a/FWCore/Integration/test/ThrowingSource.cc +++ b/FWCore/Integration/test/ThrowingSource.cc @@ -118,7 +118,8 @@ namespace edm { throw cms::Exception("TestThrow") << "ThrowingSource::readEvent_"; assert(eventCached() || processingMode() != RunsLumisAndEvents); EventAuxiliary aux(eventID(), processGUID(), Timestamp(presentTime()), false, EventAuxiliary::Undefined); - eventPrincipal.fillEventPrincipal(aux, processHistoryRegistry()); + auto history = processHistoryRegistry().getMapped(aux.processHistoryID()); + eventPrincipal.fillEventPrincipal(aux, history); } } // namespace edm diff --git a/FWCore/Modules/src/TestSource.cc b/FWCore/Modules/src/TestSource.cc index 32dc2a39b5fe3..fa9378a4ff507 100644 --- a/FWCore/Modules/src/TestSource.cc +++ b/FWCore/Modules/src/TestSource.cc @@ -85,7 +85,9 @@ namespace edm { auto it = m_nextTransition; --it; EventAuxiliary aux(it->second, processGUID(), Timestamp(0), false); - eventPrincipal.fillEventPrincipal(aux, processHistoryRegistry()); + auto history = processHistoryRegistry().getMapped(aux.processHistoryID()); + + eventPrincipal.fillEventPrincipal(aux, history); } void TestSource::fillDescriptions(ConfigurationDescriptions& descriptions) { diff --git a/FWCore/Sources/interface/IDGeneratorSourceBase.h b/FWCore/Sources/interface/IDGeneratorSourceBase.h index 55497668adfca..ff42c8abcd259 100644 --- a/FWCore/Sources/interface/IDGeneratorSourceBase.h +++ b/FWCore/Sources/interface/IDGeneratorSourceBase.h @@ -12,6 +12,7 @@ #include "DataFormats/Provenance/interface/RunID.h" #include "DataFormats/Provenance/interface/LuminosityBlockID.h" #include "DataFormats/Provenance/interface/RunLumiEventNumber.h" +#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include #include @@ -44,7 +45,8 @@ namespace edm { void doReadEvent(EventPrincipal& eventPrincipal, F&& f) { assert(BASE::eventCached() || BASE::processingMode() != BASE::RunsLumisAndEvents); EventAuxiliary aux(eventID_, BASE::processGUID(), Timestamp(presentTime_), isRealData_, eType_); - eventPrincipal.fillEventPrincipal(aux, BASE::processHistoryRegistry()); + auto history = BASE::processHistoryRegistry().getMapped(aux.processHistoryID()); + eventPrincipal.fillEventPrincipal(aux, history); f(eventPrincipal); BASE::resetEventCached(); } diff --git a/FWCore/Sources/src/RawInputSource.cc b/FWCore/Sources/src/RawInputSource.cc index dcdb4fac4c10b..a465ea535da9b 100644 --- a/FWCore/Sources/src/RawInputSource.cc +++ b/FWCore/Sources/src/RawInputSource.cc @@ -7,6 +7,7 @@ #include "DataFormats/Provenance/interface/LuminosityBlockAuxiliary.h" #include "DataFormats/Provenance/interface/RunAuxiliary.h" #include "DataFormats/Provenance/interface/Timestamp.h" +#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -47,7 +48,8 @@ namespace edm { } void RawInputSource::makeEvent(EventPrincipal& eventPrincipal, EventAuxiliary const& eventAuxiliary) { - eventPrincipal.fillEventPrincipal(eventAuxiliary, processHistoryRegistry()); + auto history = processHistoryRegistry().getMapped(eventAuxiliary.processHistoryID()); + eventPrincipal.fillEventPrincipal(eventAuxiliary, history); } InputSource::ItemType RawInputSource::getNextItemType() { diff --git a/FWCore/TFWLiteSelector/src/TFWLiteSelectorBasic.cc b/FWCore/TFWLiteSelector/src/TFWLiteSelectorBasic.cc index a38d144c29552..964f9fdc5d9d1 100644 --- a/FWCore/TFWLiteSelector/src/TFWLiteSelectorBasic.cc +++ b/FWCore/TFWLiteSelector/src/TFWLiteSelectorBasic.cc @@ -329,8 +329,9 @@ Bool_t TFWLiteSelectorBasic::Process(Long64_t iEntry) { auto rp = std::make_shared(runAux, m_->reg(), m_->pc_, nullptr, 0); auto lbp = std::make_shared(m_->reg(), m_->pc_, nullptr, 0); lbp->setAux(edm::LuminosityBlockAuxiliary(rp->run(), 1, aux.time(), aux.time())); + auto history = m_->phreg_->getMapped(eaux->processHistoryID()); m_->ep_->fillEventPrincipal(*eaux, - *m_->phreg_, + history, std::move(eventSelectionIDs), std::move(branchListIndexes), *(m_->provRetriever_), diff --git a/FWCore/TestProcessor/src/TestProcessor.cc b/FWCore/TestProcessor/src/TestProcessor.cc index c21b85b15c6c5..6b94f960c692a 100644 --- a/FWCore/TestProcessor/src/TestProcessor.cc +++ b/FWCore/TestProcessor/src/TestProcessor.cc @@ -394,7 +394,7 @@ namespace edm { pep->clearEventPrincipal(); pep->fillEventPrincipal( edm::EventAuxiliary(EventID(runNumber_, lumiNumber_, eventNumber_), "", Timestamp(), false), - processHistoryRegistry_, + nullptr, nullptr); assert(lumiPrincipal_.get() != nullptr); pep->setLuminosityBlockPrincipal(lumiPrincipal_.get()); diff --git a/IOPool/Input/src/RootFile.cc b/IOPool/Input/src/RootFile.cc index b6e6ed6b2212d..353272d774557 100644 --- a/IOPool/Input/src/RootFile.cc +++ b/IOPool/Input/src/RootFile.cc @@ -1450,8 +1450,9 @@ namespace edm { // We're not done ... so prepare the EventPrincipal eventTree_.insertEntryForIndex(principal.transitionIndex()); + auto history = processHistoryRegistry_->getMapped(eventAux().processHistoryID()); principal.fillEventPrincipal(eventAux(), - *processHistoryRegistry_, + history, std::move(eventSelectionIDs_), std::move(branchListIndexes_), *(makeProductProvenanceRetriever(principal.streamID().value())), @@ -1605,7 +1606,8 @@ namespace edm { lumiTree_.setEntryNumber(indexIntoFileIter_.entry()); // NOTE: we use 0 for the index since do not do delayed reads for LuminosityBlockPrincipals lumiTree_.insertEntryForIndex(0); - lumiPrincipal.fillLuminosityBlockPrincipal(*processHistoryRegistry_, lumiTree_.resetAndGetRootDelayedReader()); + auto history = processHistoryRegistry_->getMapped(lumiPrincipal.aux().processHistoryID()); + lumiPrincipal.fillLuminosityBlockPrincipal(history, lumiTree_.resetAndGetRootDelayedReader()); // Read in all the products now. lumiPrincipal.readAllFromSourceAndMergeImmediately(); ++indexIntoFileIter_; diff --git a/IOPool/Streamer/src/StreamerInputSource.cc b/IOPool/Streamer/src/StreamerInputSource.cc index 639d5bfa48fd8..645eb8d412b91 100644 --- a/IOPool/Streamer/src/StreamerInputSource.cc +++ b/IOPool/Streamer/src/StreamerInputSource.cc @@ -288,7 +288,8 @@ namespace edm { EventSelectionIDVector ids(sendEvent_->eventSelectionIDs()); BranchListIndexes indexes(sendEvent_->branchListIndexes()); branchIDListHelper()->fixBranchListIndexes(indexes); - eventPrincipal.fillEventPrincipal(sendEvent_->aux(), processHistoryRegistry(), std::move(ids), std::move(indexes)); + auto history = processHistoryRegistry().getMapped(sendEvent_->aux().processHistoryID()); + eventPrincipal.fillEventPrincipal(sendEvent_->aux(), history, std::move(ids), std::move(indexes)); //We now know which eventPrincipal to use and we can reuse the slot in // streamToEventPrincipalHolders to own the memory From 9976816a1b541b034a12166017b50dfd27e93488 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 27 Nov 2019 10:58:47 -0600 Subject: [PATCH 06/12] Set ProductProvenanceRetriever only once The ProductProvenanceRetriever is created in the EventPrincipal's constructor and never changes. Therefore it is possible to set the value in the ProductResolvers at construction time as well. --- DataFormats/Common/interface/ProductData.h | 7 ++- .../Framework/interface/ProductResolverBase.h | 12 ++++-- FWCore/Framework/src/EventPrincipal.cc | 9 +++- FWCore/Framework/src/ProductResolvers.cc | 43 +++++++++++++------ FWCore/Framework/src/ProductResolvers.h | 19 +++++--- 5 files changed, 61 insertions(+), 29 deletions(-) diff --git a/DataFormats/Common/interface/ProductData.h b/DataFormats/Common/interface/ProductData.h index 5a7eec30c750e..e14c4908c6b74 100644 --- a/DataFormats/Common/interface/ProductData.h +++ b/DataFormats/Common/interface/ProductData.h @@ -52,10 +52,9 @@ namespace edm { void unsafe_resetProductData() const { wrapper_.reset(); } - void setProvenance(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) { - prov_.setProductID(pid); - prov_.setStore(provRetriever); - } + void setProvenance(ProductProvenanceRetriever const* provRetriever) { prov_.setStore(provRetriever); } + + void setProductID(ProductID const& pid) { prov_.setProductID(pid); } void setMergeableRunProductMetadata(MergeableRunProductMetadataBase const* mrpm) { prov_.setMergeableRunProductMetadata(mrpm); diff --git a/FWCore/Framework/interface/ProductResolverBase.h b/FWCore/Framework/interface/ProductResolverBase.h index 94f042dedd413..dc1b5f486824d 100644 --- a/FWCore/Framework/interface/ProductResolverBase.h +++ b/FWCore/Framework/interface/ProductResolverBase.h @@ -135,11 +135,14 @@ namespace edm { // Retrieves pointer to a class containing the event independent provenance. StableProvenance const* stableProvenance() const { return &provenance()->stable(); } - // Initializes the event independent portion of the provenance, plus the process history ID, the product ID, and the provRetriever. - void setProvenance(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) { - setProvenance_(provRetriever, pid); + // Initialize the mechanism to retrieve per event provenance + void setProductProvenanceRetriever(ProductProvenanceRetriever const* provRetriever) { + setProductProvenanceRetriever_(provRetriever); } + // Initializes the ProductID + void setProductID(ProductID const& pid) { setProductID_(pid); } + // Initializes the portion of the provenance related to mergeable run products. void setMergeableRunProductMetadata(MergeableRunProductMetadata const* mrpm) { setMergeableRunProductMetadata_(mrpm); @@ -196,7 +199,8 @@ namespace edm { virtual void resetBranchDescription_(std::shared_ptr bd) = 0; virtual Provenance const* provenance_() const = 0; virtual std::string const& resolvedModuleLabel_() const = 0; - virtual void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) = 0; + virtual void setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) = 0; + virtual void setProductID_(ProductID const& pid) = 0; virtual void setMergeableRunProductMetadata_(MergeableRunProductMetadata const*); virtual ProductProvenance const* productProvenancePtr_() const = 0; virtual void resetProductData_(bool deleteEarly) = 0; diff --git a/FWCore/Framework/src/EventPrincipal.cc b/FWCore/Framework/src/EventPrincipal.cc index 47aea85c18852..87bf6316838b7 100644 --- a/FWCore/Framework/src/EventPrincipal.cc +++ b/FWCore/Framework/src/EventPrincipal.cc @@ -45,6 +45,12 @@ namespace edm { branchListIndexToProcessIndex_(), streamID_(streamIndex) { assert(thinnedAssociationsHelper_); + + for (auto& prod : *this) { + if (prod->singleProduct()) { + prod->setProductProvenanceRetriever(productProvenanceRetrieverPtr()); + } + } } void EventPrincipal::clearEventPrincipal() { @@ -129,8 +135,7 @@ namespace edm { // NOTE:productProvenanceRetrieverPtr() always returns the same pointer auto const& bd = prod->branchDescription(); - prod->setProvenance(productProvenanceRetrieverPtr(), - branchIDToProductID(bd.isAlias() ? bd.originalBranchID() : bd.branchID())); + prod->setProductID(branchIDToProductID(bd.isAlias() ? bd.originalBranchID() : bd.branchID())); } } } diff --git a/FWCore/Framework/src/ProductResolvers.cc b/FWCore/Framework/src/ProductResolvers.cc index 4f550cff50501..8649573cad0e6 100644 --- a/FWCore/Framework/src/ProductResolvers.cc +++ b/FWCore/Framework/src/ProductResolvers.cc @@ -538,11 +538,12 @@ namespace edm { return false; } - void DataManagingProductResolver::setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProductID const& pid) { - productData_.setProvenance(provRetriever, pid); + void DataManagingProductResolver::setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) { + productData_.setProvenance(provRetriever); } + void DataManagingProductResolver::setProductID_(ProductID const& pid) { productData_.setProductID(pid); } + void DataManagingProductResolver::setMergeableRunProductMetadataInProductData( MergeableRunProductMetadata const* mrpm) { productData_.setMergeableRunProductMetadata(mrpm); @@ -565,10 +566,12 @@ namespace edm { bool DataManagingProductResolver::singleProduct_() const { return true; } - void AliasProductResolver::setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) { - realProduct_.setProvenance(provRetriever, pid); + void AliasProductResolver::setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) { + realProduct_.setProductProvenanceRetriever(provRetriever); } + void AliasProductResolver::setProductID_(ProductID const& pid) { realProduct_.setProductID(pid); } + ProductProvenance const* AliasProductResolver::productProvenancePtr_() const { return provenance()->productProvenance(); } @@ -650,11 +653,13 @@ namespace edm { << "Contact a Framework developer\n"; } - void SwitchBaseProductResolver::setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProductID const& pid) { + void SwitchBaseProductResolver::setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) { + productData_.setProvenance(provRetriever); + } + + void SwitchBaseProductResolver::setProductID_(ProductID const& pid) { // insertIntoSet is const, so let's exploit that to fake the getting of the "input" product - provRetriever->insertIntoSet(ProductProvenance(branchDescription().branchID(), parentageID_)); - productData_.setProvenance(provRetriever, pid); + productData_.setProductID(pid); } void SwitchBaseProductResolver::resetProductData_(bool deleteEarly) { @@ -665,6 +670,11 @@ namespace edm { } } + void SwitchBaseProductResolver::updateProvenance() const { + return productData_.provenance().store()->insertIntoSet( + ProductProvenance(branchDescription().branchID(), parentageID_)); + } + ProductResolverBase::Resolution SwitchProducerProductResolver::resolveProduct_(Principal const& principal, bool skipCurrentProcess, SharedResourcesAcquirer* sra, @@ -697,6 +707,7 @@ namespace edm { // module has an exception while running auto waiting = make_waiting_task(tbb::task::allocate_root(), [this](std::exception_ptr const* iException) { if (nullptr != iException) { + updateProvenance(); waitingTasks().doneWaiting(*iException); } else { waitingTasks().doneWaiting(std::exception_ptr()); @@ -730,14 +741,16 @@ namespace edm { if (skipCurrentProcess) { return; } + updateProvenance(); realProduct().prefetchAsync(waitTask, principal, skipCurrentProcess, token, sra, mcc); } - void ParentProcessProductResolver::setProvenance_(ProductProvenanceRetriever const* provRetriever, - ProductID const& pid) { + void ParentProcessProductResolver::setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) { provRetriever_ = provRetriever; } + void ParentProcessProductResolver::setProductID_(ProductID const&) {} + ProductProvenance const* ParentProcessProductResolver::productProvenancePtr_() const { return provRetriever_ ? provRetriever_->branchIDToProvenance(bd_->originalBranchID()) : nullptr; } @@ -1002,7 +1015,9 @@ namespace edm { setCache(skipCurrentProcess, newCacheIndex, nullptr); } - void NoProcessProductResolver::setProvenance_(ProductProvenanceRetriever const*, ProductID const&) {} + void NoProcessProductResolver::setProductProvenanceRetriever_(ProductProvenanceRetriever const*) {} + + void NoProcessProductResolver::setProductID_(ProductID const&) {} ProductProvenance const* NoProcessProductResolver::productProvenancePtr_() const { return nullptr; } @@ -1110,7 +1125,9 @@ namespace edm { ->prefetchAsync(waitTask, principal, skipCurrentProcess, token, sra, mcc); } - void SingleChoiceNoProcessProductResolver::setProvenance_(ProductProvenanceRetriever const*, ProductID const&) {} + void SingleChoiceNoProcessProductResolver::setProductProvenanceRetriever_(ProductProvenanceRetriever const*) {} + + void SingleChoiceNoProcessProductResolver::setProductID_(ProductID const&) {} ProductProvenance const* SingleChoiceNoProcessProductResolver::productProvenancePtr_() const { return nullptr; } diff --git a/FWCore/Framework/src/ProductResolvers.h b/FWCore/Framework/src/ProductResolvers.h index 3bc329d01d578..7d53fa927bfd6 100644 --- a/FWCore/Framework/src/ProductResolvers.h +++ b/FWCore/Framework/src/ProductResolvers.h @@ -89,7 +89,8 @@ namespace edm { Provenance const* provenance_() const final { return &productData_.provenance(); } std::string const& resolvedModuleLabel_() const final { return moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) final; + void setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) final; + void setProductID_(ProductID const& pid) final; ProductProvenance const* productProvenancePtr_() const final; bool singleProduct_() const final; @@ -246,7 +247,8 @@ namespace edm { Provenance const* provenance_() const final { return realProduct_.provenance(); } std::string const& resolvedModuleLabel_() const override { return realProduct_.moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) override; + void setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) override; + void setProductID_(ProductID const& pid) override; ProductProvenance const* productProvenancePtr_() const override; void resetProductData_(bool deleteEarly) override; bool singleProduct_() const override; @@ -272,6 +274,7 @@ namespace edm { ProductStatus status() const { return status_; } DataManagingOrAliasProductResolver const& realProduct() const { return realProduct_; } std::atomic& prefetchRequested() const { return prefetchRequested_; } + void updateProvenance() const; private: bool productResolved_() const final; @@ -291,7 +294,8 @@ namespace edm { } Provenance const* provenance_() const final { return &productData_.provenance(); } std::string const& resolvedModuleLabel_() const final { return moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) final; + void setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) final; + void setProductID_(ProductID const& pid) final; ProductProvenance const* productProvenancePtr_() const final { return provenance()->productProvenance(); } void resetProductData_(bool deleteEarly) final; bool singleProduct_() const final { return true; } @@ -404,7 +408,8 @@ namespace edm { void resetBranchDescription_(std::shared_ptr bd) override { bd_ = bd; } Provenance const* provenance_() const final { return realProduct_->provenance(); } std::string const& resolvedModuleLabel_() const override { return realProduct_->moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) override; + void setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) override; + void setProductID_(ProductID const& pid) override; ProductProvenance const* productProvenancePtr_() const override; void resetProductData_(bool deleteEarly) override; bool singleProduct_() const override; @@ -467,7 +472,8 @@ namespace edm { Provenance const* provenance_() const override; std::string const& resolvedModuleLabel_() const override { return moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) override; + void setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) override; + void setProductID_(ProductID const& pid) override; ProductProvenance const* productProvenancePtr_() const override; void resetProductData_(bool deleteEarly) override; bool singleProduct_() const override; @@ -524,7 +530,8 @@ namespace edm { Provenance const* provenance_() const override; std::string const& resolvedModuleLabel_() const override { return moduleLabel(); } - void setProvenance_(ProductProvenanceRetriever const* provRetriever, ProductID const& pid) override; + void setProductProvenanceRetriever_(ProductProvenanceRetriever const* provRetriever) override; + void setProductID_(ProductID const& pid) override; ProductProvenance const* productProvenancePtr_() const override; void resetProductData_(bool deleteEarly) override; bool singleProduct_() const override; From 76e40968097529ac69a166a00eadaf1d51678853 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 28 Nov 2019 10:39:28 -0600 Subject: [PATCH 07/12] Optimize filling of EventPrincipal If BranchListIndex does not change we do not update structures. --- FWCore/Framework/interface/EventPrincipal.h | 14 +++-- FWCore/Framework/src/EventPrincipal.cc | 64 ++++++++++++++------- 2 files changed, 54 insertions(+), 24 deletions(-) diff --git a/FWCore/Framework/interface/EventPrincipal.h b/FWCore/Framework/interface/EventPrincipal.h index 7a84b50d759cb..38ac0f5995bcf 100644 --- a/FWCore/Framework/interface/EventPrincipal.h +++ b/FWCore/Framework/interface/EventPrincipal.h @@ -64,13 +64,13 @@ namespace edm { DelayedReader* reader = nullptr); void fillEventPrincipal(EventAuxiliary const& aux, ProcessHistory const* processHistory, - EventSelectionIDVector&& eventSelectionIDs, - BranchListIndexes&& branchListIndexes); + EventSelectionIDVector eventSelectionIDs, + BranchListIndexes branchListIndexes); //provRetriever is changed via a call to ProductProvenanceRetriever::deepSwap void fillEventPrincipal(EventAuxiliary const& aux, ProcessHistory const* processHistory, - EventSelectionIDVector&& eventSelectionIDs, - BranchListIndexes&& branchListIndexes, + EventSelectionIDVector eventSelectionIDs, + BranchListIndexes branchListIndexes, ProductProvenanceRetriever const& provRetriever, DelayedReader* reader = nullptr, bool deepCopyRetriever = true); @@ -156,6 +156,12 @@ namespace edm { } std::shared_ptr& provRetrieverPtr() { return get_underlying_safe(provRetrieverPtr_); } + bool wasBranchListIndexesChangedFromInput(BranchListIndexes const&) const; + void updateBranchListIndexes(BranchListIndexes&&); + void commonFillEventPrincipal(EventAuxiliary const& aux, + ProcessHistory const* processHistory, + DelayedReader* reader); + private: EventAuxiliary aux_; diff --git a/FWCore/Framework/src/EventPrincipal.cc b/FWCore/Framework/src/EventPrincipal.cc index 87bf6316838b7..14a8f119b676d 100644 --- a/FWCore/Framework/src/EventPrincipal.cc +++ b/FWCore/Framework/src/EventPrincipal.cc @@ -59,13 +59,12 @@ namespace edm { //do not clear luminosityBlockPrincipal_ since // it is only connected at beginLumi transition provRetrieverPtr_->reset(); - branchListIndexToProcessIndex_.clear(); } void EventPrincipal::fillEventPrincipal(EventAuxiliary const& aux, ProcessHistory const* processHistory, - EventSelectionIDVector&& eventSelectionIDs, - BranchListIndexes&& branchListIndexes, + EventSelectionIDVector eventSelectionIDs, + BranchListIndexes branchListIndexes, ProductProvenanceRetriever const& provRetriever, DelayedReader* reader, bool deepCopyRetriever) { @@ -75,30 +74,48 @@ namespace edm { } else { provRetrieverPtr_->mergeParentProcessRetriever(provRetriever); } - branchListIndexes_ = std::move(branchListIndexes); - if (branchIDListHelper_->hasProducedProducts()) { - // Add index into BranchIDListRegistry for products produced this process - branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex()); + if (wasBranchListIndexesChangedFromInput(branchListIndexes)) { + if (branchIDListHelper_->hasProducedProducts()) { + // Add index into BranchIDListRegistry for products produced this process + branchListIndexes.push_back(branchIDListHelper_->producedBranchListIndex()); + } + updateBranchListIndexes(std::move(branchListIndexes)); } - fillEventPrincipal(aux, processHistory, reader); + commonFillEventPrincipal(aux, processHistory, reader); } void EventPrincipal::fillEventPrincipal(EventAuxiliary const& aux, ProcessHistory const* processHistory, - EventSelectionIDVector&& eventSelectionIDs, - BranchListIndexes&& branchListIndexes) { + EventSelectionIDVector eventSelectionIDs, + BranchListIndexes branchListIndexes) { eventSelectionIDs_ = std::move(eventSelectionIDs); - branchListIndexes_ = std::move(branchListIndexes); - if (branchIDListHelper_->hasProducedProducts()) { - // Add index into BranchIDListRegistry for products produced this process - branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex()); + + if (wasBranchListIndexesChangedFromInput(branchListIndexes)) { + if (branchIDListHelper_->hasProducedProducts()) { + // Add index into BranchIDListRegistry for products produced this process + branchListIndexes.push_back(branchIDListHelper_->producedBranchListIndex()); + } + updateBranchListIndexes(std::move(branchListIndexes)); } - fillEventPrincipal(aux, processHistory, nullptr); + commonFillEventPrincipal(aux, processHistory, nullptr); } void EventPrincipal::fillEventPrincipal(EventAuxiliary const& aux, ProcessHistory const* processHistory, DelayedReader* reader) { + if (branchListIndexes_.empty() and branchIDListHelper_->hasProducedProducts()) { + // Add index into BranchIDListRegistry for products produced this process + // if it hasn't already been filled in by the other fillEventPrincipal or by an earlier call to this function + BranchListIndexes indexes; + indexes.push_back(branchIDListHelper_->producedBranchListIndex()); + updateBranchListIndexes(std::move(indexes)); + } + commonFillEventPrincipal(aux, processHistory, reader); + } + + void EventPrincipal::commonFillEventPrincipal(EventAuxiliary const& aux, + ProcessHistory const* processHistory, + DelayedReader* reader) { if (aux.event() == invalidEventNumber) { throw Exception(errors::LogicError) << "EventPrincipal::fillEventPrincipal, Invalid event number provided in " "EventAuxiliary, It is illegal for the event number to be 0\n"; @@ -107,13 +124,21 @@ namespace edm { fillPrincipal(aux.processHistoryID(), processHistory, reader); aux_ = aux; aux_.setProcessHistoryID(processHistoryID()); + } - if (branchListIndexes_.empty() and branchIDListHelper_->hasProducedProducts()) { - // Add index into BranchIDListRegistry for products produced this process - // if it hasn't already been filled in by the other fillEventPrincipal or by an earlier call to this function - branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex()); + bool EventPrincipal::wasBranchListIndexesChangedFromInput(BranchListIndexes const& fromInput) const { + //fromInput does not contain entries for what is being produced in this job. + auto end = branchListIndexes_.end(); + if (end != branchListIndexes_.begin() and branchIDListHelper_->hasProducedProducts()) { + --end; } + return not std::equal(fromInput.begin(), fromInput.end(), branchListIndexes_.begin(), end); + } + + void EventPrincipal::updateBranchListIndexes(BranchListIndexes&& branchListIndexes) { + branchListIndexes_ = std::move(branchListIndexes); + branchListIndexToProcessIndex_.clear(); // Fill in helper map for Branch to ProductID mapping if (not branchListIndexes_.empty()) { ProcessIndex pix = 0; @@ -133,7 +158,6 @@ namespace edm { // If not, then we've internally changed the original BranchID to the alias BranchID // in the ProductID lookup so we need the alias BranchID. - // NOTE:productProvenanceRetrieverPtr() always returns the same pointer auto const& bd = prod->branchDescription(); prod->setProductID(branchIDToProductID(bd.isAlias() ? bd.originalBranchID() : bd.branchID())); } From c1b42b3562414faecd8a623e6e46ff8d14445aeb Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 29 Nov 2019 17:18:10 +0100 Subject: [PATCH 08/12] Have DQMRootSource use new API Call new LuminosityBlockPrincipal::fillLuminosityBlock interface. --- DQMServices/FwkIO/plugins/DQMRootSource.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQMServices/FwkIO/plugins/DQMRootSource.cc b/DQMServices/FwkIO/plugins/DQMRootSource.cc index 47a0a6f265f06..9070348b56e41 100644 --- a/DQMServices/FwkIO/plugins/DQMRootSource.cc +++ b/DQMServices/FwkIO/plugins/DQMRootSource.cc @@ -612,7 +612,7 @@ void DQMRootSource::readLuminosityBlock_(edm::LuminosityBlockPrincipal& lbCache) edm::Service jr; jr->reportInputLumiSection(lbCache.id().run(), lbCache.id().luminosityBlock()); - lbCache.fillLuminosityBlockPrincipal(processHistoryRegistryForUpdate()); + lbCache.fillLuminosityBlockPrincipal(processHistoryRegistry().getMapped(lbCache.aux().processHistoryID())); } std::unique_ptr DQMRootSource::readFile_() { From a6a316d6258242a936ecf23c712b03cf85f71234 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Sun, 1 Dec 2019 19:50:16 +0100 Subject: [PATCH 09/12] Have LHESource use new API Call new LuminosityBlockPrincipal::fillLuminosityBlock interface --- GeneratorInterface/LHEInterface/plugins/LHESource.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GeneratorInterface/LHEInterface/plugins/LHESource.cc b/GeneratorInterface/LHEInterface/plugins/LHESource.cc index bc8f77ce549ea..18aeac48339f9 100644 --- a/GeneratorInterface/LHEInterface/plugins/LHESource.cc +++ b/GeneratorInterface/LHEInterface/plugins/LHESource.cc @@ -109,7 +109,8 @@ void LHESource::readRun_(edm::RunPrincipal& runPrincipal) { void LHESource::readLuminosityBlock_(edm::LuminosityBlockPrincipal& lumiPrincipal) { luminosityBlockAuxiliary()->setProcessHistoryID(phid_); - lumiPrincipal.fillLuminosityBlockPrincipal(processHistoryRegistryForUpdate()); + lumiPrincipal.fillLuminosityBlockPrincipal( + processHistoryRegistry().getMapped(lumiPrincipal.aux().processHistoryID())); } void LHESource::putRunInfoProduct(edm::RunPrincipal& iRunPrincipal) { @@ -137,7 +138,7 @@ void LHESource::readEvent_(edm::EventPrincipal& eventPrincipal) { assert(eventCached() || processingMode() != RunsLumisAndEvents); edm::EventAuxiliary aux(eventID(), processGUID(), edm::Timestamp(presentTime()), false); aux.setProcessHistoryID(phid_); - eventPrincipal.fillEventPrincipal(aux, processHistoryRegistryForUpdate()); + eventPrincipal.fillEventPrincipal(aux, processHistoryRegistry().getMapped(aux.processHistoryID())); std::unique_ptr product( new LHEEventProduct(*partonLevel_->getHEPEUP(), partonLevel_->originalXWGTUP())); From 107e3b2bbc399450cc969df628c473f4f514c4cd Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 2 Dec 2019 02:40:30 +0100 Subject: [PATCH 10/12] Use new parameterSet function API --- .../src/EcalSelectiveReadoutProducer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimCalorimetry/EcalSelectiveReadoutProducers/src/EcalSelectiveReadoutProducer.cc b/SimCalorimetry/EcalSelectiveReadoutProducers/src/EcalSelectiveReadoutProducer.cc index 97c5571bd27df..5c51ba66705bf 100644 --- a/SimCalorimetry/EcalSelectiveReadoutProducers/src/EcalSelectiveReadoutProducer.cc +++ b/SimCalorimetry/EcalSelectiveReadoutProducers/src/EcalSelectiveReadoutProducer.cc @@ -341,7 +341,7 @@ bool EcalSelectiveReadoutProducer::getBinOfMax(const edm::Event& evt, int& binOfMax) const { bool rc; const edm::Provenance p = evt.getProvenance(noZsDigiId); - const edm::ParameterSet& result = parameterSet(p); + const edm::ParameterSet& result = parameterSet(p, evt.processHistory()); vector ebDigiParamList = result.getParameterNames(); string bofm("binOfMaximum"); if (find(ebDigiParamList.begin(), ebDigiParamList.end(), bofm) != ebDigiParamList.end()) { //bofm found From 50805fe855db098973002d84baa2a820f7de33e0 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 2 Dec 2019 20:22:14 +0100 Subject: [PATCH 11/12] Have DQMProtobufReader use new API Call new LuminosityBlockPrincipal::fillLuminosityBlock interface --- DQMServices/StreamerIO/plugins/DQMProtobufReader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQMServices/StreamerIO/plugins/DQMProtobufReader.cc b/DQMServices/StreamerIO/plugins/DQMProtobufReader.cc index d2c0bd71278d4..41992044c4d8e 100644 --- a/DQMServices/StreamerIO/plugins/DQMProtobufReader.cc +++ b/DQMServices/StreamerIO/plugins/DQMProtobufReader.cc @@ -95,7 +95,7 @@ void DQMProtobufReader::readLuminosityBlock_(edm::LuminosityBlockPrincipal& lbCa edm::Service jr; jr->reportInputLumiSection(lbCache.id().run(), lbCache.id().luminosityBlock()); - lbCache.fillLuminosityBlockPrincipal(processHistoryRegistryForUpdate()); + lbCache.fillLuminosityBlockPrincipal(processHistoryRegistry().getMapped(lbCache.aux().processHistoryID())); } void DQMProtobufReader::beginLuminosityBlock(edm::LuminosityBlock& lb) { From cb2084ed7d0e79f1baafae5c1bb4452c78bb6e4d Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 2 Dec 2019 23:38:49 +0100 Subject: [PATCH 12/12] Adjust to new function APIs moduleName and parameterSet now require a edm::ProcessHistory. --- HeavyFlavorAnalysis/Onia2MuMu/src/OniaVtxReProducer.cc | 6 +++--- PhysicsTools/JetMCAlgos/plugins/HadronAndPartonSelector.cc | 2 +- RecoBTag/FeatureTools/plugins/DeepFlavourTagInfoProducer.cc | 2 +- .../plugins/GsfElectronBaseProducer.cc | 2 +- .../EgammaElectronProducers/plugins/GsfElectronProducer.cc | 2 +- TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/HeavyFlavorAnalysis/Onia2MuMu/src/OniaVtxReProducer.cc b/HeavyFlavorAnalysis/Onia2MuMu/src/OniaVtxReProducer.cc index 58ec7cf70605c..1358b09cf935c 100644 --- a/HeavyFlavorAnalysis/Onia2MuMu/src/OniaVtxReProducer.cc +++ b/HeavyFlavorAnalysis/Onia2MuMu/src/OniaVtxReProducer.cc @@ -12,17 +12,17 @@ OniaVtxReProducer::OniaVtxReProducer(const edm::Handle & const edm::Provenance *prov = handle.provenance(); if (prov == nullptr) throw cms::Exception("CorruptData") << "Vertex handle doesn't have provenance."; - edm::ParameterSet psetFromProvenance = edm::parameterSet(*prov); + edm::ParameterSet psetFromProvenance = edm::parameterSet(*prov, iEvent.processHistory()); bool is_primary_available = false; const edm::Provenance *parent_prov = prov; - if (edm::moduleName(*prov) != "PrimaryVertexProducer") { + if (edm::moduleName(*prov, iEvent.processHistory()) != "PrimaryVertexProducer") { std::vector parents = prov->productProvenance()->parentage().parents(); for (std::vector::const_iterator it = parents.begin(), ed = parents.end(); it != ed; ++it) { edm::Provenance parprov = iEvent.getProvenance(*it); if (parprov.friendlyClassName() == "recoVertexs") { // for AOD actually this the parent we should look for parent_prov = &parprov; - psetFromProvenance = edm::parameterSet(parprov); + psetFromProvenance = edm::parameterSet(parprov, iEvent.processHistory()); is_primary_available = true; break; } diff --git a/PhysicsTools/JetMCAlgos/plugins/HadronAndPartonSelector.cc b/PhysicsTools/JetMCAlgos/plugins/HadronAndPartonSelector.cc index 63a01feb4ea9b..1e1a01abb2b0c 100644 --- a/PhysicsTools/JetMCAlgos/plugins/HadronAndPartonSelector.cc +++ b/PhysicsTools/JetMCAlgos/plugins/HadronAndPartonSelector.cc @@ -141,7 +141,7 @@ void HadronAndPartonSelector::produce(edm::Event& iEvent, const edm::EventSetup& std::string moduleName = ""; if (genEvtInfoProduct.isValid()) { const edm::Provenance& prov = iEvent.getProvenance(genEvtInfoProduct.id()); - moduleName = edm::moduleName(prov); + moduleName = edm::moduleName(prov, iEvent.processHistory()); } if (moduleName.find("Pythia6") != std::string::npos) diff --git a/RecoBTag/FeatureTools/plugins/DeepFlavourTagInfoProducer.cc b/RecoBTag/FeatureTools/plugins/DeepFlavourTagInfoProducer.cc index 0c46347eb9fd3..9a1fa4ec530b9 100644 --- a/RecoBTag/FeatureTools/plugins/DeepFlavourTagInfoProducer.cc +++ b/RecoBTag/FeatureTools/plugins/DeepFlavourTagInfoProducer.cc @@ -191,7 +191,7 @@ void DeepFlavourTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSet double negative_cut = 0; //used only with flip_ if (flip_) { //FIXME: Check if can do even less often than once per event const edm::Provenance* prov = shallow_tag_infos.provenance(); - const edm::ParameterSet& psetFromProvenance = edm::parameterSet(*prov); + const edm::ParameterSet& psetFromProvenance = edm::parameterSet(*prov, iEvent.processHistory()); negative_cut = ((psetFromProvenance.getParameter("computer")) .getParameter("trackSelection")) .getParameter("sip3dSigMax"); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.cc index c939b6883709b..61a2f0a80c44b 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.cc @@ -383,7 +383,7 @@ void GsfElectronBaseProducer::beginEvent(edm::Event& event, const edm::EventSetu << "Cannot check consistency of parameters with ecal seeding ones," << " because the original collection of seeds is not any more available."; } else { - checkEcalSeedingParameters(edm::parameterSet(*seeds.provenance())); + checkEcalSeedingParameters(edm::parameterSet(*seeds.provenance(), event.processHistory())); } } } diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronProducer.cc index d5471801907a3..e46405825c3db 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronProducer.cc @@ -62,7 +62,7 @@ void GsfElectronProducer::beginEvent(edm::Event& event, const edm::EventSetup& s pfTranslatorParametersChecked_ = true; edm::Handle > pfMva; event.getByToken(pfMVA_, pfMva); - checkPfTranslatorParameters(edm::parameterSet(*pfMva.provenance())); + checkPfTranslatorParameters(edm::parameterSet(*pfMva.provenance(), event.processHistory())); } // call to base class diff --git a/TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc b/TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc index 23a382e3cdef5..65670179ea083 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc @@ -246,7 +246,7 @@ TopDecaySubset::ShowerModel TopDecaySubset::checkShowerModel(edm::Event& event) std::string moduleName = ""; if (genEvtInfoProduct.isValid()) { const edm::Provenance& prov = event.getProvenance(genEvtInfoProduct.id()); - moduleName = edm::moduleName(prov); + moduleName = edm::moduleName(prov, event.processHistory()); } ShowerModel shower(kStart);