From 41f08d08e9c31843f2d94278cfbb85468469612b Mon Sep 17 00:00:00 2001 From: Andre Govinda Stahl Leiton Date: Thu, 13 Jun 2024 08:48:44 +0200 Subject: [PATCH 1/7] Add fillDescription to RecoParticleFlow producers --- .../Configuration/plugins/HepMCCopy.cc | 18 +- .../Configuration/python/HepMCCopy_cfi.py | 3 +- .../plugins/PFClusterCollectionMerger.cc | 10 +- .../plugins/PFClusterProducer.cc | 32 +- .../plugins/PFClusterTimeSelector.cc | 119 +++++++ .../plugins/PFMultiDepthClusterProducer.cc | 33 ++ .../plugins/PFRecHitProducer.cc | 9 +- ...particleFlowClusterECALTimeSelected_cfi.py | 90 ----- .../test/PFClusterAnalyzer.cc | 14 +- .../test/PFClusterAnalyzer.h | 4 +- .../test/PFClusterComparator.cc | 19 +- .../test/PFClusterComparator.h | 6 +- .../PFProducer/plugins/PFBlockProducer.cc | 313 ++++++++++++++++++ .../PFProducer/plugins/PFCandidateChecker.cc | 37 +-- .../plugins/PFConcretePFCandidateProducer.cc | 18 +- .../plugins/PFElectronTranslator.cc | 89 +++-- .../PFProducer/plugins/PFLinker.cc | 17 + .../python/particleFlowBlock_cfi.py | 152 +-------- .../pfConcretePFCandidateProducer_cfi.py | 5 - .../python/pfElectronTranslator_cfi.py | 24 +- .../PFProducer/python/pfLinker_cfi.py | 15 - .../PFProducer/test/EgGEDPhotonAnalyzer.cc | 50 ++- .../PFProducer/test/GsfGEDElectronAnalyzer.cc | 196 +++++------ .../plugins/ConvBremSeedProducer.cc | 34 +- .../PFTracking/plugins/ElectronSeedMerger.cc | 8 + .../PFTracking/plugins/GoodSeedProducer.cc | 52 +++ .../plugins/HGCalTrackCollectionProducer.cc | 26 +- .../plugins/LightPFTrackProducer.cc | 15 +- .../plugins/PFConversionProducer.cc | 9 + .../PFDisplacedTrackerVertexProducer.cc | 9 + .../PFDisplacedVertexCandidateProducer.cc | 38 +++ .../plugins/PFDisplacedVertexProducer.cc | 87 +++++ .../PFTracking/plugins/PFElecTkProducer.cc | 56 ++++ .../PFTracking/plugins/PFNuclearProducer.cc | 14 +- .../PFTracking/plugins/PFTrackProducer.cc | 15 + .../PFTracking/plugins/PFV0Producer.cc | 13 +- .../python/hgcalTrackCollection_cfi.py | 16 - .../PFTracking/python/lightpftrack_cfi.py | 9 - .../python/mergedElectronSeeds_cfi.py | 7 +- ...articleFlowDisplacedVertexCandidate_cfi.py | 47 --- .../python/particleFlowDisplacedVertex_cfi.py | 99 ------ .../PFTracking/python/pfConversions_cfi.py | 11 - .../python/pfDisplacedTrackerVertex_cfi.py | 10 - .../PFTracking/python/pfNuclear_cfi.py | 9 - .../PFTracking/python/pfTrackElec_cfi.py | 42 +-- .../PFTracking/python/pfTrack_cfi.py | 14 - .../PFTracking/python/pfV0_cfi.py | 11 - .../python/trackerDrivenElectronSeeds_cfi.py | 50 +-- 48 files changed, 1121 insertions(+), 853 deletions(-) delete mode 100644 RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALTimeSelected_cfi.py delete mode 100644 RecoParticleFlow/PFProducer/python/pfConcretePFCandidateProducer_cfi.py delete mode 100644 RecoParticleFlow/PFProducer/python/pfLinker_cfi.py delete mode 100644 RecoParticleFlow/PFTracking/python/hgcalTrackCollection_cfi.py delete mode 100644 RecoParticleFlow/PFTracking/python/lightpftrack_cfi.py delete mode 100644 RecoParticleFlow/PFTracking/python/particleFlowDisplacedVertexCandidate_cfi.py delete mode 100644 RecoParticleFlow/PFTracking/python/particleFlowDisplacedVertex_cfi.py delete mode 100644 RecoParticleFlow/PFTracking/python/pfConversions_cfi.py delete mode 100644 RecoParticleFlow/PFTracking/python/pfDisplacedTrackerVertex_cfi.py delete mode 100644 RecoParticleFlow/PFTracking/python/pfNuclear_cfi.py delete mode 100644 RecoParticleFlow/PFTracking/python/pfTrack_cfi.py delete mode 100644 RecoParticleFlow/PFTracking/python/pfV0_cfi.py diff --git a/RecoParticleFlow/Configuration/plugins/HepMCCopy.cc b/RecoParticleFlow/Configuration/plugins/HepMCCopy.cc index 64f4ad679dea6..091b7f5cddff1 100644 --- a/RecoParticleFlow/Configuration/plugins/HepMCCopy.cc +++ b/RecoParticleFlow/Configuration/plugins/HepMCCopy.cc @@ -1,4 +1,6 @@ #include "FWCore/Framework/interface/one/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" @@ -10,19 +12,27 @@ class HepMCCopy : public edm::one::EDProducer<> { explicit HepMCCopy(edm::ParameterSet const& p); ~HepMCCopy() override = default; void produce(edm::Event& e, const edm::EventSetup& c) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: + const edm::EDGetTokenT hepMCToken_; }; -HepMCCopy::HepMCCopy(edm::ParameterSet const& p) { +void HepMCCopy::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("src", {"generatorSmeared"}); + descriptions.addWithDefaultLabel(desc); +} + +HepMCCopy::HepMCCopy(edm::ParameterSet const& p) + : hepMCToken_(consumes(p.getParameter("src"))) { // This producer produces a HepMCProduct, a copy of the original one produces(); } void HepMCCopy::produce(edm::Event& iEvent, const edm::EventSetup& es) { - edm::Handle theHepMCProduct; - bool source = iEvent.getByLabel("generatorSmeared", theHepMCProduct); - if (!source) { + const auto& theHepMCProduct = iEvent.getHandle(hepMCToken_); + if (theHepMCProduct.isValid()) { auto pu_product = std::make_unique(); iEvent.put(std::move(pu_product)); } else { diff --git a/RecoParticleFlow/Configuration/python/HepMCCopy_cfi.py b/RecoParticleFlow/Configuration/python/HepMCCopy_cfi.py index 9e9e20b195d18..8fecb461b2a5e 100644 --- a/RecoParticleFlow/Configuration/python/HepMCCopy_cfi.py +++ b/RecoParticleFlow/Configuration/python/HepMCCopy_cfi.py @@ -1,3 +1,4 @@ import FWCore.ParameterSet.Config as cms -generator = cms.EDProducer("HepMCCopy") +from RecoParticleFlow.Configuration.HepMCCopy import HepMCCopy +generator = HepMCCopy() diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterCollectionMerger.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterCollectionMerger.cc index 367e18d6358f7..a524a41d66c8d 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterCollectionMerger.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterCollectionMerger.cc @@ -16,13 +16,19 @@ class PFClusterCollectionMerger : public edm::global::EDProducer<> { public: PFClusterCollectionMerger(const edm::ParameterSet& conf) { - const std::vector& inputs = conf.getParameter >("inputs"); + const std::vector& inputs = conf.getParameter>("inputs"); for (const auto& input : inputs) { _inputs.push_back(consumes(input)); } produces(); } + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add>("inputs", {}); + descriptions.addWithDefaultLabel(desc); + } + void produce(edm::StreamID, edm::Event& e, const edm::EventSetup& es) const override { auto output = std::make_unique(); for (const auto& input : _inputs) { @@ -34,7 +40,7 @@ class PFClusterCollectionMerger : public edm::global::EDProducer<> { } private: - std::vector > _inputs; + std::vector> _inputs; }; DEFINE_FWK_MODULE(PFClusterCollectionMerger); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc index fffd17515e2e9..c4e367c57d2e5 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc @@ -22,6 +22,7 @@ class PFClusterProducer : public edm::stream::EDProducer<> { void beginRun(const edm::Run&, const edm::EventSetup&) override; void produce(edm::Event&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: // inputs @@ -33,8 +34,8 @@ class PFClusterProducer : public edm::stream::EDProducer<> { // options const bool _prodInitClusters; // the actual algorithm - std::vector > _cleaners; - std::vector > _seedcleaners; + std::vector> _cleaners; + std::vector> _seedcleaners; std::unique_ptr _seedFinder; std::unique_ptr _initialClustering; std::unique_ptr _pfClusterBuilder; @@ -45,6 +46,33 @@ class PFClusterProducer : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(PFClusterProducer); +void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("recHitsSource", {}); + desc.add("usePFThresholdsFromDB", false); + edm::ParameterSetDescription psd; + psd.setUnknown(); + desc.addVPSet("recHitCleaners", psd, {}); + { + edm::ParameterSetDescription psd1; + psd1.add>("RecHitFlagsToBeExcluded", {}); + psd1.add("algoName"); + desc.addVPSet("seedCleaners", psd1, {}); + } + { + edm::ParameterSetDescription pset; + pset.add("algoName"); + pset.add("nNeighbours", 0); + pset.addVPSet("thresholdsByDetector", psd, {}); + desc.add("seedFinder", pset); + } + desc.add("initialClusteringStep", psd); + desc.add("pfClusterBuilder", psd); + desc.add("positionReCalc", psd); + desc.add("energyCorrector", psd); + descriptions.addWithDefaultLabel(desc); +} + #ifdef PFLOW_DEBUG #define LOGVERB(x) edm::LogVerbatim(x) #define LOGWARN(x) edm::LogWarning(x) diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterTimeSelector.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterTimeSelector.cc index ea39264862700..5161db390c874 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterTimeSelector.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterTimeSelector.cc @@ -20,6 +20,7 @@ class PFClusterTimeSelector : public edm::stream::EDProducer<> { void beginRun(const edm::Run& run, const edm::EventSetup& es) override; void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); protected: struct CutInfo { @@ -39,6 +40,124 @@ class PFClusterTimeSelector : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(PFClusterTimeSelector); +void PFClusterTimeSelector::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("src", {"particleFlowClusterECALWithTimeUncorrected"}); + { + std::vector vpset; + vpset.reserve(10); + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 0.0); + pset.addParameter("maxEnergy", 1.0); + pset.addParameter("endcap", false); + pset.addParameter("minTime", -12.); + pset.addParameter("maxTime", 12.); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 0.0); + pset.addParameter("maxEnergy", 1.0); + pset.addParameter("endcap", true); + pset.addParameter("minTime", -31.5); + pset.addParameter("maxTime", 31.5); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 1.0); + pset.addParameter("maxEnergy", 2.0); + pset.addParameter("endcap", false); + pset.addParameter("minTime", -6.); + pset.addParameter("maxTime", 6.); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 1.0); + pset.addParameter("maxEnergy", 2.0); + pset.addParameter("endcap", true); + pset.addParameter("minTime", -20.5); + pset.addParameter("maxTime", 20.5); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 2.0); + pset.addParameter("maxEnergy", 5.0); + pset.addParameter("endcap", false); + pset.addParameter("minTime", -4.); + pset.addParameter("maxTime", 4.); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 2.0); + pset.addParameter("maxEnergy", 5.0); + pset.addParameter("endcap", true); + pset.addParameter("minTime", -12.); + pset.addParameter("maxTime", 12.); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 5.0); + pset.addParameter("maxEnergy", 20.0); + pset.addParameter("endcap", false); + pset.addParameter("minTime", -4.); + pset.addParameter("maxTime", 4.); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 5.0); + pset.addParameter("maxEnergy", 20.0); + pset.addParameter("endcap", true); + pset.addParameter("minTime", -5.); + pset.addParameter("maxTime", 5.); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 20.0); + pset.addParameter("maxEnergy", 1e24); + pset.addParameter("endcap", false); + pset.addParameter("minTime", -4.); + pset.addParameter("maxTime", 4.); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("depth", 1.0); + pset.addParameter("minEnergy", 20.0); + pset.addParameter("maxEnergy", 1e24); + pset.addParameter("endcap", true); + pset.addParameter("minTime", -5.); + pset.addParameter("maxTime", 5.); + vpset.emplace_back(pset); + } + edm::ParameterSetDescription psd; + psd.add("depth", 1.0); + psd.add("minEnergy", 0.0); + psd.add("maxEnergy", 1e24); + psd.add("endcap", false); + psd.add("minTime", -50.); + psd.add("maxTime", 50.); + desc.addVPSet("cuts", psd, vpset); + } + descriptions.add("particleFlowClusterECALTimeSelected", desc); +} + using namespace std; using namespace edm; diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc index 0a8ee49166a5d..f0421f24eba5a 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc @@ -25,6 +25,7 @@ class PFMultiDepthClusterProducer : public edm::stream::EDProducer<> { void beginRun(const edm::Run&, const edm::EventSetup&) override; void produce(edm::Event&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: // inputs @@ -40,6 +41,38 @@ class PFMultiDepthClusterProducer : public edm::stream::EDProducer<> { DEFINE_FWK_MODULE(PFMultiDepthClusterProducer); +void PFMultiDepthClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("clustersSource", {}); + desc.add("energyCorrector", {}); + { + edm::ParameterSetDescription pset0; + pset0.add("algoName", "PFMultiDepthClusterizer"); + { + edm::ParameterSetDescription pset1; + pset1.add("algoName", "Basic2DGenericPFlowPositionCalc"); + { + edm::ParameterSetDescription psd; + psd.add>("depths", {}); + psd.add("detector"); + psd.add>("logWeightDenominator", {}); + pset1.addVPSet("logWeightDenominatorByDetector", psd, {}); + } + pset1.add("minAllowedNormalization", 1e-09); + pset1.add("minFractionInCalc", 1e-09); + pset1.add("posCalcNCrystals", -1); + pset0.add("allCellsPositionCalc", pset1); + } + pset0.add("minFractionToKeep", 1e-07); + pset0.add("nSigmaEta", 2.0); + pset0.add("nSigmaPhi", 2.0); + desc.add("pfClusterBuilder", pset0); + } + desc.add("positionReCalc", {}); + desc.add("usePFThresholdsFromDB", false); + descriptions.addWithDefaultLabel(desc); +} + #ifdef PFLOW_DEBUG #define LOGVERB(x) edm::LogVerbatim(x) #define LOGWARN(x) edm::LogWarning(x) diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc index 0fa102bd5c5e0..5f8079449c560 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc @@ -100,9 +100,10 @@ void PFRecHitProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup } void PFRecHitProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - //The following says we do not know what parameters are allowed so do no validation - // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; - desc.setUnknown(); - descriptions.addDefault(desc); + edm::ParameterSetDescription psd; + psd.setUnknown(); + desc.add("navigator", psd); + desc.addVPSet("producers", psd, {}); + descriptions.addWithDefaultLabel(desc); } diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALTimeSelected_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALTimeSelected_cfi.py deleted file mode 100644 index 4969c8a94134c..0000000000000 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALTimeSelected_cfi.py +++ /dev/null @@ -1,90 +0,0 @@ -import FWCore.ParameterSet.Config as cms -particleFlowClusterECALTimeSelected = cms.EDProducer( - "PFClusterTimeSelector", - src = cms.InputTag('particleFlowClusterECALWithTimeUncorrected'), - - cuts = cms.VPSet( - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(0.0), - maxEnergy = cms.double(1.0), - endcap = cms.bool(False), - minTime = cms.double(-12.), - maxTime = cms.double(12.) - ), - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(0.0), - maxEnergy = cms.double(1.0), - endcap = cms.bool(True), - minTime = cms.double(-31.5), - maxTime = cms.double(31.5) - ), - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(1.0), - maxEnergy = cms.double(2.0), - endcap = cms.bool(False), - minTime = cms.double(-6.), - maxTime = cms.double(6.) - ), - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(1.0), - maxEnergy = cms.double(2.0), - endcap = cms.bool(True), - minTime = cms.double(-20.5), - maxTime = cms.double(20.5) - ), - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(2.0), - maxEnergy = cms.double(5.0), - endcap = cms.bool(False), - minTime = cms.double(-4.), - maxTime = cms.double(4.) - ), - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(2.0), - maxEnergy = cms.double(5.0), - endcap = cms.bool(True), - minTime = cms.double(-12.), - maxTime = cms.double(12.) - ), - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(5.0), - maxEnergy = cms.double(20.0), - endcap = cms.bool(False), - minTime = cms.double(-4.), - maxTime = cms.double(4.) - ), - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(5.0), - maxEnergy = cms.double(20.0), - endcap = cms.bool(True), - minTime = cms.double(-5.), - maxTime = cms.double(5.) - ), - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(20.0), - maxEnergy = cms.double(1e24), - endcap = cms.bool(False), - minTime = cms.double(-4.), - maxTime = cms.double(4.) - ), - cms.PSet( - depth=cms.double(1.0), - minEnergy = cms.double(20.0), - maxEnergy = cms.double(1e24), - endcap = cms.bool(True), - minTime = cms.double(-5.), - maxTime = cms.double(5.) - ) - ) -) - - diff --git a/RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.cc b/RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.cc index da488d22bc26a..3fb0deff21666 100644 --- a/RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.cc +++ b/RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.cc @@ -12,10 +12,10 @@ using namespace edm; using namespace reco; PFClusterAnalyzer::PFClusterAnalyzer(const edm::ParameterSet& iConfig) - : inputTagPFClusters_(iConfig.getParameter("PFClusters")), + : inputTokenPFClusters_(consumes(iConfig.getParameter("PFClusters"))), verbose_(iConfig.getUntrackedParameter("verbose", false)), printBlocks_(iConfig.getUntrackedParameter("printBlocks", false)) { - LogDebug("PFClusterAnalyzer") << " input collection : " << inputTagPFClusters_; + LogDebug("PFClusterAnalyzer") << " input collection : " << iConfig.getParameter("PFClusters"); } void PFClusterAnalyzer::beginRun(const edm::Run& run, const edm::EventSetup& es) {} @@ -26,7 +26,7 @@ void PFClusterAnalyzer::analyze(const Event& iEvent, const EventSetup& iSetup) { // get PFClusters Handle pfClusters; - fetchCandidateCollection(pfClusters, inputTagPFClusters_, iEvent); + fetchCandidateCollection(pfClusters, inputTokenPFClusters_, iEvent); // get PFClusters for isolation @@ -49,13 +49,13 @@ void PFClusterAnalyzer::analyze(const Event& iEvent, const EventSetup& iSetup) { } void PFClusterAnalyzer::fetchCandidateCollection(Handle& c, - const InputTag& tag, + const edm::EDGetTokenT& token, const Event& iEvent) const { - bool found = iEvent.getByLabel(tag, c); + c = iEvent.getHandle(token); - if (!found) { + if (!c.isValid()) { ostringstream err; - err << " cannot get PFClusters: " << tag << endl; + err << " cannot get PFClusters " << endl; LogError("PFClusters") << err.str(); throw cms::Exception("MissingProduct", err.str()); } diff --git a/RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.h b/RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.h index 06415e0268e7c..524a368ff8d7e 100644 --- a/RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.h +++ b/RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.h @@ -33,14 +33,14 @@ class PFClusterAnalyzer : public edm::one::EDAnalyzer { private: void fetchCandidateCollection(edm::Handle& c, - const edm::InputTag& tag, + const edm::EDGetTokenT& token, const edm::Event& iSetup) const; /* void printElementsInBlocks(const reco::PFCluster& cluster, */ /* std::ostream& out=std::cout) const; */ /// PFClusters in which we'll look for pile up particles - const edm::InputTag inputTagPFClusters_; + const edm::EDGetTokenT inputTokenPFClusters_; /// verbose ? const bool verbose_; diff --git a/RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.cc b/RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.cc index 2a063a1ef463b..52ce4c26bc3b5 100644 --- a/RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.cc +++ b/RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.cc @@ -14,8 +14,9 @@ using namespace edm; using namespace reco; PFClusterComparator::PFClusterComparator(const edm::ParameterSet& iConfig) - : inputTagPFClusters_(iConfig.getParameter("PFClusters")), - inputTagPFClustersCompare_(iConfig.getParameter("PFClustersCompare")), + : inputTokenPFClusters_(consumes(iConfig.getParameter("PFClusters"))), + inputTokenPFClustersCompare_( + consumes(iConfig.getParameter("PFClustersCompare"))), verbose_(iConfig.getUntrackedParameter("verbose", false)), printBlocks_(iConfig.getUntrackedParameter("printBlocks", false)) { usesResource("TFileService"); @@ -37,7 +38,7 @@ PFClusterComparator::PFClusterComparator(const edm::ParameterSet& iConfig) posZ_new = fs->make("posZ_new", "log10(E cluster)", 50000, 0, 500); deltaZ = fs->make("delta_Z", "Z_{old} - Z_{new}", 5000, -5, 5); - LogDebug("PFClusterComparator") << " input collection : " << inputTagPFClusters_; + LogDebug("PFClusterComparator") << " input collection : " << iConfig.getParameter("PFClusters"); } void PFClusterComparator::analyze(const Event& iEvent, const EventSetup& iSetup) { @@ -46,10 +47,10 @@ void PFClusterComparator::analyze(const Event& iEvent, const EventSetup& iSetup) // get PFClusters Handle pfClusters; - fetchCandidateCollection(pfClusters, inputTagPFClusters_, iEvent); + fetchCandidateCollection(pfClusters, inputTokenPFClusters_, iEvent); Handle pfClustersCompare; - fetchCandidateCollection(pfClustersCompare, inputTagPFClustersCompare_, iEvent); + fetchCandidateCollection(pfClustersCompare, inputTokenPFClustersCompare_, iEvent); // get PFClusters for isolation @@ -145,13 +146,13 @@ void PFClusterComparator::analyze(const Event& iEvent, const EventSetup& iSetup) } void PFClusterComparator::fetchCandidateCollection(Handle& c, - const InputTag& tag, + const edm::EDGetTokenT& token, const Event& iEvent) const { - bool found = iEvent.getByLabel(tag, c); + c = iEvent.getHandle(token); - if (!found) { + if (!c.isValid()) { ostringstream err; - err << " cannot get PFClusters: " << tag << endl; + err << " cannot get PFClusters " << endl; LogError("PFClusters") << err.str(); throw cms::Exception("MissingProduct", err.str()); } diff --git a/RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.h b/RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.h index 584d2f535b5b0..2c4c95e3fcf6f 100644 --- a/RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.h +++ b/RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.h @@ -36,15 +36,15 @@ class PFClusterComparator : public edm::one::EDAnalyzer &c, - const edm::InputTag &tag, + const edm::EDGetTokenT &token, const edm::Event &iSetup) const; /* void printElementsInBlocks(const reco::PFCluster& cluster, */ /* std::ostream& out=std::cout) const; */ /// PFClusters in which we'll look for pile up particles - const edm::InputTag inputTagPFClusters_; - const edm::InputTag inputTagPFClustersCompare_; + const edm::EDGetTokenT inputTokenPFClusters_; + const edm::EDGetTokenT inputTokenPFClustersCompare_; /// verbose ? const bool verbose_; diff --git a/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc b/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc index e684868a6b366..f5c8fae8c0413 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc @@ -25,6 +25,7 @@ class PFBlockProducer : public edm::stream::EDProducer<> { void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; void produce(edm::Event&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: /// verbose ? @@ -37,6 +38,318 @@ class PFBlockProducer : public edm::stream::EDProducer<> { DEFINE_FWK_MODULE(PFBlockProducer); +void PFBlockProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + // verbosity + desc.addUntracked("verbose", false); + // Debug flag + desc.addUntracked("debug", false); + //define what we are importing into particle flow + //from the various subdetectors + // importers are executed in the order they are defined here!!! + //order matters for some modules (it is pointed out where this is important) + // you can find a list of all available importers in: + // plugins/importers + { + std::vector vpset; + vpset.reserve(12); + { + edm::ParameterSet pset; + pset.addParameter("importerName", "GSFTrackImporter"); + pset.addParameter("source", {"pfTrackElec"}); + pset.addParameter("gsfsAreSecondary", false); + pset.addParameter("superClustersArePF", true); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("importerName", "ConvBremTrackImporter"); + pset.addParameter("source", {"pfTrackElec"}); + pset.addParameter("vetoEndcap", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("importerName", "SuperClusterImporter"); + pset.addParameter("source_eb", + {"particleFlowSuperClusterECAL:particleFlowSuperClusterECALBarrel"}); + pset.addParameter( + "source_ee", {"particleFlowSuperClusterECAL:particleFlowSuperClusterECALEndcapWithPreshower"}); + pset.addParameter("maximumHoverE", 0.5); + pset.addParameter("minSuperClusterPt", 10.0); + pset.addParameter("minPTforBypass", 100.0); + pset.addParameter("hbheRecHitsTag", {"hbhereco"}); + pset.addParameter("maxSeverityHB", 9); + pset.addParameter("maxSeverityHE", 9); + pset.addParameter("usePFThresholdsFromDB", false); + pset.addParameter("superClustersArePF", true); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("importerName", "ConversionTrackImporter"); + pset.addParameter("source", {"pfConversions"}); + pset.addParameter("vetoEndcap", false); + vpset.emplace_back(pset); + } + // V0's not actually used in particle flow block building so far + //NuclearInteraction's also come in Loose and VeryLoose varieties + { + edm::ParameterSet pset; + pset.addParameter("importerName", "NuclearInteractionTrackImporter"); + pset.addParameter("source", {"pfDisplacedTrackerVertex"}); + pset.addParameter("vetoEndcap", false); + vpset.emplace_back(pset); + } + //for best timing GeneralTracksImporter should come after + // all secondary track importers + { + edm::ParameterSet pset; + pset.addParameter("importerName", "GeneralTracksImporter"); + pset.addParameter("source", {"pfTrack"}); + pset.addParameter("vetoEndcap", false); + pset.addParameter("muonSrc", {"muons1stStep"}); + pset.addParameter("trackQuality", "highPurity"); + pset.addParameter("cleanBadConvertedBrems", true); + pset.addParameter("useIterativeTracking", true); + pset.addParameter>("DPtOverPtCuts_byTrackAlgo", {10.0, 10.0, 10.0, 10.0, 10.0, 5.0}); + pset.addParameter>("NHitCuts_byTrackAlgo", {3, 3, 3, 3, 3, 3}); + pset.addParameter("muonMaxDPtOPt", 1); + vpset.emplace_back(pset); + } + // secondary GSF tracks are also turned off + // to properly set SC based links you need to run ECAL importer + // after you've imported all SCs to the block + { + edm::ParameterSet pset; + pset.addParameter("importerName", "ECALClusterImporter"); + pset.addParameter("source", {"particleFlowClusterECAL"}); + pset.addParameter("BCtoPFCMap", {"particleFlowSuperClusterECAL:PFClusterAssociationEBEE"}); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("importerName", "GenericClusterImporter"); + pset.addParameter("source", {"particleFlowClusterHCAL"}); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("importerName", "GenericClusterImporter"); + pset.addParameter("source", {"particleFlowBadHcalPseudoCluster"}); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("importerName", "GenericClusterImporter"); + pset.addParameter("source", {"particleFlowClusterHO"}); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("importerName", "GenericClusterImporter"); + pset.addParameter("source", {"particleFlowClusterHF"}); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("importerName", "GenericClusterImporter"); + pset.addParameter("source", {"particleFlowClusterPS"}); + vpset.emplace_back(pset); + } + edm::ParameterSetDescription psd; + psd.add("importerName"); + psd.add("source", {}); + psd.addOptional("gsfsAreSecondary", false); + psd.addOptional("superClustersArePF", false); + psd.addOptional("source_eb", {}); + psd.addOptional("source_ee", {}); + psd.addOptional("maximumHoverE", 1E9); + psd.addOptional("minSuperClusterPt", -1); + psd.addOptional("minPTforBypass", -1); + psd.addOptional("hbheRecHitsTag", {}); + psd.addOptional("maxSeverityHB", 1E9); + psd.addOptional("maxSeverityHE", 1E9); + psd.addOptional("usePFThresholdsFromDB", false); + psd.addOptional("vetoEndcap", false); + psd.addOptional("muonSrc", {}); + psd.addOptional("trackQuality"); + psd.addOptional("cleanBadConvertedBrems", false); + psd.addOptional("useIterativeTracking", false); + psd.addOptional>("DPtOverPtCuts_byTrackAlgo", {}); + psd.addOptional>("NHitCuts_byTrackAlgo", {}); + psd.addOptional("muonMaxDPtOPt", 1E9); + psd.addOptional("BCtoPFCMap", {}); + psd.addOptional("maxDPtOPt", 1E9); + psd.addOptional("vetoMode", 0); + psd.addOptional("vetoSrc", {}); + psd.addOptional("timeValueMap", {}); + psd.addOptional("timeErrorMap", {}); + psd.addOptional("timeQualityMap", {}); + psd.addOptional("timeQualityThreshold", 0); + psd.addOptional("timeValueMapGsf", {}); + psd.addOptional("timeErrorMapGsf", {}); + psd.addOptional("timeQualityMapGsf", {}); + desc.addVPSet("elementImporters", psd, vpset); + } + //linking definitions + // you can find a list of all available linkers in: + // plugins/linkers + // see : plugins/kdtrees for available KDTree Types + // to enable a KDTree for a linking pair, write a KDTree linker + // and set useKDTree = True in the linker PSet + //order does not matter here since we are defining a lookup table + { + std::vector vpset; + vpset.reserve(18); + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "PreshowerAndECALLinker"); + pset.addParameter("linkType", "PS1:ECAL"); + pset.addParameter("useKDTree ", true); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "PreshowerAndECALLinker"); + pset.addParameter("linkType", "PS2:ECAL"); + pset.addParameter("useKDTree ", true); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "TrackAndECALLinker"); + pset.addParameter("linkType", "TRACK:ECAL"); + pset.addParameter("useKDTree ", true); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "TrackAndHCALLinker"); + pset.addParameter("linkType", "TRACK:HCAL"); + pset.addParameter("useKDTree", true); + pset.addParameter("trajectoryLayerEntrance", "HCALEntrance"); + pset.addParameter("trajectoryLayerExit", "HCALExit"); + pset.addParameter("nMaxHcalLinksPerTrack", + 1); // the max hcal links per track (negative values: no restriction) + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "TrackAndHOLinker"); + pset.addParameter("linkType", "TRACK:HO"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "ECALAndHCALLinker"); + pset.addParameter("linkType", "ECAL:HCAL"); + pset.addParameter("minAbsEtaEcal", 2.5); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "HCALAndHOLinker"); + pset.addParameter("linkType", "HCAL:HO"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "HFEMAndHFHADLinker"); + pset.addParameter("linkType", "HFEM:HFHAD"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "TrackAndTrackLinker"); + pset.addParameter("linkType", "TRACK:TRACK"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "ECALAndECALLinker"); + pset.addParameter("linkType", "ECAL:ECAL"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "GSFAndECALLinker"); + pset.addParameter("linkType", "GSF:ECAL"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "TrackAndGSFLinker"); + pset.addParameter("linkType", "TRACK:GSF"); + pset.addParameter("useKDTree", false); + pset.addParameter("useConvertedBrems", true); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "GSFAndBREMLinker"); + pset.addParameter("linkType", "GSF:BREM"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "GSFAndGSFLinker"); + pset.addParameter("linkType", "GSF:GSF"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "ECALAndBREMLinker"); + pset.addParameter("linkType", "ECAL:BREM"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "GSFAndHCALLinker"); + pset.addParameter("linkType", "GSF:HCAL"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "HCALAndBREMLinker"); + pset.addParameter("linkType", "HCAL:BREM"); + pset.addParameter("useKDTree", false); + vpset.emplace_back(pset); + } + { + edm::ParameterSet pset; + pset.addParameter("linkerName", "SCAndECALLinker"); + pset.addParameter("linkType", "SC:ECAL"); + pset.addParameter("useKDTree", false); + pset.addParameter("SuperClusterMatchByRef", true); + vpset.emplace_back(pset); + } + edm::ParameterSetDescription psd; + psd.add("linkerName"); + psd.add("linkType"); + psd.add("useKDTree", false); + psd.addOptional("trajectoryLayerEntrance"); + psd.addOptional("trajectoryLayerExit"); + psd.addOptional("nMaxHcalLinksPerTrack", 0); + psd.addOptional("minAbsEtaEcal", -1); + psd.addOptional("useConvertedBrems", false); + psd.addOptional("SuperClusterMatchByRef", false); + desc.addVPSet("linkDefinitions", psd, vpset); + } + descriptions.addWithDefaultLabel(desc); +} + using namespace std; using namespace edm; diff --git a/RecoParticleFlow/PFProducer/plugins/PFCandidateChecker.cc b/RecoParticleFlow/PFProducer/plugins/PFCandidateChecker.cc index 6fe62d2352a1b..10fdfbab6e5eb 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFCandidateChecker.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFCandidateChecker.cc @@ -34,10 +34,10 @@ class PFCandidateChecker : public edm::stream::EDAnalyzer<> { void printElementsInBlocks(const reco::PFCandidate& cand, std::ostream& out = std::cout) const; /// PFCandidates in which we'll look for pile up particles - edm::InputTag inputTagPFCandidatesReco_; - edm::InputTag inputTagPFCandidatesReReco_; - edm::InputTag inputTagPFJetsReco_; - edm::InputTag inputTagPFJetsReReco_; + edm::EDGetTokenT inputTokenPFCandidatesReco_; + edm::EDGetTokenT inputTokenPFCandidatesReReco_; + edm::EDGetTokenT inputTokenPFJetsReco_; + edm::EDGetTokenT inputTokenPFJetsReReco_; /// Cuts for comparison double deltaEMax_; @@ -66,13 +66,15 @@ using namespace edm; using namespace reco; PFCandidateChecker::PFCandidateChecker(const edm::ParameterSet& iConfig) { - inputTagPFCandidatesReco_ = iConfig.getParameter("pfCandidatesReco"); + inputTokenPFCandidatesReco_ = + consumes(iConfig.getParameter("pfCandidatesReco")); - inputTagPFCandidatesReReco_ = iConfig.getParameter("pfCandidatesReReco"); + inputTokenPFCandidatesReReco_ = + consumes(iConfig.getParameter("pfCandidatesReReco")); - inputTagPFJetsReco_ = iConfig.getParameter("pfJetsReco"); + inputTokenPFJetsReco_ = consumes(iConfig.getParameter("pfJetsReco")); - inputTagPFJetsReReco_ = iConfig.getParameter("pfJetsReReco"); + inputTokenPFJetsReReco_ = consumes(iConfig.getParameter("pfJetsReReco")); deltaEMax_ = iConfig.getParameter("deltaEMax"); @@ -88,8 +90,8 @@ PFCandidateChecker::PFCandidateChecker(const edm::ParameterSet& iConfig) { entry_ = 0; - LogDebug("PFCandidateChecker") << " input collections : " << inputTagPFCandidatesReco_ << " " - << inputTagPFCandidatesReReco_; + LogDebug("PFCandidateChecker") << " input collections : " << iConfig.getParameter("pfCandidatesReco") << " " + << iConfig.getParameter("pfCandidatesReReco"); } void PFCandidateChecker::analyze(const Event& iEvent, const EventSetup& iSetup) { @@ -97,17 +99,10 @@ void PFCandidateChecker::analyze(const Event& iEvent, const EventSetup& iSetup) // get PFCandidates - Handle pfCandidatesReco; - iEvent.getByLabel(inputTagPFCandidatesReco_, pfCandidatesReco); - - Handle pfCandidatesReReco; - iEvent.getByLabel(inputTagPFCandidatesReReco_, pfCandidatesReReco); - - Handle pfJetsReco; - iEvent.getByLabel(inputTagPFJetsReco_, pfJetsReco); - - Handle pfJetsReReco; - iEvent.getByLabel(inputTagPFJetsReReco_, pfJetsReReco); + const auto& pfCandidatesReco = iEvent.getHandle(inputTokenPFCandidatesReco_); + const auto& pfCandidatesReReco = iEvent.getHandle(inputTokenPFCandidatesReReco_); + const auto& pfJetsReco = iEvent.getHandle(inputTokenPFJetsReco_); + const auto& pfJetsReReco = iEvent.getHandle(inputTokenPFJetsReReco_); reco::PFCandidateCollection pfReco, pfReReco; diff --git a/RecoParticleFlow/PFProducer/plugins/PFConcretePFCandidateProducer.cc b/RecoParticleFlow/PFProducer/plugins/PFConcretePFCandidateProducer.cc index bebb6bf04f7d2..652ebaa96a908 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFConcretePFCandidateProducer.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFConcretePFCandidateProducer.cc @@ -14,15 +14,22 @@ class PFConcretePFCandidateProducer : public edm::stream::EDProducer<> { ~PFConcretePFCandidateProducer() override; void produce(edm::Event&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: - edm::InputTag inputColl_; + const edm::EDGetTokenT inputColl_; }; DEFINE_FWK_MODULE(PFConcretePFCandidateProducer); -PFConcretePFCandidateProducer::PFConcretePFCandidateProducer(const edm::ParameterSet& iConfig) { - inputColl_ = iConfig.getParameter("src"); +void PFConcretePFCandidateProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("src", {"particleFlow"}); + descriptions.add("pfConcretePFCandidateProducer", desc); +} + +PFConcretePFCandidateProducer::PFConcretePFCandidateProducer(const edm::ParameterSet& iConfig) + : inputColl_(consumes(iConfig.getParameter("src"))) { // register products produces(); } @@ -30,10 +37,9 @@ PFConcretePFCandidateProducer::PFConcretePFCandidateProducer(const edm::Paramete PFConcretePFCandidateProducer::~PFConcretePFCandidateProducer() {} void PFConcretePFCandidateProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - edm::Handle inputColl; - bool inputOk = iEvent.getByLabel(inputColl_, inputColl); + const auto& inputColl = iEvent.getHandle(inputColl_); - if (!inputOk) { + if (!inputColl.isValid()) { // nothing ... I guess we prefer to send an exception in the next lines } diff --git a/RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc b/RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc index c0fc66e281e46..ef3e8573b00af 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc @@ -31,17 +31,18 @@ class PFElectronTranslator : public edm::stream::EDProducer<> { ~PFElectronTranslator() override; void produce(edm::Event&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); typedef std::vector>> IsolationValueMaps; private: // to retrieve the collection from the event bool fetchCandidateCollection(edm::Handle& c, - const edm::InputTag& tag, + const edm::EDGetTokenT& token, const edm::Event& iEvent) const; // to retrieve the collection from the event void fetchGsfCollection(edm::Handle& c, - const edm::InputTag& tag, + const edm::EDGetTokenT& token, const edm::Event& iEvent) const; // makes a basic cluster from PFBlockElement and add it to the collection ; the corrected energy is taken @@ -88,10 +89,10 @@ class PFElectronTranslator : public edm::stream::EDProducer<> { const reco::PFBlockElement& pfbe) const; private: - edm::InputTag inputTagPFCandidates_; - edm::InputTag inputTagPFCandidateElectrons_; - edm::InputTag inputTagGSFTracks_; - std::vector inputTagIsoVals_; + edm::EDGetTokenT inputTokenPFCandidates_; + edm::EDGetTokenT inputTokenPFCandidateElectrons_; + edm::EDGetTokenT inputTokenGSFTracks_; + std::vector>> inputTokenIsoVals_; std::string PFBasicClusterCollection_; std::string PFPreshowerClusterCollection_; std::string PFSuperClusterCollection_; @@ -140,10 +141,37 @@ class PFElectronTranslator : public edm::stream::EDProducer<> { DEFINE_FWK_MODULE(PFElectronTranslator); +void PFElectronTranslator::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("PFCandidate", {"pfSelectedElectrons"}); + desc.add("PFCandidateElectron", {"particleFlowTmp:electrons"}); + desc.add("GSFTracks", {"electronGsfTracks"}); + desc.add("PFBasicClusters", "pf"); + desc.add("PFPreshowerClusters", "pf"); + desc.add("PFSuperClusters", "pf"); + desc.add("ElectronMVA", "pf"); + desc.add("ElectronSC", "pf"); + desc.add("PFGsfElectron", "pf"); + desc.add("PFGsfElectronCore", "pf"); + desc.add("MVACutBlock", {}); + desc.add("CheckStatusFlag", true); + desc.add("useIsolationValues", false); + { + edm::ParameterSetDescription pset; + pset.add("pfSumChargedHadronPt", {"elPFIsoValueCharged04PFId"}); + pset.add("pfSumPhotonEt", {"elPFIsoValueGamma04PFId"}); + pset.add("pfSumNeutralHadronEt", {"elPFIsoValueNeutral04PFId"}); + pset.add("pfSumPUPt", {"elPFIsoValuePU04PFId"}); + desc.add("isolationValues", pset); + } + descriptions.addWithDefaultLabel(desc); +} + PFElectronTranslator::PFElectronTranslator(const edm::ParameterSet& iConfig) { - inputTagPFCandidates_ = iConfig.getParameter("PFCandidate"); - inputTagPFCandidateElectrons_ = iConfig.getParameter("PFCandidateElectron"); - inputTagGSFTracks_ = iConfig.getParameter("GSFTracks"); + inputTokenPFCandidates_ = consumes(iConfig.getParameter("PFCandidate")); + inputTokenPFCandidateElectrons_ = + consumes(iConfig.getParameter("PFCandidateElectron")); + inputTokenGSFTracks_ = consumes(iConfig.getParameter("GSFTracks")); bool useIsolationValues = iConfig.getParameter("useIsolationValues"); if (useIsolationValues) { @@ -151,10 +179,13 @@ PFElectronTranslator::PFElectronTranslator(const edm::ParameterSet& iConfig) { throw cms::Exception("PFElectronTranslator|InternalError") << "Missing ParameterSet isolationValues"; else { edm::ParameterSet isoVals = iConfig.getParameter("isolationValues"); - inputTagIsoVals_.push_back(isoVals.getParameter("pfSumChargedHadronPt")); - inputTagIsoVals_.push_back(isoVals.getParameter("pfSumPhotonEt")); - inputTagIsoVals_.push_back(isoVals.getParameter("pfSumNeutralHadronEt")); - inputTagIsoVals_.push_back(isoVals.getParameter("pfSumPUPt")); + inputTokenIsoVals_.push_back( + consumes>(isoVals.getParameter("pfSumChargedHadronPt"))); + inputTokenIsoVals_.push_back( + consumes>(isoVals.getParameter("pfSumPhotonEt"))); + inputTokenIsoVals_.push_back( + consumes>(isoVals.getParameter("pfSumNeutralHadronEt"))); + inputTokenIsoVals_.push_back(consumes>(isoVals.getParameter("pfSumPUPt"))); } } @@ -207,11 +238,11 @@ void PFElectronTranslator::produce(edm::Event& iEvent, const edm::EventSetup& iS edm::ValueMap::Filler scRefFiller(*scMap_p); edm::Handle pfCandidates; - bool status = fetchCandidateCollection(pfCandidates, inputTagPFCandidates_, iEvent); + bool status = fetchCandidateCollection(pfCandidates, inputTokenPFCandidates_, iEvent); - IsolationValueMaps isolationValues(inputTagIsoVals_.size()); - for (size_t j = 0; j < inputTagIsoVals_.size(); ++j) { - iEvent.getByLabel(inputTagIsoVals_[j], isolationValues[j]); + IsolationValueMaps isolationValues(inputTokenIsoVals_.size()); + for (size_t j = 0; j < inputTokenIsoVals_.size(); ++j) { + isolationValues[j] = iEvent.getHandle(inputTokenIsoVals_[j]); } // clear the vectors @@ -356,26 +387,26 @@ void PFElectronTranslator::produce(edm::Event& iEvent, const edm::EventSetup& iS } bool PFElectronTranslator::fetchCandidateCollection(edm::Handle& c, - const edm::InputTag& tag, + const edm::EDGetTokenT& token, const edm::Event& iEvent) const { - bool found = iEvent.getByLabel(tag, c); + c = iEvent.getHandle(token); - if (!found && !emptyIsOk_) { + if (!c.isValid() && !emptyIsOk_) { std::ostringstream err; - err << " cannot get PFCandidates: " << tag << std::endl; + err << " cannot get PFCandidates " << std::endl; edm::LogError("PFElectronTranslator") << err.str(); } - return found; + return c.isValid(); } void PFElectronTranslator::fetchGsfCollection(edm::Handle& c, - const edm::InputTag& tag, + const edm::EDGetTokenT& token, const edm::Event& iEvent) const { - bool found = iEvent.getByLabel(tag, c); + c = iEvent.getHandle(token); - if (!found) { + if (!c.isValid()) { std::ostringstream err; - err << " cannot get GSFTracks: " << tag << std::endl; + err << " cannot get GSFTracks " << std::endl; edm::LogError("PFElectronTranslator") << err.str(); throw cms::Exception("MissingProduct", err.str()); } @@ -468,7 +499,7 @@ void PFElectronTranslator::createSuperClusterGsfMapRefs( void PFElectronTranslator::fillMVAValueMap(edm::Event& iEvent, edm::ValueMap::Filler& filler) { gsfMvaMap_.clear(); edm::Handle pfCandidates; - bool status = fetchCandidateCollection(pfCandidates, inputTagPFCandidateElectrons_, iEvent); + bool status = fetchCandidateCollection(pfCandidates, inputTokenPFCandidateElectrons_, iEvent); unsigned ncand = (status) ? pfCandidates->size() : 0; for (unsigned i = 0; i < ncand; ++i) { @@ -482,7 +513,7 @@ void PFElectronTranslator::fillMVAValueMap(edm::Event& iEvent, edm::ValueMap gsfTracks; - fetchGsfCollection(gsfTracks, inputTagGSFTracks_, iEvent); + fetchGsfCollection(gsfTracks, inputTokenGSFTracks_, iEvent); unsigned ngsf = gsfTracks->size(); std::vector values; for (unsigned igsf = 0; igsf < ngsf; ++igsf) { @@ -503,7 +534,7 @@ void PFElectronTranslator::fillMVAValueMap(edm::Event& iEvent, edm::ValueMap::Filler& filler) const { edm::Handle gsfTracks; - fetchGsfCollection(gsfTracks, inputTagGSFTracks_, iEvent); + fetchGsfCollection(gsfTracks, inputTokenGSFTracks_, iEvent); unsigned ngsf = gsfTracks->size(); std::vector values; for (unsigned igsf = 0; igsf < ngsf; ++igsf) { diff --git a/RecoParticleFlow/PFProducer/plugins/PFLinker.cc b/RecoParticleFlow/PFProducer/plugins/PFLinker.cc index fa8689e81a88c..2e8b5fd964bdc 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFLinker.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFLinker.cc @@ -29,6 +29,7 @@ class PFLinker : public edm::stream::EDProducer<> { ~PFLinker() override; void produce(edm::Event&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: template @@ -77,6 +78,22 @@ class PFLinker : public edm::stream::EDProducer<> { DEFINE_FWK_MODULE(PFLinker); +void PFLinker::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add>("PFCandidate", {edm::InputTag("particleFlow")}); + desc.add("GsfElectrons", {"gedGsfElectrons"}); + desc.add("Photons", {"gedPhotons"}); + desc.add("Muons", {"muons", "muons1stStep2muonsMap"}); + desc.add("ProducePFCandidates", true); + desc.add("FillMuonRefs", true); + desc.add("OutputPF", ""); + desc.add("ValueMapElectrons", "electrons"); + desc.add("ValueMapPhotons", "photons"); + desc.add("ValueMapMerged", "all"); + desc.add("forceElectronsInHGCAL", false); + descriptions.add("pfLinker", desc); +} + PFLinker::PFLinker(const edm::ParameterSet& iConfig) { // vector of InputTag; more than 1 is not for RECO, it is for analysis diff --git a/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py b/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py index 82eca42e7f077..cba8b0c709209 100644 --- a/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py +++ b/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py @@ -1,155 +1,7 @@ import FWCore.ParameterSet.Config as cms -particleFlowBlock = cms.EDProducer( - "PFBlockProducer", - # verbosity - verbose = cms.untracked.bool(False), - # Debug flag - debug = cms.untracked.bool(False), - - #define what we are importing into particle flow - #from the various subdetectors - # importers are executed in the order they are defined here!!! - #order matters for some modules (it is pointed out where this is important) - # you can find a list of all available importers in: - # plugins/importers - elementImporters = cms.VPSet( - cms.PSet( importerName = cms.string("GSFTrackImporter"), - source = cms.InputTag("pfTrackElec"), - gsfsAreSecondary = cms.bool(False), - superClustersArePF = cms.bool(True) ), - cms.PSet( importerName = cms.string("ConvBremTrackImporter"), - source = cms.InputTag("pfTrackElec"), - vetoEndcap = cms.bool(False)), - cms.PSet( importerName = cms.string("SuperClusterImporter"), - source_eb = cms.InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALBarrel"), - source_ee = cms.InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALEndcapWithPreshower"), - maximumHoverE = cms.double(0.5), - minSuperClusterPt = cms.double(10.0), - minPTforBypass = cms.double(100.0), - hbheRecHitsTag = cms.InputTag('hbhereco'), - maxSeverityHB = cms.int32(9), - maxSeverityHE = cms.int32(9), - usePFThresholdsFromDB = cms.bool(False), - superClustersArePF = cms.bool(True) ), - cms.PSet( importerName = cms.string("ConversionTrackImporter"), - source = cms.InputTag("pfConversions"), - vetoEndcap = cms.bool(False)), - # V0's not actually used in particle flow block building so far - #cms.PSet( importerName = cms.string("V0TrackImporter"), - # source = cms.InputTag("pfV0"), - # vetoEndcap = cms.bool(False)), - #NuclearInteraction's also come in Loose and VeryLoose varieties - cms.PSet( importerName = cms.string("NuclearInteractionTrackImporter"), - source = cms.InputTag("pfDisplacedTrackerVertex"), - vetoEndcap = cms.bool(False)), - #for best timing GeneralTracksImporter should come after - # all secondary track importers - cms.PSet( importerName = cms.string("GeneralTracksImporter"), - source = cms.InputTag("pfTrack"), - vetoEndcap = cms.bool(False), - muonSrc = cms.InputTag("muons1stStep"), - trackQuality = cms.string("highPurity"), - cleanBadConvertedBrems = cms.bool(True), - useIterativeTracking = cms.bool(True), - DPtOverPtCuts_byTrackAlgo = cms.vdouble(10.0,10.0,10.0, - 10.0,10.0,5.0), - NHitCuts_byTrackAlgo = cms.vuint32(3,3,3,3,3,3), - muonMaxDPtOPt = cms.double(1) - ), - # secondary GSF tracks are also turned off - #cms.PSet( importerName = cms.string("GSFTrackImporter"), - # source = cms.InputTag("pfTrackElec:Secondary"), - # gsfsAreSecondary = cms.bool(True), - # superClustersArePF = cms.bool(True) ), - # to properly set SC based links you need to run ECAL importer - # after you've imported all SCs to the block - cms.PSet( importerName = cms.string("ECALClusterImporter"), - source = cms.InputTag("particleFlowClusterECAL"), - BCtoPFCMap = cms.InputTag('particleFlowSuperClusterECAL:PFClusterAssociationEBEE') ), - cms.PSet( importerName = cms.string("GenericClusterImporter"), - source = cms.InputTag("particleFlowClusterHCAL") ), - cms.PSet( importerName = cms.string("GenericClusterImporter"), - source = cms.InputTag("particleFlowBadHcalPseudoCluster") ), - cms.PSet( importerName = cms.string("GenericClusterImporter"), - source = cms.InputTag("particleFlowClusterHO") ), - cms.PSet( importerName = cms.string("GenericClusterImporter"), - source = cms.InputTag("particleFlowClusterHF") ), - cms.PSet( importerName = cms.string("GenericClusterImporter"), - source = cms.InputTag("particleFlowClusterPS") ), - ), - - #linking definitions - # you can find a list of all available linkers in: - # plugins/linkers - # see : plugins/kdtrees for available KDTree Types - # to enable a KDTree for a linking pair, write a KDTree linker - # and set useKDTree = True in the linker PSet - #order does not matter here since we are defining a lookup table - linkDefinitions = cms.VPSet( - cms.PSet( linkerName = cms.string("PreshowerAndECALLinker"), - linkType = cms.string("PS1:ECAL"), - useKDTree = cms.bool(True) ), - cms.PSet( linkerName = cms.string("PreshowerAndECALLinker"), - linkType = cms.string("PS2:ECAL"), - useKDTree = cms.bool(True) ), - cms.PSet( linkerName = cms.string("TrackAndECALLinker"), - linkType = cms.string("TRACK:ECAL"), - useKDTree = cms.bool(True) ), - cms.PSet( linkerName = cms.string("TrackAndHCALLinker"), - linkType = cms.string("TRACK:HCAL"), - useKDTree = cms.bool(True), - trajectoryLayerEntrance = cms.string("HCALEntrance"), - trajectoryLayerExit = cms.string("HCALExit"), - nMaxHcalLinksPerTrack = cms.int32(1) # the max hcal links per track (negative values: no restriction) - ), - cms.PSet( linkerName = cms.string("TrackAndHOLinker"), - linkType = cms.string("TRACK:HO"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("ECALAndHCALLinker"), - linkType = cms.string("ECAL:HCAL"), - minAbsEtaEcal = cms.double(2.5), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("HCALAndHOLinker"), - linkType = cms.string("HCAL:HO"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("HFEMAndHFHADLinker"), - linkType = cms.string("HFEM:HFHAD"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("TrackAndTrackLinker"), - linkType = cms.string("TRACK:TRACK"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("ECALAndECALLinker"), - linkType = cms.string("ECAL:ECAL"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("GSFAndECALLinker"), - linkType = cms.string("GSF:ECAL"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("TrackAndGSFLinker"), - linkType = cms.string("TRACK:GSF"), - useKDTree = cms.bool(False), - useConvertedBrems = cms.bool(True) ), - cms.PSet( linkerName = cms.string("GSFAndBREMLinker"), - linkType = cms.string("GSF:BREM"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("GSFAndGSFLinker"), - linkType = cms.string("GSF:GSF"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("ECALAndBREMLinker"), - linkType = cms.string("ECAL:BREM"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("GSFAndHCALLinker"), - linkType = cms.string("GSF:HCAL"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("HCALAndBREMLinker"), - linkType = cms.string("HCAL:BREM"), - useKDTree = cms.bool(False) ), - cms.PSet( linkerName = cms.string("SCAndECALLinker"), - linkType = cms.string("SC:ECAL"), - useKDTree = cms.bool(False), - SuperClusterMatchByRef = cms.bool(True) ) - ) -) +from RecoParticleFlow.PFProducer.PFBlockProducer import PFBlockProducer +particleFlowBlock = PFBlockProducer() for imp in particleFlowBlock.elementImporters: if imp.importerName.value() == "SuperClusterImporter": diff --git a/RecoParticleFlow/PFProducer/python/pfConcretePFCandidateProducer_cfi.py b/RecoParticleFlow/PFProducer/python/pfConcretePFCandidateProducer_cfi.py deleted file mode 100644 index c013558b582d0..0000000000000 --- a/RecoParticleFlow/PFProducer/python/pfConcretePFCandidateProducer_cfi.py +++ /dev/null @@ -1,5 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -pfConcretePFCandidateProducer = cms.EDProducer("PFConcretePFCandidateProducer", - src = cms.InputTag('particleFlow') - ) diff --git a/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py b/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py index 679ddf57fc58a..5ce30e7a85e43 100644 --- a/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py +++ b/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py @@ -1,26 +1,6 @@ import FWCore.ParameterSet.Config as cms from RecoParticleFlow.PFProducer.pfElectronTranslatorMVACut_cfi import * +from RecoParticleFlow.PFProducer.PFElectronTranslator import PFElectronTranslator -pfElectronTranslator = cms.EDProducer("PFElectronTranslator", - PFCandidate = cms.InputTag("pfSelectedElectrons"), - PFCandidateElectron = cms.InputTag("particleFlowTmp:electrons"), - GSFTracks = cms.InputTag("electronGsfTracks"), - PFBasicClusters = cms.string("pf"), - PFPreshowerClusters = cms.string("pf"), - PFSuperClusters = cms.string("pf"), - ElectronMVA = cms.string("pf"), - ElectronSC = cms.string("pf"), - PFGsfElectron = cms.string("pf"), - PFGsfElectronCore = cms.string("pf"), - MVACutBlock = cms.PSet(pfElecMva), - CheckStatusFlag = cms.bool(True), - - useIsolationValues = cms.bool(False), - isolationValues = cms.PSet( - pfSumChargedHadronPt = cms.InputTag('elPFIsoValueCharged04PFId'), - pfSumPhotonEt = cms.InputTag('elPFIsoValueGamma04PFId'), - pfSumNeutralHadronEt= cms.InputTag('elPFIsoValueNeutral04PFId'), - pfSumPUPt= cms.InputTag('elPFIsoValuePU04PFId'), - ) - ) +pfElectronTranslator = PFElectronTranslator().clone(MVACutBlock = cms.PSet(pfElecMva)) diff --git a/RecoParticleFlow/PFProducer/python/pfLinker_cfi.py b/RecoParticleFlow/PFProducer/python/pfLinker_cfi.py deleted file mode 100644 index 8b25503a78456..0000000000000 --- a/RecoParticleFlow/PFProducer/python/pfLinker_cfi.py +++ /dev/null @@ -1,15 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -pfLinker = cms.EDProducer("PFLinker", - PFCandidate = cms.VInputTag(cms.InputTag("particleFlow")), - GsfElectrons = cms.InputTag("gedGsfElectrons"), - Photons = cms.InputTag("gedPhotons"), - Muons = cms.InputTag("muons","muons1stStep2muonsMap"), - ProducePFCandidates = cms.bool(True), - FillMuonRefs = cms.bool(True), - OutputPF = cms.string(""), - ValueMapElectrons = cms.string("electrons"), - ValueMapPhotons = cms.string("photons"), - ValueMapMerged = cms.string("all"), - forceElectronsInHGCAL = cms.bool(False) - ) diff --git a/RecoParticleFlow/PFProducer/test/EgGEDPhotonAnalyzer.cc b/RecoParticleFlow/PFProducer/test/EgGEDPhotonAnalyzer.cc index 38a2fe74c6764..6f7b14bb914a7 100644 --- a/RecoParticleFlow/PFProducer/test/EgGEDPhotonAnalyzer.cc +++ b/RecoParticleFlow/PFProducer/test/EgGEDPhotonAnalyzer.cc @@ -56,8 +56,6 @@ class EgGEDPhotonAnalyzer : public edm::one::EDAnalyzer pfToken_; + const edm::EDGetTokenT phoToken_; + const edm::EDGetTokenT mcToken_; + const edm::EDGetTokenT gedPhoToken_; }; // @@ -91,9 +94,10 @@ class EgGEDPhotonAnalyzer : public edm::one::EDAnalyzer(edm::InputTag("particleFlow"))), + phoToken_(consumes(edm::InputTag("photons"))), + mcToken_(consumes(edm::InputTag("VtxSmeared"))), + gedPhoToken_(consumes(edm::InputTag("gedPhotons"))) { usesResource(TFileService::kSharedResource); edm::Service fs; @@ -166,25 +170,10 @@ EgGEDPhotonAnalyzer::~EgGEDPhotonAnalyzer() { // ------------ method called to for each event ------------ void EgGEDPhotonAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { // Candidate info - Handle collection; - InputTag label("particleFlow"); // <- Special electron coll. - iEvent.getByLabel(label, collection); - std::vector candidates = (*collection.product()); - - InputTag recoPhotonLabel(string("photons")); - Handle theRecoPhotonCollection; - iEvent.getByLabel(recoPhotonLabel, theRecoPhotonCollection); - const PhotonCollection theRecoPh = *(theRecoPhotonCollection.product()); - - InputTag MCTruthCollection(string("VtxSmeared")); - edm::Handle pMCTruth; - iEvent.getByLabel(MCTruthCollection, pMCTruth); - const HepMC::GenEvent *genEvent = pMCTruth->GetEvent(); - - InputTag gedPhotonLabel(string("gedPhotons")); - Handle theGedPhotonCollection; - iEvent.getByLabel(gedPhotonLabel, theGedPhotonCollection); - const PhotonCollection theGedPh = *(theGedPhotonCollection.product()); + const auto &candidates = iEvent.get(pfToken_); + const auto &theRecoPh = iEvent.get(phoToken_); + const auto &genEvent = iEvent.get(mcToken_).GetEvent(); + const auto &theGedPh = iEvent.get(gedPhoToken_); bool debug = true; @@ -212,14 +201,13 @@ void EgGEDPhotonAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetu if (debug) cout << " MC particle: pt " << ptmc << " eta,phi " << etamc << ", " << phimc << endl; - std::vector::iterator it; - for (it = candidates.begin(); it != candidates.end(); ++it) { - reco::PFCandidate::ParticleType type = (*it).particleId(); + for (const auto &cand : candidates) { + reco::PFCandidate::ParticleType type = cand.particleId(); if (type == reco::PFCandidate::gamma) { - reco::PhotonRef phref = (*it).photonRef(); - float eta = (*it).eta(); - float phi = (*it).phi(); + reco::PhotonRef phref = cand.photonRef(); + float eta = cand.eta(); + float phi = cand.phi(); float deta = etamc - eta; float dphi = normalizedPhi(phimc - phi); @@ -258,7 +246,7 @@ void EgGEDPhotonAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetu } if (debug) - cout << " PF photon matched: pt " << (*it).pt() << " eta,phi " << eta << ", " << phi << endl; + cout << " PF photon matched: pt " << cand.pt() << " eta,phi " << eta << ", " << phi << endl; // all for the moment } } // End PFCandidates Electron Selection diff --git a/RecoParticleFlow/PFProducer/test/GsfGEDElectronAnalyzer.cc b/RecoParticleFlow/PFProducer/test/GsfGEDElectronAnalyzer.cc index 8a973d19904d5..bef74e7b29f6c 100644 --- a/RecoParticleFlow/PFProducer/test/GsfGEDElectronAnalyzer.cc +++ b/RecoParticleFlow/PFProducer/test/GsfGEDElectronAnalyzer.cc @@ -91,6 +91,13 @@ class GsfGEDElectronAnalyzer : public edm::one::EDAnalyzer pfToken_; + const edm::EDGetTokenT gsfEleToken_; + const edm::EDGetTokenT mcToken_; + const edm::EDGetTokenT gedEleToken_; + const edm::EDGetTokenT> metToken_; + const edm::EDGetTokenT> reMetToken_; }; // @@ -105,9 +112,12 @@ class GsfGEDElectronAnalyzer : public edm::one::EDAnalyzer(edm::InputTag("particleFlow::reRECO"))), + gsfEleToken_(consumes(edm::InputTag("gsfElectrons"))), + mcToken_(consumes(edm::InputTag("genParticles"))), + gedEleToken_(consumes(edm::InputTag("gedGsfElectrons::reRECO"))), + metToken_(consumes>(edm::InputTag("pfMet::RECO"))), + reMetToken_(consumes>(edm::InputTag("pfMet::reRECO"))) { usesResource(TFileService::kSharedResource); edm::Service fs; @@ -238,36 +248,15 @@ GsfGEDElectronAnalyzer::~GsfGEDElectronAnalyzer() { // ------------ method called to for each event ------------ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { // Candidate info - Handle collection; - InputTag label("particleFlow::reRECO"); // <- Special electron coll. - iEvent.getByLabel(label, collection); - std::vector candidates = (*collection.product()); - - InputTag egammaLabel(string("gsfElectrons")); - Handle theGsfEleCollection; - iEvent.getByLabel(egammaLabel, theGsfEleCollection); - const GsfElectronCollection theGsfEle = *(theGsfEleCollection.product()); - - InputTag MCTruthCollection(string("genParticles")); - edm::Handle > pMCTruth; - iEvent.getByLabel(MCTruthCollection, pMCTruth); - - InputTag gedEleLabel(string("gedGsfElectrons::reRECO")); - Handle theGedEleCollection; - iEvent.getByLabel(gedEleLabel, theGedEleCollection); - const GsfElectronCollection theGedEle = *(theGedEleCollection.product()); - - //get and plot the reco met - InputTag pfMETRecoLabel("pfMet::RECO"); - Handle > recoMet; - iEvent.getByLabel(pfMETRecoLabel, recoMet); - pf_MET_reco->Fill(recoMet->at(0).et()); - - //get and plot the rereco met - InputTag pfMETReRecoLabel("pfMet::reRECO"); - Handle > rerecoMet; - iEvent.getByLabel(pfMETReRecoLabel, rerecoMet); - pf_MET_rereco->Fill(rerecoMet->at(0).et()); + const auto &candidates = iEvent.get(pfToken_); + const auto &theGsfEle = iEvent.get(gsfEleToken_); + const auto &pMCTruth = iEvent.get(mcToken_); + const auto &theGedEle = iEvent.get(gedEleToken_); + const auto &recoMet = iEvent.get(metToken_); + const auto &rerecoMet = iEvent.get(reMetToken_); + + pf_MET_reco->Fill(recoMet[0].et()); + pf_MET_rereco->Fill(rerecoMet[0].et()); bool debug = true; @@ -278,13 +267,13 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS // Validation from generator events - for (std::vector::const_iterator cP = pMCTruth->begin(); cP != pMCTruth->end(); cP++) { - float etamc = cP->eta(); - float phimc = cP->phi(); - float ptmc = cP->pt(); - float Emc = cP->energy(); + for (const auto &cP : pMCTruth) { + float etamc = cP.eta(); + float phimc = cP.phi(); + float ptmc = cP.pt(); + float Emc = cP.energy(); - if (abs(cP->pdgId()) == 11 && cP->status() == 1 && cP->pt() > 2. && fabs(cP->eta()) < 2.5) { + if (abs(cP.pdgId()) == 11 && cP.status() == 1 && cP.pt() > 2. && fabs(cP.eta()) < 2.5) { h_etamc_ele->Fill(etamc); h_ptmc_ele->Fill(ptmc); @@ -296,16 +285,15 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS if (debug) cout << " MC particle: pt " << ptmc << " eta,phi " << etamc << ", " << phimc << endl; - std::vector::iterator it; - for (it = candidates.begin(); it != candidates.end(); ++it) { - reco::PFCandidate::ParticleType type = (*it).particleId(); + for (const auto &cand : candidates) { + reco::PFCandidate::ParticleType type = cand.particleId(); if (type == reco::PFCandidate::e) { - float eta = (*it).eta(); - float phi = (*it).phi(); - float pfmva = (*it).mva_e_pi(); + float eta = cand.eta(); + float phi = cand.phi(); + float pfmva = cand.mva_e_pi(); - reco::GsfTrackRef refGsf = (*it).gsfTrackRef(); + reco::GsfTrackRef refGsf = cand.gsfTrackRef(); //ElectronSeedRef seedRef= refGsf->extra()->seedRef().castTo(); float deta = etamc - eta; @@ -314,7 +302,7 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS if (dR < 0.05) { MindR = dR; - mvaCutEle = (*it).mva_e_pi(); + mvaCutEle = cand.mva_e_pi(); /* if(seedRef->isEcalDriven()) isPfEcDr = true; @@ -323,7 +311,7 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS */ if (debug) - cout << " PF ele matched: pt " << (*it).pt() << " (" << (*it).ecalEnergy() / std::cosh(eta) << ") " + cout << " PF ele matched: pt " << cand.pt() << " (" << cand.ecalEnergy() / std::cosh(eta) << ") " << " eta,phi " << eta << ", " << phi << " pfmva " << pfmva << endl; // all for the moment } @@ -351,26 +339,26 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS bool isEgTrDr = false; bool isEgEcDr = false; - for (uint j = 0; j < theGsfEle.size(); j++) { - reco::GsfTrackRef egGsfTrackRef = (theGsfEle[j]).gsfTrack(); - float etareco = theGsfEle[j].eta(); - float phireco = theGsfEle[j].phi(); + for (const auto &gsfEle : theGsfEle) { + reco::GsfTrackRef egGsfTrackRef = gsfEle.gsfTrack(); + float etareco = gsfEle.eta(); + float phireco = gsfEle.phi(); - float pfmva = theGsfEle[j].mva_e_pi(); + float pfmva = gsfEle.mva_e_pi(); - reco::GsfTrackRef refGsf = theGsfEle[j].gsfTrack(); + reco::GsfTrackRef refGsf = gsfEle.gsfTrack(); //ElectronSeedRef seedRef= refGsf->extra()->seedRef().castTo(); float deta = etamc - etareco; float dphi = normalizedPhi(phimc - phireco); float dR = sqrt(deta * deta + dphi * dphi); - float SCEnergy = (theGsfEle[j]).superCluster()->energy(); + float SCEnergy = gsfEle.superCluster()->energy(); float ErecoEtrue = SCEnergy / Emc; if (dR < 0.05) { if (debug) - cout << " EG ele matched: pt " << theGsfEle[j].pt() << " (" << SCEnergy / std::cosh(etareco) << ") " + cout << " EG ele matched: pt " << gsfEle.pt() << " (" << SCEnergy / std::cosh(etareco) << ") " << " eta,phi " << etareco << ", " << phireco << " pfmva " << pfmva << endl; if (fabs(etamc) < 0.5) { @@ -389,8 +377,8 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS eg_EEcalEtrue_5->Fill(ErecoEtrue); } - if ((theGsfEle[j].parentSuperCluster()).isNonnull()) { - float SCPF = (theGsfEle[j]).parentSuperCluster()->rawEnergy(); + if ((gsfEle.parentSuperCluster()).isNonnull()) { + float SCPF = gsfEle.parentSuperCluster()->rawEnergy(); float EpfEtrue = SCPF / Emc; if (fabs(etamc) < 0.5) { pf_EEcalEtrue_1->Fill(EpfEtrue); @@ -407,47 +395,47 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS if (fabs(etamc) >= 2.0 && fabs(etamc) < 2.5) { pf_EEcalEtrue_5->Fill(EpfEtrue); } - const reco::GsfElectron::ShowerShape &pfshapes = theGsfEle[j].showerShape(); + const reco::GsfElectron::ShowerShape &pfshapes = gsfEle.showerShape(); pf_e1x5_all->Fill(pfshapes.e1x5); pf_sihih_all->Fill(pfshapes.sigmaIetaIeta); pf_r9_all->Fill(pfshapes.r9); - pf_scshh_all->Fill((theGsfEle[j]).parentSuperCluster()->etaWidth()); - pf_scsff_all->Fill((theGsfEle[j]).parentSuperCluster()->phiWidth()); + pf_scshh_all->Fill(gsfEle.parentSuperCluster()->etaWidth()); + pf_scsff_all->Fill(gsfEle.parentSuperCluster()->phiWidth()); if (std::abs(etareco) < 1.479) { pf_e1x5_eb->Fill(pfshapes.e1x5); pf_sihih_eb->Fill(pfshapes.sigmaIetaIeta); pf_r9_eb->Fill(pfshapes.r9); - pf_scshh_eb->Fill((theGsfEle[j]).parentSuperCluster()->etaWidth()); - pf_scsff_eb->Fill((theGsfEle[j]).parentSuperCluster()->phiWidth()); + pf_scshh_eb->Fill(gsfEle.parentSuperCluster()->etaWidth()); + pf_scsff_eb->Fill(gsfEle.parentSuperCluster()->phiWidth()); } if (std::abs(etareco) >= 1.479) { pf_e1x5_ee->Fill(pfshapes.e1x5); pf_sihih_ee->Fill(pfshapes.sigmaIetaIeta); pf_r9_ee->Fill(pfshapes.r9); - pf_scshh_ee->Fill((theGsfEle[j]).parentSuperCluster()->etaWidth()); - pf_scsff_ee->Fill((theGsfEle[j]).parentSuperCluster()->phiWidth()); + pf_scshh_ee->Fill(gsfEle.parentSuperCluster()->etaWidth()); + pf_scsff_ee->Fill(gsfEle.parentSuperCluster()->phiWidth()); } } - eg_e1x5_all->Fill(theGsfEle[j].e1x5()); - eg_sihih_all->Fill(theGsfEle[j].sigmaIetaIeta()); - eg_r9_all->Fill(theGsfEle[j].r9()); - eg_scshh_all->Fill((theGsfEle[j]).superCluster()->etaWidth()); - eg_scsff_all->Fill((theGsfEle[j]).superCluster()->phiWidth()); + eg_e1x5_all->Fill(gsfEle.e1x5()); + eg_sihih_all->Fill(gsfEle.sigmaIetaIeta()); + eg_r9_all->Fill(gsfEle.r9()); + eg_scshh_all->Fill(gsfEle.superCluster()->etaWidth()); + eg_scsff_all->Fill(gsfEle.superCluster()->phiWidth()); if (std::abs(etareco) < 1.479) { - eg_e1x5_eb->Fill(theGsfEle[j].e1x5()); - eg_sihih_eb->Fill(theGsfEle[j].sigmaIetaIeta()); - eg_r9_eb->Fill(theGsfEle[j].r9()); - eg_scshh_eb->Fill((theGsfEle[j]).superCluster()->etaWidth()); - eg_scsff_eb->Fill((theGsfEle[j]).superCluster()->phiWidth()); + eg_e1x5_eb->Fill(gsfEle.e1x5()); + eg_sihih_eb->Fill(gsfEle.sigmaIetaIeta()); + eg_r9_eb->Fill(gsfEle.r9()); + eg_scshh_eb->Fill(gsfEle.superCluster()->etaWidth()); + eg_scsff_eb->Fill(gsfEle.superCluster()->phiWidth()); } if (std::abs(etareco) >= 1.479) { - eg_e1x5_ee->Fill(theGsfEle[j].e1x5()); - eg_sihih_ee->Fill(theGsfEle[j].sigmaIetaIeta()); - eg_r9_ee->Fill(theGsfEle[j].r9()); - eg_scshh_ee->Fill((theGsfEle[j]).superCluster()->etaWidth()); - eg_scsff_ee->Fill((theGsfEle[j]).superCluster()->phiWidth()); + eg_e1x5_ee->Fill(gsfEle.e1x5()); + eg_sihih_ee->Fill(gsfEle.sigmaIetaIeta()); + eg_r9_ee->Fill(gsfEle.r9()); + eg_scshh_ee->Fill(gsfEle.superCluster()->etaWidth()); + eg_scsff_ee->Fill(gsfEle.superCluster()->phiWidth()); } MindREG = dR; @@ -480,26 +468,26 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS bool isGedEgTrDr = false; bool isGedEgEcDr = false; - for (uint j = 0; j < theGedEle.size(); j++) { - reco::GsfTrackRef egGsfTrackRef = (theGedEle[j]).gsfTrack(); - float etareco = theGedEle[j].eta(); - float phireco = theGedEle[j].phi(); - float pfmva = theGedEle[j].mva_e_pi(); + for (const auto &gedEle : theGedEle) { + reco::GsfTrackRef egGsfTrackRef = gedEle.gsfTrack(); + float etareco = gedEle.eta(); + float phireco = gedEle.phi(); + float pfmva = gedEle.mva_e_pi(); - reco::GsfTrackRef refGsf = theGedEle[j].gsfTrack(); + reco::GsfTrackRef refGsf = gedEle.gsfTrack(); //ElectronSeedRef seedRef= refGsf->extra()->seedRef().castTo(); float deta = etamc - etareco; float dphi = normalizedPhi(phimc - phireco); float dR = sqrt(deta * deta + dphi * dphi); - float SCEnergy = (theGedEle[j]).superCluster()->energy(); + float SCEnergy = gedEle.superCluster()->energy(); float ErecoEtrue = SCEnergy / Emc; if (dR < 0.05) { const reco::PFCandidate *matchPF = NULL; if (debug) - cout << " GED ele matched: pt " << theGedEle[j].pt() << " (" << SCEnergy / std::cosh(etareco) << ") " + cout << " GED ele matched: pt " << gedEle.pt() << " (" << SCEnergy / std::cosh(etareco) << ") " << " eta,phi " << etareco << ", " << phireco << " pfmva " << pfmva << endl; for (unsigned k = 0; k < candidates.size(); ++k) { @@ -539,7 +527,7 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS << ", " << matchPF->phi() << " pfmva " << matchPF->mva_e_pi() << endl; std::cout << "GED Clusters: " << std::endl; - for( const auto& c : theGedEle[j].superCluster()->clusters() ) { + for( const auto& c : gedEle.superCluster()->clusters() ) { std::cout << " E/eta/phi : " << c->energy() << '/' << c->eta() << '/' << c->phi() << std::endl; @@ -555,24 +543,24 @@ void GsfGEDElectronAnalyzer::analyze(const edm::Event &iEvent, const edm::EventS */ } - ged_e1x5_all->Fill(theGedEle[j].e1x5()); - ged_sihih_all->Fill(theGedEle[j].sigmaIetaIeta()); - ged_r9_all->Fill(theGedEle[j].r9()); - ged_scshh_all->Fill((theGedEle[j]).superCluster()->etaWidth()); - ged_scsff_all->Fill((theGedEle[j]).superCluster()->phiWidth()); + ged_e1x5_all->Fill(gedEle.e1x5()); + ged_sihih_all->Fill(gedEle.sigmaIetaIeta()); + ged_r9_all->Fill(gedEle.r9()); + ged_scshh_all->Fill(gedEle.superCluster()->etaWidth()); + ged_scsff_all->Fill(gedEle.superCluster()->phiWidth()); if (std::abs(etareco) < 1.479) { - ged_e1x5_eb->Fill(theGedEle[j].e1x5()); - ged_sihih_eb->Fill(theGedEle[j].sigmaIetaIeta()); - ged_r9_eb->Fill(theGedEle[j].r9()); - ged_scshh_eb->Fill((theGedEle[j]).superCluster()->etaWidth()); - ged_scsff_eb->Fill((theGedEle[j]).superCluster()->phiWidth()); + ged_e1x5_eb->Fill(gedEle.e1x5()); + ged_sihih_eb->Fill(gedEle.sigmaIetaIeta()); + ged_r9_eb->Fill(gedEle.r9()); + ged_scshh_eb->Fill(gedEle.superCluster()->etaWidth()); + ged_scsff_eb->Fill(gedEle.superCluster()->phiWidth()); } if (std::abs(etareco) >= 1.479) { - ged_e1x5_ee->Fill(theGedEle[j].e1x5()); - ged_sihih_ee->Fill(theGedEle[j].sigmaIetaIeta()); - ged_r9_ee->Fill(theGedEle[j].r9()); - ged_scshh_ee->Fill((theGedEle[j]).superCluster()->etaWidth()); - ged_scsff_eb->Fill((theGedEle[j]).superCluster()->phiWidth()); + ged_e1x5_ee->Fill(gedEle.e1x5()); + ged_sihih_ee->Fill(gedEle.sigmaIetaIeta()); + ged_r9_ee->Fill(gedEle.r9()); + ged_scshh_ee->Fill(gedEle.superCluster()->etaWidth()); + ged_scsff_eb->Fill(gedEle.superCluster()->phiWidth()); } MindRGedEg = dR; diff --git a/RecoParticleFlow/PFSimProducer/plugins/ConvBremSeedProducer.cc b/RecoParticleFlow/PFSimProducer/plugins/ConvBremSeedProducer.cc index 3877f7e621c46..3f811274f9ec5 100644 --- a/RecoParticleFlow/PFSimProducer/plugins/ConvBremSeedProducer.cc +++ b/RecoParticleFlow/PFSimProducer/plugins/ConvBremSeedProducer.cc @@ -77,7 +77,12 @@ class ConvBremSeedProducer : public edm::stream::EDProducer<> { std::vector sharedHits(const std::vector > >&); - edm::ParameterSet conf_; + const edm::EDGetTokenT pfToken_; + const edm::EDGetTokenT pixelHitsToken_; + const edm::EDGetTokenT rphirecHitsToken_; + const edm::EDGetTokenT matchedrecHitsToken_; + const edm::EDGetTokenT thePfRecTrackToken_; + const GeometricSearchTracker* geomSearchTracker_; const TrackerInteractionGeometry* geometry_; const TrackerGeometry* tracker_; @@ -120,7 +125,12 @@ using namespace std; using namespace reco; ConvBremSeedProducer::ConvBremSeedProducer(const ParameterSet& iConfig) - : conf_(iConfig), + : pfToken_(consumes(iConfig.getParameter("PFClusters"))), + pixelHitsToken_(consumes(iConfig.getParameter("pixelRecHits"))), + rphirecHitsToken_(consumes(iConfig.getParameter("rphirecHits"))), + matchedrecHitsToken_( + consumes(iConfig.getParameter("matchedrecHits"))), + thePfRecTrackToken_(consumes(iConfig.getParameter("PFRecTrackLabel"))), fieldMap_(nullptr), layerMap_(56, static_cast(nullptr)), negLayerOffset_(27), @@ -131,7 +141,7 @@ ConvBremSeedProducer::ConvBremSeedProducer(const ParameterSet& iConfig) magFieldToken_beginRun_(esConsumes()), magFieldMapToken_(esConsumes()), hitBuilderToken_( - esConsumes(edm::ESInputTag("", conf_.getParameter("TTRHBuilder")))) { + esConsumes(edm::ESInputTag("", iConfig.getParameter("TTRHBuilder")))) { produces(); } @@ -143,24 +153,18 @@ void ConvBremSeedProducer::produce(Event& iEvent, const EventSetup& iSetup) { ///INPUT COLLECTIONS ///PF CLUSTERS - Handle PfC; - iEvent.getByLabel(conf_.getParameter("PFClusters"), PfC); - const PFClusterCollection& PPP = *(PfC.product()); + const auto& PPP = iEvent.get(pfToken_); ///PIXEL - Handle pixelHits; - iEvent.getByLabel(conf_.getParameter("pixelRecHits"), pixelHits); + const auto& pixelHits = iEvent.getHandle(pixelHitsToken_); ///STRIP - Handle rphirecHits; - iEvent.getByLabel(conf_.getParameter("rphirecHits"), rphirecHits); - Handle matchedrecHits; - iEvent.getByLabel(conf_.getParameter("matchedrecHits"), matchedrecHits); + const auto& rphirecHits = iEvent.getHandle(rphirecHitsToken_); + const auto& matchedrecHits = iEvent.getHandle(matchedrecHitsToken_); //GSFPFRECTRACKS - Handle thePfRecTrackCollection; - iEvent.getByLabel(conf_.getParameter("PFRecTrackLabel"), thePfRecTrackCollection); - const GsfPFRecTrackCollection PfRTkColl = *(thePfRecTrackCollection.product()); + const auto& thePfRecTrackCollection = iEvent.getHandle(thePfRecTrackToken_); + const auto& PfRTkColl = *thePfRecTrackCollection; ///OUTPUT COLLECTION auto output = std::make_unique(); diff --git a/RecoParticleFlow/PFTracking/plugins/ElectronSeedMerger.cc b/RecoParticleFlow/PFTracking/plugins/ElectronSeedMerger.cc index b1ec3132365ce..980e4f80ad318 100644 --- a/RecoParticleFlow/PFTracking/plugins/ElectronSeedMerger.cc +++ b/RecoParticleFlow/PFTracking/plugins/ElectronSeedMerger.cc @@ -18,6 +18,7 @@ class ElectronSeedMerger : public edm::global::EDProducer<> { public: explicit ElectronSeedMerger(const edm::ParameterSet&); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; @@ -30,6 +31,13 @@ using namespace edm; using namespace std; using namespace reco; +void ElectronSeedMerger::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("EcalBasedSeeds", edm::InputTag("ecalDrivenElectronSeeds")); + desc.add("TkBasedSeeds", edm::InputTag("trackerDrivenElectronSeeds:SeedsForGsf")); + descriptions.addWithDefaultLabel(desc); +} + ElectronSeedMerger::ElectronSeedMerger(const ParameterSet& iConfig) : ecalSeedToken_{consumes(iConfig.getParameter("EcalBasedSeeds"))} { edm::InputTag tkSeedLabel_ = iConfig.getParameter("TkBasedSeeds"); diff --git a/RecoParticleFlow/PFTracking/plugins/GoodSeedProducer.cc b/RecoParticleFlow/PFTracking/plugins/GoodSeedProducer.cc index 95f2ab480f955..03e90bd96d08d 100644 --- a/RecoParticleFlow/PFTracking/plugins/GoodSeedProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/GoodSeedProducer.cc @@ -76,6 +76,7 @@ class GoodSeedProducer final : public edm::stream::EDProducer("MaxEOverP", 3.0); + desc.add("Smoother", "GsfTrajectorySmoother_forPreId"); + desc.add("UseQuality", true); + desc.add("PFPSClusterLabel", {"particleFlowClusterPS"}); + desc.add("ThresholdFile", "RecoParticleFlow/PFTracking/data/Threshold.dat"); + desc.add("TMVAMethod", "BDT"); + desc.add("MaxEta", 2.4); + desc.add("EtaMap", "RecoParticleFlow/PFBlockProducer/data/resmap_ECAL_eta.dat"); + desc.add("PhiMap", "RecoParticleFlow/PFBlockProducer/data/resmap_ECAL_phi.dat"); + desc.add("PreCkfLabel", "SeedsForCkf"); + desc.add("NHitsInSeed", 3); + desc.add("Fitter", "GsfTrajectoryFitter_forPreId"); + desc.add("TTRHBuilder", "WithAngleAndTemplate"); + desc.add("PreGsfLabel", "SeedsForGsf"); + desc.add("MinEOverP", 0.3); + desc.add("Weights1", "RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat1.xml"); + desc.add("Weights2", "RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat2.xml"); + desc.add("Weights3", "RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat3.xml"); + desc.add("Weights4", "RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat4.xml"); + desc.add("Weights5", "RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat5.xml"); + desc.add("Weights6", "RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat6.xml"); + desc.add("Weights7", "RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat7.xml"); + desc.add("Weights8", "RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat8.xml"); + desc.add("Weights9", "RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat9.xml"); + desc.add("PFEcalClusterLabel", {"particleFlowClusterECAL"}); + desc.add("PFHcalClusterLabel", {"particleFlowClusterHCAL"}), + desc.add("PSThresholdFile", "RecoParticleFlow/PFTracking/data/PSThreshold.dat"); + desc.add("MinPt", 2.0); + desc.add>("TkColList", {edm::InputTag("generalTracks")}); + desc.addUntracked("UseTMVA", true); + desc.add("TrackQuality", "highPurity"); + desc.add("MaxPt", 50.0); + desc.add("ApplyIsolation", false); + desc.add("EcalStripSumE_deltaPhiOverQ_minValue", -0.1); + desc.add("EcalStripSumE_minClusEnergy", 0.1); + desc.add("EcalStripSumE_deltaEta", 0.03); + desc.add("EcalStripSumE_deltaPhiOverQ_maxValue", 0.5); + desc.add("EOverPLead_minValue", 0.95); + desc.add("HOverPLead_maxValue", 0.05); + desc.add("HcalWindow", 0.184); + desc.add("ClusterThreshold", 0.5); + desc.add("UsePreShower", false); + desc.add("PreIdLabel", "preid"); + desc.addUntracked("ProducePreId", true); + desc.addUntracked("PtThresholdSavePreId", 1.0); + desc.add("Min_dr", 0.2); + descriptions.addWithDefaultLabel(desc); +} + GoodSeedProducer::GoodSeedProducer(const ParameterSet& iConfig, const goodseedhelpers::HeavyObjectCache*) : pfTransformer_(nullptr), conf_(iConfig), diff --git a/RecoParticleFlow/PFTracking/plugins/HGCalTrackCollectionProducer.cc b/RecoParticleFlow/PFTracking/plugins/HGCalTrackCollectionProducer.cc index 99a80659987a3..f81ebcad6985d 100644 --- a/RecoParticleFlow/PFTracking/plugins/HGCalTrackCollectionProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/HGCalTrackCollectionProducer.cc @@ -39,12 +39,13 @@ class HGCalTrackCollectionProducer : public edm::stream::EDProducer<> { public: HGCalTrackCollectionProducer(const edm::ParameterSet&); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: void produce(edm::Event&, const edm::EventSetup&) override; void beginLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) override; - edm::EDGetTokenT > src_; + edm::EDGetTokenT> src_; // variables needed for copied goodPtResolution function // need to go back and figure out sensible values @@ -64,7 +65,7 @@ class HGCalTrackCollectionProducer : public edm::stream::EDProducer<> { std::array, 1> hgcGeometryTokens_; // 3 --> 1; extrapolate to hgcee only std::array hgcGeometries_; // 3 --> 1; extrapolate to hgcee only - std::array >, 1> plusSurface_, + std::array>, 1> plusSurface_, minusSurface_; // 3 --> 1; extrapolate to hgcee only std::unique_ptr mat_prop_; @@ -72,13 +73,26 @@ class HGCalTrackCollectionProducer : public edm::stream::EDProducer<> { float diskInnerRadius_; }; +void HGCalTrackCollectionProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("src", {"pfTrack"}); + desc.add("trackQuality", "highPurity"); + desc.add("useIterativeTracking", true); + desc.add>("DPtOverPtCuts_byTrackAlgo", {10.0, 10.0, 10.0, 10.0, 10.0, 5.0}); + desc.add>("NHitCuts_byTrackAlgo", {3, 3, 3, 3, 3, 3}); + edm::ParameterSetDescription pset; + pset.add("HGC_ECAL", "HGCalEESensitive"); + desc.add("hgcalGeometryNames", pset); + descriptions.add("hgcalTrackCollection", desc); +} + HGCalTrackCollectionProducer::HGCalTrackCollectionProducer(const edm::ParameterSet& iConfig) - : src_(consumes >(iConfig.getParameter("src"))), + : src_(consumes>(iConfig.getParameter("src"))), trackQuality_((iConfig.existsAs("trackQuality")) ? reco::TrackBase::qualityByName(iConfig.getParameter("trackQuality")) : reco::TrackBase::highPurity), - DPtovPtCut_(iConfig.getParameter >("DPtOverPtCuts_byTrackAlgo")), - NHitCut_(iConfig.getParameter >("NHitCuts_byTrackAlgo")), + DPtovPtCut_(iConfig.getParameter>("DPtOverPtCuts_byTrackAlgo")), + NHitCut_(iConfig.getParameter>("NHitCuts_byTrackAlgo")), useIterTracking_(iConfig.getParameter("useIterativeTracking")), magneticFieldToken_(esConsumes()), tkerGeomToken_(esConsumes()) { @@ -133,7 +147,7 @@ void HGCalTrackCollectionProducer::beginLuminosityBlock(const edm::LuminosityBlo } void HGCalTrackCollectionProducer::produce(edm::Event& evt, const edm::EventSetup& iSetup) { - edm::Handle > trackHandle; + edm::Handle> trackHandle; evt.getByToken(src_, trackHandle); const auto& tracks = *trackHandle; diff --git a/RecoParticleFlow/PFTracking/plugins/LightPFTrackProducer.cc b/RecoParticleFlow/PFTracking/plugins/LightPFTrackProducer.cc index 9608a14c76d2f..a3f7c905184c5 100644 --- a/RecoParticleFlow/PFTracking/plugins/LightPFTrackProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/LightPFTrackProducer.cc @@ -17,6 +17,8 @@ class LightPFTrackProducer : public edm::stream::EDProducer<> { ///Destructor ~LightPFTrackProducer() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: void beginRun(const edm::Run&, const edm::EventSetup&) override; void endRun(const edm::Run&, const edm::EventSetup&) override; @@ -26,7 +28,7 @@ class LightPFTrackProducer : public edm::stream::EDProducer<> { ///PFTrackTransformer PFTrackTransformer* pfTransformer_; - std::vector > tracksContainers_; + std::vector> tracksContainers_; const edm::ESGetToken magneticFieldToken_; ///TRACK QUALITY @@ -37,13 +39,22 @@ class LightPFTrackProducer : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(LightPFTrackProducer); +void LightPFTrackProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("TrackQuality", "highPurity"); + desc.add("UseQuality", true); + desc.add>( + "TkColList", {edm::InputTag("generalTracks"), edm::InputTag("secStep"), edm::InputTag("thStep")}); + descriptions.add("lightpftrack", desc); +} + using namespace std; using namespace edm; LightPFTrackProducer::LightPFTrackProducer(const ParameterSet& iConfig) : pfTransformer_(nullptr), magneticFieldToken_(esConsumes()) { produces(); - std::vector tags = iConfig.getParameter >("TkColList"); + std::vector tags = iConfig.getParameter>("TkColList"); for (unsigned int i = 0; i < tags.size(); ++i) tracksContainers_.push_back(consumes(tags[i])); diff --git a/RecoParticleFlow/PFTracking/plugins/PFConversionProducer.cc b/RecoParticleFlow/PFTracking/plugins/PFConversionProducer.cc index f0a3ad6e14cd7..14b05ccffd339 100644 --- a/RecoParticleFlow/PFTracking/plugins/PFConversionProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/PFConversionProducer.cc @@ -22,6 +22,8 @@ class PFConversionProducer : public edm::stream::EDProducer<> { ///Destructor ~PFConversionProducer() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: void beginRun(const edm::Run&, const edm::EventSetup&) override; void endRun(const edm::Run&, const edm::EventSetup&) override; @@ -41,6 +43,13 @@ class PFConversionProducer : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(PFConversionProducer); +void PFConversionProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("conversionCollection", {"allConversions", ""}); + desc.add("PrimaryVertexLabel", {"offlinePrimaryVertices"}); + descriptions.add("pfConversions", desc); +} + typedef std::multimap > BlockMap; using namespace std; using namespace edm; diff --git a/RecoParticleFlow/PFTracking/plugins/PFDisplacedTrackerVertexProducer.cc b/RecoParticleFlow/PFTracking/plugins/PFDisplacedTrackerVertexProducer.cc index ee7e1794acdc8..02b49be0a9520 100644 --- a/RecoParticleFlow/PFTracking/plugins/PFDisplacedTrackerVertexProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/PFDisplacedTrackerVertexProducer.cc @@ -16,6 +16,8 @@ class PFDisplacedTrackerVertexProducer : public edm::stream::EDProducer<> { ///Destructor ~PFDisplacedTrackerVertexProducer() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: void beginRun(const edm::Run&, const edm::EventSetup&) override; void endRun(const edm::Run&, const edm::EventSetup&) override; @@ -34,6 +36,13 @@ class PFDisplacedTrackerVertexProducer : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(PFDisplacedTrackerVertexProducer); +void PFDisplacedTrackerVertexProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("displacedTrackerVertexColl", {"particleFlowDisplacedVertex"}); + desc.add("trackColl", {"generalTracks"}); + descriptions.add("pfDisplacedTrackerVertex", desc); +} + using namespace std; using namespace edm; PFDisplacedTrackerVertexProducer::PFDisplacedTrackerVertexProducer(const ParameterSet& iConfig) diff --git a/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexCandidateProducer.cc b/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexCandidateProducer.cc index feb4d96a263ac..a2cfd529d0a7b 100644 --- a/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexCandidateProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexCandidateProducer.cc @@ -28,6 +28,7 @@ class PFDisplacedVertexCandidateProducer : public edm::stream::EDProducer<> { ~PFDisplacedVertexCandidateProducer() override; void produce(edm::Event&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: /// Reco Tracks used to spot the nuclear interactions @@ -49,6 +50,43 @@ class PFDisplacedVertexCandidateProducer : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(PFDisplacedVertexCandidateProducer); +void PFDisplacedVertexCandidateProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + // The track collection use for the fitting. May be any collection. + // The only condition is that it shall contain the hit pattern information + desc.add("trackCollection", {"generalTracks"}); + // verbosity + desc.addUntracked("verbose", false); + // Debug flag + desc.addUntracked("debug", false); + // maximum dca distance for two tracks to be linked + desc.add("dcaCut", 0.5); + // minimum distance of secondary vertex with respect to the primary + desc.add("primaryVertexCut", 1.8); + // maximum distance between the DCA Point and the inner hit of the track + // not used for the moment + desc.add("dcaPInnerHitCut", 1000.0); + // Primary vertex information used for dxy calculation + desc.add("mainVertexLabel", {"offlinePrimaryVertices", ""}); + desc.add("offlineBeamSpotLabel", {"offlineBeamSpot", ""}); + // Tracks preselection to reduce the combinatorics in PFDisplacedVertexCandidates + // this cuts are repeated then in a smarter way in the PFDisplacedVertexFinder + // be sure you are consistent between them. + { + edm::ParameterSetDescription pset; + // selection parameters for secondary tracks + pset.add("nChi2_max", 5.); + pset.add("pt_min", 0.2); + // if the tracks is not a good candidate to be a secondary (dxy cut) restrict in minimal pt + // this cut reduce drastically the combinatorics. It is very useful to reduce the + // PFDisplacedVertex timing + pset.add("pt_min_prim", 0.8); + pset.add("dxy", 0.2); + desc.add("tracksSelectorParameters", pset); + } + descriptions.add("particleFlowDisplacedVertexCandidate", desc); +} + using namespace std; using namespace edm; diff --git a/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexProducer.cc b/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexProducer.cc index 9359db8cf9150..a81d564fee85e 100644 --- a/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexProducer.cc @@ -32,6 +32,7 @@ class PFDisplacedVertexProducer : public edm::stream::EDProducer<> { ~PFDisplacedVertexProducer() override; void produce(edm::Event&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: /// Collection of DisplacedVertex Candidates used as input for @@ -58,6 +59,92 @@ class PFDisplacedVertexProducer : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(PFDisplacedVertexProducer); +void PFDisplacedVertexProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("vertexCandidatesLabel", {"particleFlowDisplacedVertexCandidate"}); + // verbosity + desc.addUntracked("verbose", false); + // Debug flag + desc.addUntracked("debug", false); + // maximum transverse distance between two points to be used in Seed + desc.add("transvSize", 1.0); + // maximum longitudinal distance between two points to be used in Seed + desc.add("longSize", 5); + // minimal radius below which we do not reconstruct interactions + // typically the position of the first Pixel layer or beam pipe + desc.add("primaryVertexCut", 1.8); + // radius below which we don't wamt to reconstruct displaced + // vertices + desc.add("tobCut", 100); + // z below which we don't want to reconstruct displaced + // vertices + desc.add("tecCut", 220); + // the minimal accepted weight for the tracks calculated in the + // adaptive vertex fitter to be associated to the displaced vertex + // this correspond to the sigmacut of 6 + desc.add("minAdaptWeight", 0.5); + // this flag is designed to reduce the timing of the algorithm in the high pile-up conditions. 2 tracks + // vertices are the most sensitives to the pile-ups. + desc.addUntracked("switchOff2TrackVertex", true); + // ------------ Paramemeters for the track selection ------------ + // Primary vertex information used for dxy calculation + desc.add("mainVertexLabel", {"offlinePrimaryVertices", ""}); + desc.add("offlineBeamSpotLabel", {"offlineBeamSpot", ""}); + // Parameters used to apply cuts + { + edm::ParameterSetDescription pset; + pset.add("bSelectTracks", true); + // If a track is high purity it is always kept + pset.add("quality", "HighPurity"); + // Following cuts are applyed to non high purity tracks + // nChi2_max and pt_min cuts are applyed to the primary and secondary tracks + pset.add("nChi2_max", 5.); + pset.add("pt_min", 0.2); + // nChi2_min applyed only to primary tracks which may be short + // remove fake pixel triplets + pset.add("nChi2_min", 0.5); + // Cuts applyed to the secondary tracks long and displaced + pset.add("dxy_min", 0.2); + pset.add("nHits_min", 6); + pset.add("nOuterHits_max", 9); + desc.add("tracksSelectorParameters", pset); + } + // ------------ Paramemeters for the vertex identification ------------ + { + edm::ParameterSetDescription pset; + pset.add("bIdentifyVertices", true); + // Minimal sum pt of secondary tracks for displaced vertices. + // Below this value we find either loopers splitted in two parts eiter + // fake vertices in forward direction + pset.add("pt_min", 0.5); + // Minimal pT and log10(P_primary/P_secondary) for primary track in kinks (Primary+Secondary) + // which are not identifier as K-+ decays + pset.add("pt_kink_min", 3.0); + pset.add("logPrimSec_min", 0.0); + // maximum absoluta value of eta for loopers + pset.add("looper_eta_max", 0.1); + // Masses cuts for selections + // CVmin K0min K0max K-min K-max Ldmin Ldmax Nuclmin_ee + pset.add>("masses", {0.050, 0.485, 0.515, 0.480, 0.520, 1.107, 1.125, 0.200}); + // Angle between the primaryVertex-secondaryVertex direction and secondary tracks direction + // this angle means that the final system shall propagate in the same direction than initial system + // all_max, CV and V0 max + pset.add>("angles", {15, 15}); + desc.add("vertexIdentifierParameters", pset); + } + // Adaptive Vertex Fitter parameters identical to the default ones except sigmacut. + // The default value is sigmacut = 3 too tight for displaced vertices + // see CMS NOTE-2008/033 for more details + { + edm::ParameterSetDescription pset; + pset.add("sigmacut", 6.); + pset.add("Tini", 256.); + pset.add("ratio", 0.25); + desc.add("avfParameters", pset); + } + descriptions.add("particleFlowDisplacedVertex", desc); +} + using namespace std; using namespace edm; diff --git a/RecoParticleFlow/PFTracking/plugins/PFElecTkProducer.cc b/RecoParticleFlow/PFTracking/plugins/PFElecTkProducer.cc index d066241913ed5..e72433298ee8d 100644 --- a/RecoParticleFlow/PFTracking/plugins/PFElecTkProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/PFElecTkProducer.cc @@ -69,6 +69,7 @@ class PFElecTkProducer final : public edm::stream::EDProducer gsfInnerMomentumCache_; }; +void PFElecTkProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("TrajInEvents", false); + desc.add("Fitter", "GsfElectronFittingSmoother"); + desc.add("ModeMomentum", true); + desc.add("applyEGSelection", false); + desc.add("applyGsfTrackCleaning", true); + desc.add("applyAlsoGsfAngularCleaning", true); + desc.add("maxDEtaGsfAngularCleaning", 0.05); + desc.add("maxDPhiBremTangGsfAngularCleaning", 0.05); + desc.add("useFifthStepForTrackerDrivenGsf", false); + desc.add("useFifthStepForEcalDrivenGsf", false); + desc.add("MaxConvBremRecoPT", 49.0); + desc.add("MinDEtaGsfSC", 0.06); + desc.add("MinDPhiGsfSC", 0.15); + desc.add("MinSCEnergy", 4.0); + desc.add("TTRHBuilder", "WithTrackAngle"); + desc.add("GsfTrackModuleLabel", {"electronGsfTracks"}); + desc.add("Propagator", "fwdElectronPropagator"); + desc.add("PFRecTrackLabel", {"pfTrack"}); + desc.add("PFEcalClusters", {"particleFlowClusterECAL"}); + desc.add("PrimaryVertexLabel", {"offlinePrimaryVertices"}); + desc.add("useConvBremFinder", true); + desc.add("PFNuclear", {"pfDisplacedTrackerVertex"}); + desc.add("PFConversions", {"pfConversions"}); + desc.add("PFV0", {"pfV0"}); + desc.add("useNuclear", false); + desc.add("useV0", false); + desc.add("useConversions", false); + desc.add("debugGsfCleaning", false); + desc.add("AbsEtaBarrelEndcapsSeparation", 1.479); + desc.add("PtLowHighSeparation", 20); + desc.add("pf_convBremFinderID_mvaCutBarrelLowPt", 0.6); + desc.add("pf_convBremFinderID_mvaCutBarrelHighPt", 0.97); + desc.add("pf_convBremFinderID_mvaCutEndcapsLowPt", 0.9); + desc.add("pf_convBremFinderID_mvaCutEndcapsHighPt", 0.995); + desc.add( + "pf_convBremFinderID_mvaWeightFileBarrelLowPt", + edm::FileInPath("RecoParticleFlow/PFTracking/data/" + "TMVAClassification_ConvBremFinder_Testetlt20absetalt1_479_BDT.weights.xml")); + desc.add( + "pf_convBremFinderID_mvaWeightFileBarrelHighPt", + edm::FileInPath("RecoParticleFlow/PFTracking/data/" + "TMVAClassification_ConvBremFinder_Testetgt20absetalt1_479_BDT.weights.xml")); + desc.add( + "pf_convBremFinderID_mvaWeightFileEndcapsLowPt", + edm::FileInPath("RecoParticleFlow/PFTracking/data/" + "TMVAClassification_ConvBremFinder_Testetlt20absetagt1_479_BDT.weights.xml")); + desc.add( + "pf_convBremFinderID_mvaWeightFileEndcapsHighPt", + edm::FileInPath("RecoParticleFlow/PFTracking/data/" + "TMVAClassification_ConvBremFinder_Testetgt20absetagt1_479_BDT.weights.xml")); + descriptions.addWithDefaultLabel(desc); +} + using namespace std; using namespace edm; using namespace reco; diff --git a/RecoParticleFlow/PFTracking/plugins/PFNuclearProducer.cc b/RecoParticleFlow/PFTracking/plugins/PFNuclearProducer.cc index 2f7221efbfd36..3206f772e713f 100644 --- a/RecoParticleFlow/PFTracking/plugins/PFNuclearProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/PFNuclearProducer.cc @@ -16,6 +16,8 @@ class PFNuclearProducer : public edm::stream::EDProducer<> { ///Destructor ~PFNuclearProducer() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: void beginRun(const edm::Run&, const edm::EventSetup&) override; void endRun(const edm::Run&, const edm::EventSetup&) override; @@ -26,7 +28,7 @@ class PFNuclearProducer : public edm::stream::EDProducer<> { ///PFTrackTransformer PFTrackTransformer* pfTransformer_; double likelihoodCut_; - std::vector > nuclearContainers_; + std::vector> nuclearContainers_; const edm::ESGetToken magneticFieldToken_; }; @@ -34,6 +36,14 @@ class PFNuclearProducer : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(PFNuclearProducer); +void PFNuclearProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + // cut on the likelihood of the nuclear interaction + desc.add("likelihoodCut", 0.1); + desc.add>("nuclearColList", {edm::InputTag("firstnuclearInteractionMaker")}); + descriptions.add("pfNuclear", desc); +} + using namespace std; using namespace edm; PFNuclearProducer::PFNuclearProducer(const ParameterSet& iConfig) @@ -41,7 +51,7 @@ PFNuclearProducer::PFNuclearProducer(const ParameterSet& iConfig) produces(); produces(); - std::vector tags = iConfig.getParameter >("nuclearColList"); + std::vector tags = iConfig.getParameter>("nuclearColList"); for (unsigned int i = 0; i < tags.size(); ++i) nuclearContainers_.push_back(consumes(tags[i])); diff --git a/RecoParticleFlow/PFTracking/plugins/PFTrackProducer.cc b/RecoParticleFlow/PFTracking/plugins/PFTrackProducer.cc index 096dc3b29bd0e..ea616e7dc993e 100644 --- a/RecoParticleFlow/PFTracking/plugins/PFTrackProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/PFTrackProducer.cc @@ -30,6 +30,8 @@ class PFTrackProducer : public edm::stream::EDProducer<> { ///Constructor explicit PFTrackProducer(const edm::ParameterSet&); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: void beginRun(const edm::Run&, const edm::EventSetup&) override; void endRun(const edm::Run&, const edm::EventSetup&) override; @@ -57,6 +59,19 @@ class PFTrackProducer : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(PFTrackProducer); +void PFTrackProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("TrackQuality", "highPurity"); + desc.add("UseQuality", true); + desc.add("GsfTrackModuleLabel", {"electronGsfTracks"}); + desc.add>("TkColList", {edm::InputTag("generalTracks")}); + desc.add("PrimaryVertexLabel", {"offlinePrimaryVertices"}); + desc.add("MuColl", {"muons1stStep"}); + desc.add("TrajInEvents", false); + desc.add("GsfTracksInEvents", true); + descriptions.add("pfTrack", desc); +} + using namespace std; using namespace edm; using namespace reco; diff --git a/RecoParticleFlow/PFTracking/plugins/PFV0Producer.cc b/RecoParticleFlow/PFTracking/plugins/PFV0Producer.cc index 3489c4d8e1043..24cfe708ed31f 100644 --- a/RecoParticleFlow/PFTracking/plugins/PFV0Producer.cc +++ b/RecoParticleFlow/PFTracking/plugins/PFV0Producer.cc @@ -18,6 +18,8 @@ class PFV0Producer : public edm::stream::EDProducer<> { ///Destructor ~PFV0Producer() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: void beginRun(const edm::Run&, const edm::EventSetup&) override; void endRun(const edm::Run&, const edm::EventSetup&) override; @@ -27,7 +29,7 @@ class PFV0Producer : public edm::stream::EDProducer<> { ///PFTrackTransformer PFTrackTransformer* pfTransformer_; - std::vector > V0list_; + std::vector> V0list_; const edm::ESGetToken magneticFieldToken_; }; @@ -35,6 +37,13 @@ class PFV0Producer : public edm::stream::EDProducer<> { #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(PFV0Producer); +void PFV0Producer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add>( + "V0List", {edm::InputTag("generalV0Candidates", "Kshort"), edm::InputTag("generalV0Candidates", "Lambda")}); + descriptions.add("pfV0", desc); +} + using namespace std; using namespace edm; using namespace reco; @@ -43,7 +52,7 @@ PFV0Producer::PFV0Producer(const ParameterSet& iConfig) produces(); produces(); - std::vector tags = iConfig.getParameter >("V0List"); + std::vector tags = iConfig.getParameter>("V0List"); for (unsigned int i = 0; i < tags.size(); ++i) V0list_.push_back(consumes(tags[i])); diff --git a/RecoParticleFlow/PFTracking/python/hgcalTrackCollection_cfi.py b/RecoParticleFlow/PFTracking/python/hgcalTrackCollection_cfi.py deleted file mode 100644 index 576ea498e3f12..0000000000000 --- a/RecoParticleFlow/PFTracking/python/hgcalTrackCollection_cfi.py +++ /dev/null @@ -1,16 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -hgcalTrackCollection = cms.EDProducer( - "HGCalTrackCollectionProducer", - src = cms.InputTag("pfTrack"), - trackQuality = cms.string("highPurity"), - # From GeneralTracksImporter - useIterativeTracking = cms.bool(True), - DPtOverPtCuts_byTrackAlgo = cms.vdouble(10.0,10.0,10.0,10.0,10.0,5.0), - NHitCuts_byTrackAlgo = cms.vuint32(3,3,3,3,3,3), - - # From HGCClusterizer - hgcalGeometryNames = cms.PSet( HGC_ECAL = cms.string('HGCalEESensitive'), - ), - -) diff --git a/RecoParticleFlow/PFTracking/python/lightpftrack_cfi.py b/RecoParticleFlow/PFTracking/python/lightpftrack_cfi.py deleted file mode 100644 index 5088c9dfba08e..0000000000000 --- a/RecoParticleFlow/PFTracking/python/lightpftrack_cfi.py +++ /dev/null @@ -1,9 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -lightpftrackprod = cms.EDProducer("LightPFTrackProducer", - TrackQuality = cms.string('highPurity'), - UseQuality = cms.bool(True), - TkColList = cms.VInputTag(cms.InputTag("generalTracks"), cms.InputTag("secStep"), cms.InputTag("thStep")) -) - - diff --git a/RecoParticleFlow/PFTracking/python/mergedElectronSeeds_cfi.py b/RecoParticleFlow/PFTracking/python/mergedElectronSeeds_cfi.py index e5dc112043e21..21ed35c4e02ba 100644 --- a/RecoParticleFlow/PFTracking/python/mergedElectronSeeds_cfi.py +++ b/RecoParticleFlow/PFTracking/python/mergedElectronSeeds_cfi.py @@ -1,10 +1,7 @@ import FWCore.ParameterSet.Config as cms - -electronMergedSeeds =cms.EDProducer("ElectronSeedMerger", - EcalBasedSeeds = cms.InputTag("ecalDrivenElectronSeeds"), - TkBasedSeeds = cms.InputTag("trackerDrivenElectronSeeds:SeedsForGsf") - ) +from RecoParticleFlow.PFTracking.ElectronSeedMerger import ElectronSeedMerger +electronMergedSeeds = ElectronSeedMerger() from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA pp_on_AA.toModify(electronMergedSeeds, TkBasedSeeds = '') diff --git a/RecoParticleFlow/PFTracking/python/particleFlowDisplacedVertexCandidate_cfi.py b/RecoParticleFlow/PFTracking/python/particleFlowDisplacedVertexCandidate_cfi.py deleted file mode 100644 index 149d89dd16510..0000000000000 --- a/RecoParticleFlow/PFTracking/python/particleFlowDisplacedVertexCandidate_cfi.py +++ /dev/null @@ -1,47 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -particleFlowDisplacedVertexCandidate = cms.EDProducer("PFDisplacedVertexCandidateProducer", - - - # The track collection use for the fitting. May be any collection. - # The only condition is that it shall contain the hit pattern information - trackCollection = cms.InputTag("generalTracks"), - - # verbosity - verbose = cms.untracked.bool(False), - - # Debug flag - debug = cms.untracked.bool(False), - - # maximum dca distance for two tracks to be linked - dcaCut = cms.double(0.5), - - # minimum distance of secondary vertex with respect to the primary - primaryVertexCut = cms.double(1.8), - - # maximum distance between the DCA Point and the inner hit of the track - # not used for the moment - dcaPInnerHitCut = cms.double(1000.0), - - # Primary vertex information used for dxy calculation - mainVertexLabel = cms.InputTag("offlinePrimaryVertices", ""), - offlineBeamSpotLabel = cms.InputTag("offlineBeamSpot", ""), - - # Tracks preselection to reduce the combinatorics in PFDisplacedVertexCandidates - # this cuts are repeated then in a smarter way in the PFDisplacedVertexFinder - # be sure you are consistent between them. - tracksSelectorParameters = cms.PSet( - # selection parameters for secondary tracks - nChi2_max = cms.double(5.), - pt_min = cms.double(.2), - # if the tracks is not a good candidate to be a secondary (dxy cut) restrict in minimal pt - # this cut reduce drastically the combinatorics. It is very useful to reduce the - # PFDisplacedVertex timing - pt_min_prim = cms.double(.8), - dxy = cms.double(.2), - - ) - -) - - diff --git a/RecoParticleFlow/PFTracking/python/particleFlowDisplacedVertex_cfi.py b/RecoParticleFlow/PFTracking/python/particleFlowDisplacedVertex_cfi.py deleted file mode 100644 index 15b8e0d9d0991..0000000000000 --- a/RecoParticleFlow/PFTracking/python/particleFlowDisplacedVertex_cfi.py +++ /dev/null @@ -1,99 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -particleFlowDisplacedVertex = cms.EDProducer("PFDisplacedVertexProducer", - - vertexCandidatesLabel = cms.InputTag("particleFlowDisplacedVertexCandidate"), - - # verbosity - verbose = cms.untracked.bool(False), - - # Debug flag - debug = cms.untracked.bool(False), - - # maximum transverse distance between two points to be used in Seed - transvSize = cms.double(1.0), - - # maximum longitudinal distance between two points to be used in Seed - longSize = cms.double(5), - - # minimal radius below which we do not reconstruct interactions - # typically the position of the first Pixel layer or beam pipe - primaryVertexCut = cms.double(1.8), - - # radius below which we don't wamt to reconstruct displaced - # vertices - tobCut = cms.double(100), - - # z below which we don't want to reconstruct displaced - # vertices - tecCut = cms.double(220), - - # the minimal accepted weight for the tracks calculated in the - # adaptive vertex fitter to be associated to the displaced vertex - # this correspond to the sigmacut of 6 - minAdaptWeight = cms.double(0.5), - - # this flag is designed to reduce the timing of the algorithm in the high pile-up conditions. 2 tracks - # vertices are the most sensitives to the pile-ups. - switchOff2TrackVertex = cms.untracked.bool(True), - - # ------------ Paramemeters for the track selection ------------ - - # Primary vertex information used for dxy calculation - mainVertexLabel = cms.InputTag("offlinePrimaryVertices", ""), - offlineBeamSpotLabel = cms.InputTag("offlineBeamSpot", ""), - - # Parameters used to apply cuts - tracksSelectorParameters = cms.PSet( - bSelectTracks = cms.bool(True), - # If a track is high purity it is always kept - quality = cms.string("HighPurity"), - # Following cuts are applyed to non high purity tracks - # nChi2_max and pt_min cuts are applyed to the primary and secondary tracks - nChi2_max = cms.double(5.), - pt_min = cms.double(.2), - # nChi2_min applyed only to primary tracks which may be short - # remove fake pixel triplets - nChi2_min = cms.double(.5), - # Cuts applyed to the secondary tracks long and displaced - dxy_min = cms.double(.2), - nHits_min = cms.int32(6), - nOuterHits_max = cms.int32(9) - ), - - # ------------ Paramemeters for the vertex identification ------------ - - vertexIdentifierParameters = cms.PSet( - bIdentifyVertices = cms.bool(True), - # Minimal sum pt of secondary tracks for displaced vertices. - # Below this value we find either loopers splitted in two parts eiter - # fake vertices in forward direction - pt_min = cms.double(0.5), - # Minimal pT and log10(P_primary/P_secondary) for primary track in kinks (Primary+Secondary) - # which are not identifier as K-+ decays - pt_kink_min = cms.double(3.0), - logPrimSec_min = cms.double(0.0), - # maximum absoluta value of eta for loopers - looper_eta_max = cms.double(0.1), - # Masses cuts for selections - # CVmin K0min K0max K-min K-max Ldmin Ldmax Nuclmin_ee - masses = cms.vdouble(0.050, 0.485, 0.515, 0.480, 0.520, 1.107, 1.125, 0.200), - # Angle between the primaryVertex-secondaryVertex direction and secondary tracks direction - # this angle means that the final system shall propagate in the same direction than initial system - # all_max, CV and V0 max - angles = cms.vdouble(15, 15) - ), - - # Adaptive Vertex Fitter parameters identical to the default ones except sigmacut. - # The default value is sigmacut = 3 too tight for displaced vertices - # see CMS NOTE-2008/033 for more details - avfParameters = cms.PSet( - sigmacut = cms.double(6.), - Tini = cms.double(256.), - ratio = cms.double(0.25) - ) - - -) - - diff --git a/RecoParticleFlow/PFTracking/python/pfConversions_cfi.py b/RecoParticleFlow/PFTracking/python/pfConversions_cfi.py deleted file mode 100644 index 22026802a57aa..0000000000000 --- a/RecoParticleFlow/PFTracking/python/pfConversions_cfi.py +++ /dev/null @@ -1,11 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# -# Author: M. Gouzevitch base on N. Marinelli work -# -pfConversions = cms.EDProducer("PFConversionProducer", - conversionCollection = cms.InputTag("allConversions", ""), - PrimaryVertexLabel = cms.InputTag("offlinePrimaryVertices") -) - - diff --git a/RecoParticleFlow/PFTracking/python/pfDisplacedTrackerVertex_cfi.py b/RecoParticleFlow/PFTracking/python/pfDisplacedTrackerVertex_cfi.py deleted file mode 100644 index c586624503dec..0000000000000 --- a/RecoParticleFlow/PFTracking/python/pfDisplacedTrackerVertex_cfi.py +++ /dev/null @@ -1,10 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -pfDisplacedTrackerVertex = cms.EDProducer("PFDisplacedTrackerVertexProducer", - # cut on the likelihood of the nuclear interaction - displacedTrackerVertexColl = cms.InputTag("particleFlowDisplacedVertex"), - trackColl = cms.InputTag("generalTracks") - - ) - - diff --git a/RecoParticleFlow/PFTracking/python/pfNuclear_cfi.py b/RecoParticleFlow/PFTracking/python/pfNuclear_cfi.py deleted file mode 100644 index 3f878b0d7ecd1..0000000000000 --- a/RecoParticleFlow/PFTracking/python/pfNuclear_cfi.py +++ /dev/null @@ -1,9 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -pfNuclear = cms.EDProducer("PFNuclearProducer", - # cut on the likelihood of the nuclear interaction - likelihoodCut = cms.double(0.1), - nuclearColList = cms.VInputTag(cms.InputTag("firstnuclearInteractionMaker")) - ) - - diff --git a/RecoParticleFlow/PFTracking/python/pfTrackElec_cfi.py b/RecoParticleFlow/PFTracking/python/pfTrackElec_cfi.py index 0758a3b3949eb..243e2f0132b0b 100644 --- a/RecoParticleFlow/PFTracking/python/pfTrackElec_cfi.py +++ b/RecoParticleFlow/PFTracking/python/pfTrackElec_cfi.py @@ -1,45 +1,7 @@ import FWCore.ParameterSet.Config as cms -pfTrackElec = cms.EDProducer("PFElecTkProducer", - TrajInEvents = cms.bool(False), - Fitter = cms.string('GsfElectronFittingSmoother'), - ModeMomentum = cms.bool(True), - applyEGSelection = cms.bool(False), - applyGsfTrackCleaning = cms.bool(True), - applyAlsoGsfAngularCleaning = cms.bool(True), - maxDEtaGsfAngularCleaning = cms.double(0.05), - maxDPhiBremTangGsfAngularCleaning = cms.double(0.05), - useFifthStepForTrackerDrivenGsf = cms.bool(False), - useFifthStepForEcalDrivenGsf = cms.bool(False), - MaxConvBremRecoPT = cms.double(49.0), - MinDEtaGsfSC = cms.double(0.06), - MinDPhiGsfSC = cms.double(0.15), - MinSCEnergy = cms.double(4.0), - TTRHBuilder = cms.string('WithTrackAngle'), - GsfTrackModuleLabel = cms.InputTag("electronGsfTracks"), - Propagator = cms.string('fwdElectronPropagator'), - PFRecTrackLabel = cms.InputTag("pfTrack"), - PFEcalClusters = cms.InputTag("particleFlowClusterECAL"), - PrimaryVertexLabel = cms.InputTag("offlinePrimaryVertices"), - useConvBremFinder = cms.bool(True), - PFNuclear = cms.InputTag("pfDisplacedTrackerVertex"), - PFConversions = cms.InputTag("pfConversions"), - PFV0 = cms.InputTag("pfV0"), - useNuclear = cms.bool(False), - useV0 = cms.bool(False), - useConversions = cms.bool(False), - debugGsfCleaning = cms.bool(False), - AbsEtaBarrelEndcapsSeparation = cms.double(1.479), - PtLowHighSeparation = cms.double(20), - pf_convBremFinderID_mvaCutBarrelLowPt = cms.double(0.6), - pf_convBremFinderID_mvaCutBarrelHighPt = cms.double(0.97), - pf_convBremFinderID_mvaCutEndcapsLowPt = cms.double(0.9), - pf_convBremFinderID_mvaCutEndcapsHighPt = cms.double(0.995), - pf_convBremFinderID_mvaWeightFileBarrelLowPt = cms.FileInPath('RecoParticleFlow/PFTracking/data/TMVAClassification_ConvBremFinder_Testetlt20absetalt1_479_BDT.weights.xml'), - pf_convBremFinderID_mvaWeightFileBarrelHighPt = cms.FileInPath('RecoParticleFlow/PFTracking/data/TMVAClassification_ConvBremFinder_Testetgt20absetalt1_479_BDT.weights.xml'), - pf_convBremFinderID_mvaWeightFileEndcapsLowPt = cms.FileInPath('RecoParticleFlow/PFTracking/data/TMVAClassification_ConvBremFinder_Testetlt20absetagt1_479_BDT.weights.xml'), - pf_convBremFinderID_mvaWeightFileEndcapsHighPt = cms.FileInPath('RecoParticleFlow/PFTracking/data/TMVAClassification_ConvBremFinder_Testetgt20absetagt1_479_BDT.weights.xml') -) +from RecoParticleFlow.PFTracking.PFElecTkProducer import PFElecTkProducer +pfTrackElec = PFElecTkProducer() from Configuration.ProcessModifiers.egamma_lowPt_exclusive_cff import egamma_lowPt_exclusive egamma_lowPt_exclusive.toModify(pfTrackElec,MinSCEnergy = 1.0) diff --git a/RecoParticleFlow/PFTracking/python/pfTrack_cfi.py b/RecoParticleFlow/PFTracking/python/pfTrack_cfi.py deleted file mode 100644 index 34b5e7cace701..0000000000000 --- a/RecoParticleFlow/PFTracking/python/pfTrack_cfi.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -pfTrack = cms.EDProducer("PFTrackProducer", - TrackQuality = cms.string('highPurity'), - UseQuality = cms.bool(True), - GsfTrackModuleLabel = cms.InputTag("electronGsfTracks"), - TkColList = cms.VInputTag(cms.InputTag("generalTracks")), - PrimaryVertexLabel = cms.InputTag("offlinePrimaryVertices"), - MuColl = cms.InputTag("muons1stStep"), - TrajInEvents = cms.bool(False), - GsfTracksInEvents = cms.bool(True), -) - - diff --git a/RecoParticleFlow/PFTracking/python/pfV0_cfi.py b/RecoParticleFlow/PFTracking/python/pfV0_cfi.py deleted file mode 100644 index cae86a853d672..0000000000000 --- a/RecoParticleFlow/PFTracking/python/pfV0_cfi.py +++ /dev/null @@ -1,11 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -pfV0 = cms.EDProducer( - "PFV0Producer", - V0List = cms.VInputTag(cms.InputTag("generalV0Candidates","Kshort"), - cms.InputTag("generalV0Candidates","Lambda") - ) - -) - - diff --git a/RecoParticleFlow/PFTracking/python/trackerDrivenElectronSeeds_cfi.py b/RecoParticleFlow/PFTracking/python/trackerDrivenElectronSeeds_cfi.py index cdb6bdbf4357a..2049d8b9eee1c 100644 --- a/RecoParticleFlow/PFTracking/python/trackerDrivenElectronSeeds_cfi.py +++ b/RecoParticleFlow/PFTracking/python/trackerDrivenElectronSeeds_cfi.py @@ -1,53 +1,7 @@ import FWCore.ParameterSet.Config as cms -trackerDrivenElectronSeeds = cms.EDProducer("GoodSeedProducer", - MaxEOverP = cms.double(3.0), - Smoother = cms.string('GsfTrajectorySmoother_forPreId'), - UseQuality = cms.bool(True), - PFPSClusterLabel = cms.InputTag("particleFlowClusterPS"), - ThresholdFile = cms.string('RecoParticleFlow/PFTracking/data/Threshold.dat'), - TMVAMethod = cms.string('BDT'), - MaxEta = cms.double(2.4), - EtaMap = cms.string('RecoParticleFlow/PFBlockProducer/data/resmap_ECAL_eta.dat'), - PhiMap = cms.string('RecoParticleFlow/PFBlockProducer/data/resmap_ECAL_phi.dat'), - PreCkfLabel = cms.string('SeedsForCkf'), - NHitsInSeed = cms.int32(3), - Fitter = cms.string('GsfTrajectoryFitter_forPreId'), - TTRHBuilder = cms.string('WithAngleAndTemplate'), - PreGsfLabel = cms.string('SeedsForGsf'), - MinEOverP = cms.double(0.3), - Weights1 = cms.string('RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat1.xml'), - Weights2 = cms.string('RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat2.xml'), - Weights3 = cms.string('RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat3.xml'), - Weights4 = cms.string('RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat4.xml'), - Weights5 = cms.string('RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat5.xml'), - Weights6 = cms.string('RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat6.xml'), - Weights7 = cms.string('RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat7.xml'), - Weights8 = cms.string('RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat8.xml'), - Weights9 = cms.string('RecoParticleFlow/PFTracking/data/MVA_BDTTrackDrivenSeed_cat9.xml'), - PFEcalClusterLabel = cms.InputTag("particleFlowClusterECAL"), - PFHcalClusterLabel = cms.InputTag("particleFlowClusterHCAL"), - PSThresholdFile = cms.string('RecoParticleFlow/PFTracking/data/PSThreshold.dat'), - MinPt = cms.double(2.0), - TkColList = cms.VInputTag(cms.InputTag("generalTracks")), - UseTMVA = cms.untracked.bool(True), - TrackQuality = cms.string('highPurity'), - MaxPt = cms.double(50.0), - ApplyIsolation = cms.bool(False), - EcalStripSumE_deltaPhiOverQ_minValue = cms.double(-0.1), - EcalStripSumE_minClusEnergy = cms.double(0.1), - EcalStripSumE_deltaEta = cms.double(0.03), - EcalStripSumE_deltaPhiOverQ_maxValue = cms.double(0.5), - EOverPLead_minValue = cms.double(0.95), - HOverPLead_maxValue = cms.double(0.05), - HcalWindow=cms.double(0.184), - ClusterThreshold = cms.double(0.5), - UsePreShower =cms.bool(False), - PreIdLabel = cms.string('preid'), - ProducePreId = cms.untracked.bool(True), - PtThresholdSavePreId = cms.untracked.double(1.0), - Min_dr = cms.double(0.2) -) +from RecoParticleFlow.PFTracking.GoodSeedProducer import GoodSeedProducer +trackerDrivenElectronSeeds = GoodSeedProducer() from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA From 7b347075fc302cd09d3a2c157957d2f57fb8eb63 Mon Sep 17 00:00:00 2001 From: Andre Govinda Stahl Leiton Date: Thu, 13 Jun 2024 17:32:26 +0200 Subject: [PATCH 2/7] Fixed issue and implemented comments --- RecoParticleFlow/Configuration/python/HepMCCopy_cfi.py | 2 +- RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc | 1 + RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py | 2 +- RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py | 2 +- RecoParticleFlow/PFTracking/python/mergedElectronSeeds_cfi.py | 2 +- RecoParticleFlow/PFTracking/python/pfTrackElec_cfi.py | 2 +- .../PFTracking/python/trackerDrivenElectronSeeds_cfi.py | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/RecoParticleFlow/Configuration/python/HepMCCopy_cfi.py b/RecoParticleFlow/Configuration/python/HepMCCopy_cfi.py index 8fecb461b2a5e..a369cdc70e9f2 100644 --- a/RecoParticleFlow/Configuration/python/HepMCCopy_cfi.py +++ b/RecoParticleFlow/Configuration/python/HepMCCopy_cfi.py @@ -1,4 +1,4 @@ import FWCore.ParameterSet.Config as cms -from RecoParticleFlow.Configuration.HepMCCopy import HepMCCopy +from RecoParticleFlow.Configuration.modules import HepMCCopy generator = HepMCCopy() diff --git a/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc b/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc index f5c8fae8c0413..6c36d237bd631 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc @@ -347,6 +347,7 @@ void PFBlockProducer::fillDescriptions(edm::ConfigurationDescriptions& descripti psd.addOptional("SuperClusterMatchByRef", false); desc.addVPSet("linkDefinitions", psd, vpset); } + desc.addOptional("useNuclear", false); descriptions.addWithDefaultLabel(desc); } diff --git a/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py b/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py index cba8b0c709209..f0d7794697258 100644 --- a/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py +++ b/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -from RecoParticleFlow.PFProducer.PFBlockProducer import PFBlockProducer +from RecoParticleFlow.PFProducer.modules import PFBlockProducer particleFlowBlock = PFBlockProducer() for imp in particleFlowBlock.elementImporters: diff --git a/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py b/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py index 5ce30e7a85e43..9d61ee2d58de0 100644 --- a/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py +++ b/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms from RecoParticleFlow.PFProducer.pfElectronTranslatorMVACut_cfi import * -from RecoParticleFlow.PFProducer.PFElectronTranslator import PFElectronTranslator +from RecoParticleFlow.PFProducer.modules import PFElectronTranslator pfElectronTranslator = PFElectronTranslator().clone(MVACutBlock = cms.PSet(pfElecMva)) diff --git a/RecoParticleFlow/PFTracking/python/mergedElectronSeeds_cfi.py b/RecoParticleFlow/PFTracking/python/mergedElectronSeeds_cfi.py index 21ed35c4e02ba..a77ba4f03fec1 100644 --- a/RecoParticleFlow/PFTracking/python/mergedElectronSeeds_cfi.py +++ b/RecoParticleFlow/PFTracking/python/mergedElectronSeeds_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -from RecoParticleFlow.PFTracking.ElectronSeedMerger import ElectronSeedMerger +from RecoParticleFlow.PFTracking.modules import ElectronSeedMerger electronMergedSeeds = ElectronSeedMerger() from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA diff --git a/RecoParticleFlow/PFTracking/python/pfTrackElec_cfi.py b/RecoParticleFlow/PFTracking/python/pfTrackElec_cfi.py index 243e2f0132b0b..c64d90ffc8ac2 100644 --- a/RecoParticleFlow/PFTracking/python/pfTrackElec_cfi.py +++ b/RecoParticleFlow/PFTracking/python/pfTrackElec_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -from RecoParticleFlow.PFTracking.PFElecTkProducer import PFElecTkProducer +from RecoParticleFlow.PFTracking.modules import PFElecTkProducer pfTrackElec = PFElecTkProducer() from Configuration.ProcessModifiers.egamma_lowPt_exclusive_cff import egamma_lowPt_exclusive diff --git a/RecoParticleFlow/PFTracking/python/trackerDrivenElectronSeeds_cfi.py b/RecoParticleFlow/PFTracking/python/trackerDrivenElectronSeeds_cfi.py index 2049d8b9eee1c..9da394aede2b1 100644 --- a/RecoParticleFlow/PFTracking/python/trackerDrivenElectronSeeds_cfi.py +++ b/RecoParticleFlow/PFTracking/python/trackerDrivenElectronSeeds_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -from RecoParticleFlow.PFTracking.GoodSeedProducer import GoodSeedProducer +from RecoParticleFlow.PFTracking.modules import GoodSeedProducer trackerDrivenElectronSeeds = GoodSeedProducer() from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 From 50d3e5865bc74020f452a19bf4e852a689bfd4fe Mon Sep 17 00:00:00 2001 From: Andre Govinda Stahl Leiton Date: Sat, 15 Jun 2024 08:39:04 +0200 Subject: [PATCH 3/7] Remove exists and fix fill descriptions --- ...eFlowClusterECALUncorrectedL1Seeded_cfi.py | 8 ++- ...eFlowClusterECALUncorrectedUnseeded_cfi.py | 8 ++- .../modules/hltParticleFlowClusterHBHE_cfi.py | 9 ++- .../modules/hltParticleFlowClusterHCAL_cfi.py | 5 +- .../particleFlowClusterECALUncorrected_cfi.py | 8 ++- .../modules/particleFlowClusterHF_cfi.py | 11 +++- .../modules/particleFlowClusterHO_cfi.py | 11 +++- .../python/customizeHLTforCMSSW.py | 57 +++++++++++++++++++ .../python/RecoParticleFlow_cff.py | 3 - .../interface/HGCRecHitNavigator.h | 15 +++-- .../interface/PFClusterBuilderBase.h | 4 +- .../plugins/Basic2DGenericPFlowClusterizer.cc | 8 +-- .../Basic2DGenericPFlowPositionCalc.cc | 25 ++++---- .../ECAL2DPositionCalcWithDepthCorr.cc | 5 +- .../plugins/LegacyPFClusterProducer.cc | 17 ++++-- .../plugins/PFClusterProducer.cc | 5 +- .../plugins/PFMultiDepthClusterProducer.cc | 3 + .../plugins/PFMultiDepthClusterizer.cc | 4 +- .../plugins/PFlow2DClusterizerWithTime.cc | 22 ++++--- .../particleFlowClusterECALUncorrected_cfi.py | 4 +- .../python/particleFlowClusterHBHE_cfi.py | 10 +++- .../python/particleFlowClusterHCAL_cfi.py | 5 +- .../python/particleFlowClusterHF_cfi.py | 6 +- .../python/particleFlowClusterHO_cfi.py | 6 +- .../python/particleFlowClusterPS_cfi.py | 7 ++- .../PFProducer/interface/PFCandConnector.h | 43 ++------------ .../PFProducer/plugins/PFBlockProducer.cc | 2 +- .../plugins/PFElectronTranslator.cc | 11 ++-- .../PFProducer/plugins/PFProducer.cc | 7 +-- .../plugins/importers/TrackTimingImporter.cc | 2 +- .../python/particleFlowBlock_cfi.py | 2 + .../PFProducer/python/simPFProducer_cff.py | 3 + .../test/PFRecHitProducerTest.cc | 5 +- .../PFSimProducer/plugins/SimPFProducer.cc | 6 +- .../plugins/HGCalTrackCollectionProducer.cc | 4 +- .../fastSimWithDisplacedVertexFinder_cfg.py | 1 - 36 files changed, 215 insertions(+), 137 deletions(-) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedL1Seeded_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedL1Seeded_cfi.py index 4978081125065..36bf37e658224 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedL1Seeded_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedL1Seeded_cfi.py @@ -25,6 +25,7 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(-1), @@ -54,6 +55,7 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(9), @@ -84,7 +86,8 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0) + minFractionInCalc = cms.double(0.0), + timeResolutionCalc = cms.PSet() ), recHitEnergyNorms = cms.VPSet( cms.PSet( @@ -107,7 +110,8 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0) + minFractionInCalc = cms.double(0.0), + timeResolutionCalc = cms.PSet() ), recHitCleaners = cms.VPSet(), recHitsSource = cms.InputTag("hltParticleFlowRecHitECALL1Seeded"), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedUnseeded_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedUnseeded_cfi.py index 112d8ffd0e6db..89aef3ee04b7c 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedUnseeded_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedUnseeded_cfi.py @@ -25,6 +25,7 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(-1), @@ -54,6 +55,7 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(9), @@ -84,7 +86,8 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0) + minFractionInCalc = cms.double(0.0), + timeResolutionCalc = cms.PSet() ), recHitEnergyNorms = cms.VPSet( cms.PSet( @@ -107,7 +110,8 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0) + minFractionInCalc = cms.double(0.0), + timeResolutionCalc = cms.PSet() ), recHitCleaners = cms.VPSet(), recHitsSource = cms.InputTag("hltParticleFlowRecHitECALUnseeded"), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py index 552b0472cff12..256a644ca1ed9 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py @@ -55,7 +55,9 @@ ), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(-1) + posCalcNCrystals = cms.int32(-1), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ), clusterTimeResFromSeed = cms.bool(False), excludeOtherSeeds = cms.bool(True), @@ -86,8 +88,11 @@ ), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(5) + posCalcNCrystals = cms.int32(5), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ), + positionCalcForConvergence = cms.PSet(), recHitEnergyNorms = cms.VPSet( cms.PSet( depths = cms.vint32(1, 2, 3, 4), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHCAL_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHCAL_cfi.py index 0dc128be8a605..fd30e7f3f0af7 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHCAL_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHCAL_cfi.py @@ -29,8 +29,11 @@ ), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(-1) + posCalcNCrystals = cms.int32(-1), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ), + positionCalc = cms.PSet(), minFractionToKeep = cms.double(1e-07), nSigmaEta = cms.double(2.0), nSigmaPhi = cms.double(2.0) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterECALUncorrected_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterECALUncorrected_cfi.py index 1ca6e4675d1af..37b0519a8a59b 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterECALUncorrected_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterECALUncorrected_cfi.py @@ -25,6 +25,7 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(-1), @@ -54,6 +55,7 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(9), @@ -84,7 +86,8 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0) + minFractionInCalc = cms.double(0.0), + timeResolutionCalc = cms.PSet() ), recHitEnergyNorms = cms.VPSet( cms.PSet( @@ -107,7 +110,8 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0) + minFractionInCalc = cms.double(0.0), + timeResolutionCalc = cms.PSet() ), recHitCleaners = cms.VPSet(), recHitsSource = cms.InputTag("particleFlowRecHitECAL"), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHF_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHF_cfi.py index d6a428f93dbee..b4a1fadcd84a6 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHF_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHF_cfi.py @@ -25,9 +25,12 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.8), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(-1) + posCalcNCrystals = cms.int32(-1), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ), excludeOtherSeeds = cms.bool(True), maxIterations = cms.uint32(50), @@ -36,10 +39,14 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.8), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(5) + posCalcNCrystals = cms.int32(5), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ), + positionCalcForConvergence = cms.PSet(), recHitEnergyNorms = cms.VPSet( cms.PSet( detector = cms.string('HF_EM'), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHO_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHO_cfi.py index 9a76156e662b6..ddfafe0894c3b 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHO_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHO_cfi.py @@ -25,9 +25,12 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.05), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(-1) + posCalcNCrystals = cms.int32(-1), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ), excludeOtherSeeds = cms.bool(True), maxIterations = cms.uint32(50), @@ -36,10 +39,14 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.05), + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(5) + posCalcNCrystals = cms.int32(5), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ), + positionCalcForConvergence = cms.PSet(), recHitEnergyNorms = cms.VPSet( cms.PSet( detector = cms.string('HCAL_BARREL2_RING0'), diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 86a58c7de66d2..17dbd06fe4ac8 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -314,6 +314,62 @@ def customizeHLTfor45063(process): delattr(prod,"mvaScaleStdEL2") return process + +def customizeHLTfor45212(process): + # Add missing parameters for Basic2DGenericPFlowPositionCalc + for p in ["PFClusterProducer", "LegacyPFClusterProducer", "PFMultiDepthClusterProducer"]: + for prod in producers_by_type(process, p): + if hasattr(prod, "pfClusterBuilder"): + for n in ["positionCalc", "allCellsPositionCalc"]: + if hasattr(prod.pfClusterBuilder, n) and hasattr(getattr(prod.pfClusterBuilder, n), "algoName") and (getattr(prod.pfClusterBuilder, n).algoName == "Basic2DGenericPFlowPositionCalc"): + if not hasattr(getattr(prod.pfClusterBuilder, n), "logWeightDenominatorByDetector"): + getattr(prod.pfClusterBuilder, n).logWeightDenominatorByDetector = cms.VPSet() + if not hasattr(getattr(prod.pfClusterBuilder, n), "timeResolutionCalcBarrel"): + getattr(prod.pfClusterBuilder, n).timeResolutionCalcBarrel = cms.PSet() + if not hasattr(getattr(prod.pfClusterBuilder, n), "timeResolutionCalcEndcap"): + getattr(prod.pfClusterBuilder, n).timeResolutionCalcEndcap = cms.PSet() + + # Add missing parameters for ECAL2DPositionCalcWithDepthCorr + for prod in producers_by_type(process, 'PFClusterProducer'): + if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, "positionCalcForConvergence") and hasattr(prod.pfClusterBuilder.positionCalcForConvergence, "algoName") and (prod.pfClusterBuilder.positionCalcForConvergence.algoName == "ECAL2DPositionCalcWithDepthCorr"): + if not hasattr(prod.pfClusterBuilder.positionCalcForConvergence, "timeResolutionCalc"): + prod.pfClusterBuilder.positionCalcForConvergence.timeResolutionCalc = cms.PSet() + if hasattr(prod, "positionReCalc") and hasattr(prod.positionReCalc, "algoName") and (prod.positionReCalc.algoName == "ECAL2DPositionCalcWithDepthCorr"): + if not hasattr(prod.positionReCalc, "timeResolutionCalc"): + prod.positionReCalc.timeResolutionCalc = cms.PSet() + + # Add missing parameters for Basic2DGenericPFlowClusterizer + for p in ["PFClusterProducer", "LegacyPFClusterProducer"]: + for prod in producers_by_type(process, p): + if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, "algoName") and (prod.pfClusterBuilder.algoName == "Basic2DGenericPFlowClusterizer"): + if not hasattr(prod.pfClusterBuilder, "positionCalc"): + prod.pfClusterBuilder.positionCalc = cms.PSet() + if not hasattr(prod.pfClusterBuilder, "allCellsPositionCalc"): + prod.pfClusterBuilder.allCellsPositionCalc = cms.PSet() + if not hasattr(prod.pfClusterBuilder, "positionCalcForConvergence"): + prod.pfClusterBuilder.positionCalcForConvergence = cms.PSet() + + # Add missing parameters for PFMultiDepthClusterizer + for prod in producers_by_type(process, 'PFMultiDepthClusterProducer'): + if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, "algoName") and (prod.pfClusterBuilder.algoName == "PFMultiDepthClusterizer"): + if not hasattr(prod.pfClusterBuilder, "positionCalc"): + prod.pfClusterBuilder.positionCalc = cms.PSet() + if not hasattr(prod.pfClusterBuilder, "allCellsPositionCalc"): + prod.pfClusterBuilder.allCellsPositionCalc = cms.PSet() + + # Add missing parameters for PFCandConnector + for prod in producers_by_type(process, 'PFProducer'): + if hasattr(prod, "iCfgCandConnector"): + if not hasattr(prod.iCfgCandConnector, "dptRel_PrimaryTrack"): + prod.iCfgCandConnector.dptRel_PrimaryTrack = cms.double(0) + if not hasattr(prod.iCfgCandConnector, "dptRel_MergedTrack"): + prod.iCfgCandConnector.dptRel_MergedTrack = cms.double(0) + if not hasattr(prod.iCfgCandConnector, "ptErrorSecondary"): + prod.iCfgCandConnector.ptErrorSecondary = cms.double(0) + if not hasattr(prod.iCfgCandConnector, "nuclCalibFactors"): + prod.iCfgCandConnector.nuclCalibFactors = cms.vdouble() + + return process # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): @@ -326,5 +382,6 @@ def customizeHLTforCMSSW(process, menuType="GRun"): process = checkHLTfor43774(process) process = customizeHLTfor44576(process) process = customizeHLTfor45063(process) + process = customizeHLTfor45212(process) return process diff --git a/RecoParticleFlow/Configuration/python/RecoParticleFlow_cff.py b/RecoParticleFlow/Configuration/python/RecoParticleFlow_cff.py index 2fc9927e8d85a..9a771cbbde265 100644 --- a/RecoParticleFlow/Configuration/python/RecoParticleFlow_cff.py +++ b/RecoParticleFlow/Configuration/python/RecoParticleFlow_cff.py @@ -94,9 +94,6 @@ pt_min_prim = 999999.0, dxy = 999999.0) ) - - e.toModify(particleFlowBlock, useNuclear = cms.bool(False)) - e.toModify(pfNoPileUpIso, enable = False) e.toModify(pfPileUpIso, enable = False) e.toModify(pfNoPileUp, enable = False) diff --git a/RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h b/RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h index 95f6293afd174..fa00c1f46624b 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h +++ b/RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h @@ -43,18 +43,21 @@ class HGCRecHitNavigator : public PFRecHitNavigatorBase { } HGCRecHitNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc) { - if (iConfig.exists("hgcee")) { - eeNav_ = new hgcee(iConfig.getParameter("hgcee"), cc); + const auto& pset_hgcee = iConfig.getParameter("hgcee"); + if (!pset_hgcee.empty()) { + eeNav_ = new hgcee(pset_hgcee, cc); } else { eeNav_ = nullptr; } - if (iConfig.exists("hgchef")) { - hefNav_ = new hgchef(iConfig.getParameter("hgchef"), cc); + const auto& pset_hgchef = iConfig.getParameter("hgchef"); + if (!pset_hgchef.empty()) { + hefNav_ = new hgchef(pset_hgchef, cc); } else { hefNav_ = nullptr; } - if (iConfig.exists("hgcheb")) { - hebNav_ = new hgcheb(iConfig.getParameter("hgcheb"), cc); + const auto& pset_hgcheb = iConfig.getParameter("hgcheb"); + if (!pset_hgcheb.empty()) { + hebNav_ = new hgcheb(pset_hgcheb, cc); } else { hebNav_ = nullptr; } diff --git a/RecoParticleFlow/PFClusterProducer/interface/PFClusterBuilderBase.h b/RecoParticleFlow/PFClusterProducer/interface/PFClusterBuilderBase.h index 2ca93bb66e3bf..5231c41eccc66 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/PFClusterBuilderBase.h +++ b/RecoParticleFlow/PFClusterProducer/interface/PFClusterBuilderBase.h @@ -28,8 +28,8 @@ class PFClusterBuilderBase { _nClustersFound(0), _minFractionToKeep(conf.getParameter("minFractionToKeep")), _algoName(conf.getParameter("algoName")) { - if (conf.exists("positionCalc")) { - const edm::ParameterSet& pcConf = conf.getParameterSet("positionCalc"); + const auto& pcConf = conf.getParameterSet("positionCalc"); + if (!pcConf.empty()) { const std::string& algo = pcConf.getParameter("algoName"); _positionCalc = PFCPositionCalculatorFactory::get()->create(algo, pcConf, cc); } diff --git a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc index 7b6f95d4d5208..c8c4e632c9936 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc @@ -125,14 +125,14 @@ Basic2DGenericPFlowClusterizer::Basic2DGenericPFlowClusterizer(const edm::Parame _recHitEnergyNorms.emplace(_layerMap.find(det)->second, std::make_pair(depths, rhE_norm)); } - if (conf.exists("allCellsPositionCalc")) { - const edm::ParameterSet& acConf = conf.getParameterSet("allCellsPositionCalc"); + const auto& acConf = conf.getParameterSet("allCellsPositionCalc"); + if (!acConf.empty()) { const std::string& algoac = acConf.getParameter("algoName"); _allCellsPosCalc = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); } // if necessary a third pos calc for convergence testing - if (conf.exists("positionCalcForConvergence")) { - const edm::ParameterSet& convConf = conf.getParameterSet("positionCalcForConvergence"); + const auto& convConf = conf.getParameterSet("positionCalcForConvergence"); + if (!convConf.empty()) { const std::string& algoconv = convConf.getParameter("algoName"); _convergencePosCalc = PFCPositionCalculatorFactory::get()->create(algoconv, convConf, cc); } diff --git a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowPositionCalc.cc b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowPositionCalc.cc index 177c5f812122f..5a77e194f0c41 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowPositionCalc.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowPositionCalc.cc @@ -29,17 +29,14 @@ class Basic2DGenericPFlowPositionCalc : public PFCPositionCalculatorBase { std::vector logWeightDenom; std::vector logWeightDenomInv; - if (conf.exists("logWeightDenominatorByDetector")) { - const std::vector& logWeightDenominatorByDetectorPSet = - conf.getParameterSetVector("logWeightDenominatorByDetector"); - + const auto& logWeightDenominatorByDetectorPSet = conf.getParameterSetVector("logWeightDenominatorByDetector"); + if (!logWeightDenominatorByDetectorPSet.empty()) { for (const auto& pset : logWeightDenominatorByDetectorPSet) { - if (!pset.exists("detector")) { + const auto& det = pset.getParameter("detector"); + if (det.empty()) { throw cms::Exception("logWeightDenominatorByDetectorPSet") << "logWeightDenominator : detector not specified"; } - const std::string& det = pset.getParameter("detector"); - if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) { std::vector depthsT = pset.getParameter >("depths"); std::vector logWeightDenomT = pset.getParameter >("logWeightDenominator"); @@ -70,15 +67,13 @@ class Basic2DGenericPFlowPositionCalc : public PFCPositionCalculatorBase { _logWeightDenom = std::make_tuple(detectorEnum, depths, logWeightDenomInv); _timeResolutionCalcBarrel.reset(nullptr); - if (conf.exists("timeResolutionCalcBarrel")) { - const edm::ParameterSet& timeResConf = conf.getParameterSet("timeResolutionCalcBarrel"); - _timeResolutionCalcBarrel = std::make_unique(timeResConf); - } + const auto& timeResConfBarrel = conf.getParameterSet("timeResolutionCalcBarrel"); + if (!timeResConfBarrel.empty()) + _timeResolutionCalcBarrel = std::make_unique(timeResConfBarrel); _timeResolutionCalcEndcap.reset(nullptr); - if (conf.exists("timeResolutionCalcEndcap")) { - const edm::ParameterSet& timeResConf = conf.getParameterSet("timeResolutionCalcEndcap"); - _timeResolutionCalcEndcap = std::make_unique(timeResConf); - } + const auto& timeResConfEndcap = conf.getParameterSet("timeResolutionCalcEndcap"); + if (!timeResConfEndcap.empty()) + _timeResolutionCalcEndcap = std::make_unique(timeResConfEndcap); switch (_posCalcNCrystals) { case 5: diff --git a/RecoParticleFlow/PFClusterProducer/plugins/ECAL2DPositionCalcWithDepthCorr.cc b/RecoParticleFlow/PFClusterProducer/plugins/ECAL2DPositionCalcWithDepthCorr.cc index a8ba116e7e0ba..29aaac694754f 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/ECAL2DPositionCalcWithDepthCorr.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/ECAL2DPositionCalcWithDepthCorr.cc @@ -38,10 +38,9 @@ class ECAL2DPositionCalcWithDepthCorr : public PFCPositionCalculatorBase { _esMinus(false), _geomToken(cc.esConsumes()) { _timeResolutionCalc.reset(nullptr); - if (conf.exists("timeResolutionCalc")) { - const edm::ParameterSet& timeResConf = conf.getParameterSet("timeResolutionCalc"); + const auto& timeResConf = conf.getParameterSet("timeResolutionCalc"); + if (!timeResConf.empty()) _timeResolutionCalc = std::make_unique(timeResConf); - } } ECAL2DPositionCalcWithDepthCorr(const ECAL2DPositionCalcWithDepthCorr&) = delete; ECAL2DPositionCalcWithDepthCorr& operator=(const ECAL2DPositionCalcWithDepthCorr&) = delete; diff --git a/RecoParticleFlow/PFClusterProducer/plugins/LegacyPFClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/LegacyPFClusterProducer.cc index 21a589918ee1e..33701815564df 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/LegacyPFClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/LegacyPFClusterProducer.cc @@ -48,16 +48,16 @@ class LegacyPFClusterProducer : public edm::stream::EDProducer<> { //setup pf cluster builder if requested const edm::ParameterSet& pfcConf = config.getParameterSet("pfClusterBuilder"); if (!pfcConf.empty()) { - if (pfcConf.exists("positionCalc")) { - const edm::ParameterSet& acConf = pfcConf.getParameterSet("positionCalc"); + const auto& acConf = pfcConf.getParameterSet("positionCalc"); + if (!acConf.empty()) { const std::string& algoac = acConf.getParameter("algoName"); positionCalc_ = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); } - if (pfcConf.exists("allCellsPositionCalc")) { - const edm::ParameterSet& acConf = pfcConf.getParameterSet("allCellsPositionCalc"); - const std::string& algoac = acConf.getParameter("algoName"); - allCellsPositionCalc_ = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); + const auto& acConf2 = pfcConf.getParameterSet("allCellsPositionCalc"); + if (!acConf2.empty()) { + const std::string& algoac = acConf2.getParameter("algoName"); + allCellsPositionCalc_ = PFCPositionCalculatorFactory::get()->create(algoac, acConf2, cc); } } } @@ -82,6 +82,7 @@ class LegacyPFClusterProducer : public edm::stream::EDProducer<> { pfClusterBuilder.add("minChi2Prob", 0.); pfClusterBuilder.add("clusterTimeResFromSeed", false); pfClusterBuilder.add("algoName", ""); + pfClusterBuilder.add("positionCalcForConvergence", {}); { edm::ParameterSetDescription validator; validator.add("detector", ""); @@ -116,6 +117,8 @@ class LegacyPFClusterProducer : public edm::stream::EDProducer<> { bar.addVPSet("logWeightDenominatorByDetector", validator, vDefaults); } bar.add("minAllowedNormalization", 1e-9); + bar.add("timeResolutionCalcBarrel", {}); + bar.add("timeResolutionCalcEndcap", {}); pfClusterBuilder.add("positionCalc", bar); } { @@ -138,6 +141,8 @@ class LegacyPFClusterProducer : public edm::stream::EDProducer<> { bar.addVPSet("logWeightDenominatorByDetector", validator, vDefaults); } bar.add("minAllowedNormalization", 1e-9); + bar.add("timeResolutionCalcBarrel", {}); + bar.add("timeResolutionCalcEndcap", {}); pfClusterBuilder.add("allCellsPositionCalc", bar); } { diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc index c4e367c57d2e5..a3fdfe33dbed0 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc @@ -102,9 +102,8 @@ PFClusterProducer::PFClusterProducer(const edm::ParameterSet& conf) _cleaners.emplace_back(RecHitTopologicalCleanerFactory::get()->create(cleanerName, conf, cc)); } - if (conf.exists("seedCleaners")) { - const edm::VParameterSet& seedcleanerConfs = conf.getParameterSetVector("seedCleaners"); - + const auto& seedcleanerConfs = conf.getParameterSetVector("seedCleaners"); + if (!seedcleanerConfs.empty()) { for (const auto& conf : seedcleanerConfs) { const std::string& seedcleanerName = conf.getParameter("algoName"); _seedcleaners.emplace_back(RecHitTopologicalCleanerFactory::get()->create(seedcleanerName, conf, cc)); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc index f0421f24eba5a..bd6e553fce41d 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc @@ -61,8 +61,11 @@ void PFMultiDepthClusterProducer::fillDescriptions(edm::ConfigurationDescription pset1.add("minAllowedNormalization", 1e-09); pset1.add("minFractionInCalc", 1e-09); pset1.add("posCalcNCrystals", -1); + pset1.add("timeResolutionCalcBarrel", {}); + pset1.add("timeResolutionCalcEndcap", {}); pset0.add("allCellsPositionCalc", pset1); } + pset0.add("positionCalc", {}); pset0.add("minFractionToKeep", 1e-07); pset0.add("nSigmaEta", 2.0); pset0.add("nSigmaPhi", 2.0); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterizer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterizer.cc index 520b6ca867375..24bea0a22ec0c 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterizer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterizer.cc @@ -80,8 +80,8 @@ DEFINE_EDM_PLUGIN(PFClusterBuilderFactory, PFMultiDepthClusterizer, "PFMultiDept PFMultiDepthClusterizer::PFMultiDepthClusterizer(const edm::ParameterSet& conf, edm::ConsumesCollector& cc) : PFClusterBuilderBase(conf, cc) { - if (conf.exists("allCellsPositionCalc")) { - const edm::ParameterSet& acConf = conf.getParameterSet("allCellsPositionCalc"); + const auto& acConf = conf.getParameterSet("allCellsPositionCalc"); + if (!acConf.empty()) { const std::string& algoac = acConf.getParameter("algoName"); _allCellsPosCalc = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); } diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFlow2DClusterizerWithTime.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFlow2DClusterizerWithTime.cc index 97d1fa9cd718e..684f33f9e293a 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFlow2DClusterizerWithTime.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFlow2DClusterizerWithTime.cc @@ -130,25 +130,23 @@ PFlow2DClusterizerWithTime::PFlow2DClusterizerWithTime(const edm::ParameterSet& _recHitEnergyNorms.emplace(_layerMap.find(det)->second, rhE_norm); } - if (conf.exists("allCellsPositionCalc")) { - const edm::ParameterSet& acConf = conf.getParameterSet("allCellsPositionCalc"); + const auto& acConf = conf.getParameterSet("allCellsPositionCalc"); + if (!acConf.empty()) { const std::string& algoac = acConf.getParameter("algoName"); _allCellsPosCalc = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); } // if necessary a third pos calc for convergence testing - if (conf.exists("positionCalcForConvergence")) { - const edm::ParameterSet& convConf = conf.getParameterSet("positionCalcForConvergence"); + const auto& convConf = conf.getParameterSet("positionCalcForConvergence"); + if (!convConf.empty()) { const std::string& algoconv = convConf.getParameter("algoName"); _convergencePosCalc = PFCPositionCalculatorFactory::get()->create(algoconv, convConf, cc); } - if (conf.exists("timeResolutionCalcBarrel")) { - const edm::ParameterSet& timeResConf = conf.getParameterSet("timeResolutionCalcBarrel"); - _timeResolutionCalcBarrel = std::make_unique(timeResConf); - } - if (conf.exists("timeResolutionCalcEndcap")) { - const edm::ParameterSet& timeResConf = conf.getParameterSet("timeResolutionCalcEndcap"); - _timeResolutionCalcEndcap = std::make_unique(timeResConf); - } + const auto& timeResConfBarrel = conf.getParameterSet("timeResolutionCalcBarrel"); + if (!timeResConfBarrel.empty()) + _timeResolutionCalcBarrel = std::make_unique(timeResConfBarrel); + const auto& timeResConfEndcap = conf.getParameterSet("timeResolutionCalcEndcap"); + if (!timeResConfEndcap.empty()) + _timeResolutionCalcEndcap = std::make_unique(timeResConfEndcap); } void PFlow2DClusterizerWithTime::buildClusters(const reco::PFClusterCollection& input, diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALUncorrected_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALUncorrected_cfi.py index e86856d6a048b..cd5b74231d3bb 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALUncorrected_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALUncorrected_cfi.py @@ -86,6 +86,7 @@ minFractionInCalc = cms.double(1e-9), posCalcNCrystals = cms.int32(-1), logWeightDenominator = cms.double(0.08), # same as gathering threshold + logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-9), timeResolutionCalcBarrel = _timeResolutionECALBarrel, timeResolutionCalcEndcap = _timeResolutionECALEndcap, @@ -102,7 +103,8 @@ T0_EE = cms.double(3.1), T0_ES = cms.double(1.2), W0 = cms.double(4.2), - X0 = cms.double(0.89) + X0 = cms.double(0.89), + timeResolutionCalc = cms.PSet() ) # pf clustering diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py index 36b780828dbb2..d63aea725f500 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py @@ -73,7 +73,9 @@ logWeightDenominator = _thresholdsHE, ) ), - minAllowedNormalization = cms.double(1e-9) + minAllowedNormalization = cms.double(1e-9), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ), allCellsPositionCalc =cms.PSet( algoName = cms.string("Basic2DGenericPFlowPositionCalc"), @@ -89,9 +91,11 @@ logWeightDenominator = _thresholdsHE, ) ), - minAllowedNormalization = cms.double(1e-9) + minAllowedNormalization = cms.double(1e-9), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ), - + positionCalcForConvergence = cms.PSet(), timeSigmaEB = cms.double(10.), timeSigmaEE = cms.double(10.), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHCAL_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHCAL_cfi.py index ebab00eafee74..aea12920cb824 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHCAL_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHCAL_cfi.py @@ -16,6 +16,7 @@ nSigmaPhi = cms.double(2.), #pf clustering parameters minFractionToKeep = cms.double(1e-7), + positionCalc = cms.PSet(), allCellsPositionCalc = cms.PSet( algoName = cms.string("Basic2DGenericPFlowPositionCalc"), minFractionInCalc = cms.double(1e-9), @@ -30,7 +31,9 @@ logWeightDenominator = _thresholdsHE, ) ), - minAllowedNormalization = cms.double(1e-9) + minAllowedNormalization = cms.double(1e-9), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ) ), positionReCalc = cms.PSet(), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHF_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHF_cfi.py index 76aa58c69f062..6559b47839370 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHF_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHF_cfi.py @@ -72,7 +72,10 @@ minFractionInCalc = cms.double(1e-9), posCalcNCrystals = cms.int32(5), logWeightDenominator = cms.double(0.8), # same as gathering threshold - minAllowedNormalization = cms.double(1e-9) + logWeightDenominatorByDetector = cms.VPSet(), + minAllowedNormalization = cms.double(1e-9), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ) _positionCalcHF_all_nodepth = _positionCalcHF_cross_nodepth.clone( @@ -86,6 +89,7 @@ minFractionToKeep = cms.double(1e-7), positionCalc = _positionCalcHF_cross_nodepth, allCellsPositionCalc = _positionCalcHF_all_nodepth, + positionCalcForConvergence = cms.PSet(), showerSigma = cms.double(10.0), stoppingTolerance = cms.double(1e-8), maxIterations = cms.uint32(50), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHO_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHO_cfi.py index 6d1fbfc4da45d..7af2c636de8b3 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHO_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHO_cfi.py @@ -45,7 +45,10 @@ minFractionInCalc = cms.double(1e-9), posCalcNCrystals = cms.int32(5), logWeightDenominator = cms.double(0.5), # same as gathering threshold - minAllowedNormalization = cms.double(1e-9) + logWeightDenominatorByDetector = cms.VPSet(), + minAllowedNormalization = cms.double(1e-9), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ) _positionCalcHO_all_nodepth = _positionCalcHO_cross_nodepth.clone( @@ -59,6 +62,7 @@ minFractionToKeep = cms.double(1e-7), positionCalc = _positionCalcHO_cross_nodepth, allCellsPositionCalc = _positionCalcHO_all_nodepth, + positionCalcForConvergence = cms.PSet(), showerSigma = cms.double(10.0), stoppingTolerance = cms.double(1e-8), maxIterations = cms.uint32(50), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterPS_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterPS_cfi.py index d2b9c8ae2ec08..15a0b08b5180f 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterPS_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterPS_cfi.py @@ -44,7 +44,10 @@ minFractionInCalc = cms.double(1e-9), posCalcNCrystals = cms.int32(-1), logWeightDenominator = cms.double(6e-5), # same as gathering threshold - minAllowedNormalization = cms.double(1e-9) + logWeightDenominatorByDetector = cms.VPSet(), + minAllowedNormalization = cms.double(1e-9), + timeResolutionCalcBarrel = cms.PSet(), + timeResolutionCalcEndcap = cms.PSet() ) #pf clustering @@ -53,6 +56,8 @@ #pf clustering parameters minFractionToKeep = cms.double(1e-7), positionCalc = _positionCalcPS_all_nodepth, + allCellsPositionCalc = cms.PSet(), + positionCalcForConvergence = cms.PSet(), showerSigma = cms.double(0.3), stoppingTolerance = cms.double(1e-8), maxIterations = cms.uint32(50), diff --git a/RecoParticleFlow/PFProducer/interface/PFCandConnector.h b/RecoParticleFlow/PFProducer/interface/PFCandConnector.h index 580a7c034358b..44e6795d17053 100644 --- a/RecoParticleFlow/PFProducer/interface/PFCandConnector.h +++ b/RecoParticleFlow/PFProducer/interface/PFCandConnector.h @@ -28,45 +28,14 @@ class PFCandConnector { } void setParameters(const edm::ParameterSet& iCfgCandConnector) { - bool bCorrect, bCalibPrimary; - double dptRel_PrimaryTrack, dptRel_MergedTrack, ptErrorSecondary; - std::vector nuclCalibFactors; - /// Flag to apply the correction procedure for nuclear interactions - bCorrect = iCfgCandConnector.getParameter("bCorrect"); + const auto& bCorrect = iCfgCandConnector.getParameter("bCorrect"); /// Flag to calibrate the reconstructed nuclear interactions with primary or merged tracks - bCalibPrimary = iCfgCandConnector.getParameter("bCalibPrimary"); - - if (iCfgCandConnector.exists("dptRel_PrimaryTrack")) - dptRel_PrimaryTrack = iCfgCandConnector.getParameter("dptRel_PrimaryTrack"); - else { - edm::LogWarning("PFCandConnector") << "dptRel_PrimaryTrack doesn't exist. Setting a default safe value 0" - << std::endl; - dptRel_PrimaryTrack = 0; - } - - if (iCfgCandConnector.exists("dptRel_MergedTrack")) - dptRel_MergedTrack = iCfgCandConnector.getParameter("dptRel_MergedTrack"); - else { - edm::LogWarning("PFCandConnector") << "dptRel_MergedTrack doesn't exist. Setting a default safe value 0" - << std::endl; - dptRel_MergedTrack = 0; - } - - if (iCfgCandConnector.exists("ptErrorSecondary")) - ptErrorSecondary = iCfgCandConnector.getParameter("ptErrorSecondary"); - else { - edm::LogWarning("PFCandConnector") << "ptErrorSecondary doesn't exist. Setting a default safe value 0" - << std::endl; - ptErrorSecondary = 0; - } - - if (iCfgCandConnector.exists("nuclCalibFactors")) - nuclCalibFactors = iCfgCandConnector.getParameter >("nuclCalibFactors"); - else { - edm::LogWarning("PFCandConnector") << "nuclear calib factors doesn't exist the factor would not be applyed" - << std::endl; - } + const auto& bCalibPrimary = iCfgCandConnector.getParameter("bCalibPrimary"); + const auto& dptRel_PrimaryTrack = iCfgCandConnector.getParameter("dptRel_PrimaryTrack"); + const auto& dptRel_MergedTrack = iCfgCandConnector.getParameter("dptRel_MergedTrack"); + const auto& ptErrorSecondary = iCfgCandConnector.getParameter("ptErrorSecondary"); + const auto& nuclCalibFactors = iCfgCandConnector.getParameter >("nuclCalibFactors"); setParameters(bCorrect, bCalibPrimary, dptRel_PrimaryTrack, dptRel_MergedTrack, ptErrorSecondary, nuclCalibFactors); } diff --git a/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc b/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc index 6c36d237bd631..b1960ccffbe97 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc @@ -190,6 +190,7 @@ void PFBlockProducer::fillDescriptions(edm::ConfigurationDescriptions& descripti psd.addOptional("timeValueMapGsf", {}); psd.addOptional("timeErrorMapGsf", {}); psd.addOptional("timeQualityMapGsf", {}); + psd.addOptional("useTimeQuality", false); desc.addVPSet("elementImporters", psd, vpset); } //linking definitions @@ -347,7 +348,6 @@ void PFBlockProducer::fillDescriptions(edm::ConfigurationDescriptions& descripti psd.addOptional("SuperClusterMatchByRef", false); desc.addVPSet("linkDefinitions", psd, vpset); } - desc.addOptional("useNuclear", false); descriptions.addWithDefaultLabel(desc); } diff --git a/RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc b/RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc index ef3e8573b00af..3e848bf1f4e28 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc @@ -164,6 +164,7 @@ void PFElectronTranslator::fillDescriptions(edm::ConfigurationDescriptions& desc pset.add("pfSumPUPt", {"elPFIsoValuePU04PFId"}); desc.add("isolationValues", pset); } + desc.add("emptyIsOk", false); descriptions.addWithDefaultLabel(desc); } @@ -175,10 +176,10 @@ PFElectronTranslator::PFElectronTranslator(const edm::ParameterSet& iConfig) { bool useIsolationValues = iConfig.getParameter("useIsolationValues"); if (useIsolationValues) { - if (!iConfig.exists("isolationValues")) + const auto& isoVals = iConfig.getParameter("isolationValues"); + if (isoVals.empty()) throw cms::Exception("PFElectronTranslator|InternalError") << "Missing ParameterSet isolationValues"; else { - edm::ParameterSet isoVals = iConfig.getParameter("isolationValues"); inputTokenIsoVals_.push_back( consumes>(isoVals.getParameter("pfSumChargedHadronPt"))); inputTokenIsoVals_.push_back( @@ -199,11 +200,7 @@ PFElectronTranslator::PFElectronTranslator(const edm::ParameterSet& iConfig) { PFSCValueMap_ = iConfig.getParameter("ElectronSC"); MVACut_ = (iConfig.getParameter("MVACutBlock")).getParameter("MVACut"); checkStatusFlag_ = iConfig.getParameter("CheckStatusFlag"); - - if (iConfig.exists("emptyIsOk")) - emptyIsOk_ = iConfig.getParameter("emptyIsOk"); - else - emptyIsOk_ = false; + emptyIsOk_ = iConfig.getParameter("emptyIsOk"); ecalMustacheSCParametersToken_ = esConsumes(); diff --git a/RecoParticleFlow/PFProducer/plugins/PFProducer.cc b/RecoParticleFlow/PFProducer/plugins/PFProducer.cc index 2ba3f67e72a09..f955711853319 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFProducer.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFProducer.cc @@ -129,12 +129,7 @@ PFProducer::PFProducer(const edm::ParameterSet& iConfig) if (vetoEndcap_) inputTagVetoes_ = consumes(iConfig.getParameter("vetoes")); - if (iConfig.existsAs("useEGammaFilters")) { - use_EGammaFilters_ = iConfig.getParameter("useEGammaFilters"); - } else { - use_EGammaFilters_ = false; - } - + use_EGammaFilters_ = iConfig.getParameter("useEGammaFilters"); useEGammaElectrons_ = iConfig.getParameter("useEGammaElectrons"); if (useEGammaElectrons_) { diff --git a/RecoParticleFlow/PFProducer/plugins/importers/TrackTimingImporter.cc b/RecoParticleFlow/PFProducer/plugins/importers/TrackTimingImporter.cc index ec2f4c4062161..4c07b48898b4f 100644 --- a/RecoParticleFlow/PFProducer/plugins/importers/TrackTimingImporter.cc +++ b/RecoParticleFlow/PFProducer/plugins/importers/TrackTimingImporter.cc @@ -16,7 +16,7 @@ class TrackTimingImporter : public BlockElementImporterBase { public: TrackTimingImporter(const edm::ParameterSet& conf, edm::ConsumesCollector& cc) : BlockElementImporterBase(conf, cc), - useTimeQuality_(conf.existsAs("timeQualityMap")), + useTimeQuality_(conf.getParameter("useTimeQuality")), timeQualityThreshold_(useTimeQuality_ ? conf.getParameter("timeQualityThreshold") : -99.), srcTime_(cc.consumes>(conf.getParameter("timeValueMap"))), srcTimeError_(cc.consumes>(conf.getParameter("timeErrorMap"))), diff --git a/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py b/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py index f0d7794697258..273132123c136 100644 --- a/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py +++ b/RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py @@ -69,6 +69,7 @@ def _findIndicesByModule(name): from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing _addTiming = particleFlowBlock.elementImporters.copy() _addTiming.append( cms.PSet( importerName = cms.string("TrackTimingImporter"), + useTimeQuality = cms.bool(False), timeValueMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel"), timeErrorMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution"), timeValueMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModel"), @@ -81,6 +82,7 @@ def _findIndicesByModule(name): _addTimingLayer.append( cms.PSet( importerName = cms.string("TrackTimingImporter"), timeValueMap = cms.InputTag("tofPID:t0"), timeErrorMap = cms.InputTag("tofPID:sigmat0"), + useTimeQuality = cms.bool(True), timeQualityMap = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"), timeQualityThreshold = cms.double(0.5), #this will cause no time to be set for gsf tracks diff --git a/RecoParticleFlow/PFProducer/python/simPFProducer_cff.py b/RecoParticleFlow/PFProducer/python/simPFProducer_cff.py index e46c6bcabeacd..287809f7ef5a7 100644 --- a/RecoParticleFlow/PFProducer/python/simPFProducer_cff.py +++ b/RecoParticleFlow/PFProducer/python/simPFProducer_cff.py @@ -3,6 +3,7 @@ from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing phase2_timing.toModify( simPFProducer, + useTiming = cms.bool(True), trackTimeValueMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel"), trackTimeErrorMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution"), gsfTrackTimeValueMap = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModel"), @@ -12,6 +13,8 @@ from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer phase2_timing_layer.toModify( simPFProducer, + useTiming = cms.bool(True), + useTimingQuality = cms.bool(True), trackTimeValueMap = cms.InputTag("tofPID:t0"), trackTimeErrorMap = cms.InputTag("tofPID:sigmat0"), trackTimeQualityMap = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"), diff --git a/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc b/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc index a37d6913870ed..8090d739758b0 100644 --- a/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc +++ b/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc @@ -84,8 +84,9 @@ PFRecHitProducerTest::PFRecHitProducerTest(const edm::ParameterSet& conf) strictCompare_(conf.getUntrackedParameter("strictCompare")), dumpFirstEvent_(conf.getUntrackedParameter("dumpFirstEvent")), dumpFirstError_(conf.getUntrackedParameter("dumpFirstError")) { - if (conf.existsAs("caloRecHits")) - caloRecHitsToken_.emplace(consumes(conf.getUntrackedParameter("caloRecHits"))); + const auto& caloRecHits = conf.getUntrackedParameter("caloRecHits", {}); + if (caloRecHits.label() != "") + caloRecHitsToken_.emplace(consumes(caloRecHits)); const edm::InputTag input[2] = {conf.getUntrackedParameter("pfRecHitsSource1"), conf.getUntrackedParameter("pfRecHitsSource2")}; diff --git a/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc b/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc index 6bedbb04367c6..c2dde4e70ae09 100644 --- a/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc +++ b/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc @@ -95,6 +95,8 @@ void SimPFProducer::fillDescriptions(edm::ConfigurationDescriptions& description desc.add("gsfTrackSrc", {"electronGsfTracks"}); // if useTiming_ + desc.add("useTiming", false); + desc.add("useTimingQuality", false); desc.addOptional("trackTimeValueMap"); desc.addOptional("trackTimeErrorMap"); desc.addOptional("trackTimeQualityMap"); @@ -120,8 +122,8 @@ SimPFProducer::SimPFProducer(const edm::ParameterSet& conf) : superClusterThreshold_(conf.getParameter("superClusterThreshold")), neutralEMThreshold_(conf.getParameter("neutralEMThreshold")), neutralHADThreshold_(conf.getParameter("neutralHADThreshold")), - useTiming_(conf.existsAs("trackTimeValueMap")), - useTimingQuality_(conf.existsAs("trackTimeQualityMap")), + useTiming_(conf.getParameter("useTiming")), + useTimingQuality_(conf.getParameter("useTimingQuality")), timingQualityThreshold_(useTimingQuality_ ? conf.getParameter("timingQualityThreshold") : -99.), pfRecTracks_(consumes>(conf.getParameter("pfRecTrackSrc"))), tracks_(consumes>(conf.getParameter("trackSrc"))), diff --git a/RecoParticleFlow/PFTracking/plugins/HGCalTrackCollectionProducer.cc b/RecoParticleFlow/PFTracking/plugins/HGCalTrackCollectionProducer.cc index f81ebcad6985d..098daa674faf0 100644 --- a/RecoParticleFlow/PFTracking/plugins/HGCalTrackCollectionProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/HGCalTrackCollectionProducer.cc @@ -88,9 +88,7 @@ void HGCalTrackCollectionProducer::fillDescriptions(edm::ConfigurationDescriptio HGCalTrackCollectionProducer::HGCalTrackCollectionProducer(const edm::ParameterSet& iConfig) : src_(consumes>(iConfig.getParameter("src"))), - trackQuality_((iConfig.existsAs("trackQuality")) - ? reco::TrackBase::qualityByName(iConfig.getParameter("trackQuality")) - : reco::TrackBase::highPurity), + trackQuality_(reco::TrackBase::qualityByName(iConfig.getParameter("trackQuality"))), DPtovPtCut_(iConfig.getParameter>("DPtOverPtCuts_byTrackAlgo")), NHitCut_(iConfig.getParameter>("NHitCuts_byTrackAlgo")), useIterTracking_(iConfig.getParameter("useIterativeTracking")), diff --git a/RecoParticleFlow/PFTracking/test/fastSimWithDisplacedVertexFinder_cfg.py b/RecoParticleFlow/PFTracking/test/fastSimWithDisplacedVertexFinder_cfg.py index 8069eca8fed78..fa6b9e25894f7 100644 --- a/RecoParticleFlow/PFTracking/test/fastSimWithDisplacedVertexFinder_cfg.py +++ b/RecoParticleFlow/PFTracking/test/fastSimWithDisplacedVertexFinder_cfg.py @@ -95,7 +95,6 @@ process.particleFlow.usePFNuclearInteractions = cms.bool(True) -process.particleFlowBlock.useNuclear = cms.bool(True) process.particleFlow.iCfgCandConnector.bCalibPrimary = cms.bool(True) #process.particleFlow.correctSecondary = cms.bool(True) From 2da72f03d53a1bd5cb9fc6e0f72f9205dce0e900 Mon Sep 17 00:00:00 2001 From: Andre Govinda Stahl Leiton Date: Sun, 16 Jun 2024 03:02:29 +0200 Subject: [PATCH 4/7] Remove the unknown PF parameter settings --- .../modules/hltParticleFlowClusterHBHE_cfi.py | 20 +-- .../python/customizeHLTforCMSSW.py | 42 +++-- .../interface/InitialClusteringStepBase.h | 4 +- .../plugins/Basic2DGenericPFlowClusterizer.cc | 2 +- .../plugins/LocalMaximumSeedFinder.cc | 4 +- .../plugins/PFClusterProducer.cc | 164 ++++++++++++++++-- .../plugins/PFRecHitProducer.cc | 65 ++++++- .../python/particleFlowClusterHBHE_cfi.py | 38 ++-- .../plugins/PFSimParticleProducer.cc | 6 +- 9 files changed, 276 insertions(+), 69 deletions(-) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py index 256a644ca1ed9..5246a276df96c 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py @@ -10,8 +10,8 @@ cms.PSet( depths = cms.vint32(1, 2, 3, 4), detector = cms.string('HCAL_BARREL1'), - gatheringThreshold = cms.vdouble(0.1, 0.2, 0.3, 0.3), - gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) + gatheringThresholds = cms.vdouble(0.1, 0.2, 0.3, 0.3), + gatheringThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) ), cms.PSet( depths = cms.vint32( @@ -19,11 +19,11 @@ 6, 7 ), detector = cms.string('HCAL_ENDCAP'), - gatheringThreshold = cms.vdouble( + gatheringThresholds = cms.vdouble( 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2 ), - gatheringThresholdPt = cms.vdouble( + gatheringThresholdsPt = cms.vdouble( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) @@ -97,7 +97,7 @@ cms.PSet( depths = cms.vint32(1, 2, 3, 4), detector = cms.string('HCAL_BARREL1'), - recHitEnergyNorm = cms.vdouble(0.1, 0.2, 0.3, 0.3) + recHitEnergyNorms = cms.vdouble(0.1, 0.2, 0.3, 0.3) ), cms.PSet( depths = cms.vint32( @@ -105,7 +105,7 @@ 6, 7 ), detector = cms.string('HCAL_ENDCAP'), - recHitEnergyNorm = cms.vdouble( + recHitEnergyNorms = cms.vdouble( 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2 ) @@ -147,8 +147,8 @@ cms.PSet( depths = cms.vint32(1, 2, 3, 4), detector = cms.string('HCAL_BARREL1'), - seedingThreshold = cms.vdouble(0.125, 0.25, 0.35, 0.35), - seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) + seedingThresholds = cms.vdouble(0.125, 0.25, 0.35, 0.35), + seedingThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) ), cms.PSet( depths = cms.vint32( @@ -156,11 +156,11 @@ 6, 7 ), detector = cms.string('HCAL_ENDCAP'), - seedingThreshold = cms.vdouble( + seedingThresholds = cms.vdouble( 0.1375, 0.275, 0.275, 0.275, 0.275, 0.275, 0.275 ), - seedingThresholdPt = cms.vdouble( + seedingThresholdsPt = cms.vdouble( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 17dbd06fe4ac8..d399b935b76fd 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -52,8 +52,8 @@ def customiseHCALFor2018Input(process): for producer in producers_by_type(process, "PFClusterProducer"): if producer.seedFinder.thresholdsByDetector[0].detector.value() == 'HCAL_BARREL1': - producer.seedFinder.thresholdsByDetector[0].seedingThreshold = _seedingThresholdsHB - producer.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = _thresholdsHB + producer.seedFinder.thresholdsByDetector[0].seedingThresholds = _seedingThresholdsHB + producer.initialClusteringStep.thresholdsByDetector[0].gatheringThresholds = _thresholdsHB producer.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = _thresholdsHB producer.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018 producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018 @@ -319,15 +319,14 @@ def customizeHLTfor45212(process): # Add missing parameters for Basic2DGenericPFlowPositionCalc for p in ["PFClusterProducer", "LegacyPFClusterProducer", "PFMultiDepthClusterProducer"]: for prod in producers_by_type(process, p): - if hasattr(prod, "pfClusterBuilder"): - for n in ["positionCalc", "allCellsPositionCalc"]: - if hasattr(prod.pfClusterBuilder, n) and hasattr(getattr(prod.pfClusterBuilder, n), "algoName") and (getattr(prod.pfClusterBuilder, n).algoName == "Basic2DGenericPFlowPositionCalc"): - if not hasattr(getattr(prod.pfClusterBuilder, n), "logWeightDenominatorByDetector"): - getattr(prod.pfClusterBuilder, n).logWeightDenominatorByDetector = cms.VPSet() - if not hasattr(getattr(prod.pfClusterBuilder, n), "timeResolutionCalcBarrel"): - getattr(prod.pfClusterBuilder, n).timeResolutionCalcBarrel = cms.PSet() - if not hasattr(getattr(prod.pfClusterBuilder, n), "timeResolutionCalcEndcap"): - getattr(prod.pfClusterBuilder, n).timeResolutionCalcEndcap = cms.PSet() + for n in ["positionCalc", "allCellsPositionCalc"]: + if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, n) and hasattr(getattr(prod.pfClusterBuilder, n), "algoName") and (getattr(prod.pfClusterBuilder, n).algoName == "Basic2DGenericPFlowPositionCalc"): + if not hasattr(getattr(prod.pfClusterBuilder, n), "logWeightDenominatorByDetector"): + getattr(prod.pfClusterBuilder, n).logWeightDenominatorByDetector = cms.VPSet() + if not hasattr(getattr(prod.pfClusterBuilder, n), "timeResolutionCalcBarrel"): + getattr(prod.pfClusterBuilder, n).timeResolutionCalcBarrel = cms.PSet() + if not hasattr(getattr(prod.pfClusterBuilder, n), "timeResolutionCalcEndcap"): + getattr(prod.pfClusterBuilder, n).timeResolutionCalcEndcap = cms.PSet() # Add missing parameters for ECAL2DPositionCalcWithDepthCorr for prod in producers_by_type(process, 'PFClusterProducer'): @@ -369,6 +368,27 @@ def customizeHLTfor45212(process): if not hasattr(prod.iCfgCandConnector, "nuclCalibFactors"): prod.iCfgCandConnector.nuclCalibFactors = cms.vdouble() + # Fix types for gathering and seeding thresholds, and recHitEnergyNorm + for prod in producers_by_type(process, 'PFClusterProducer'): + if hasattr(prod, "initialClusteringStep") and hasattr(prod.initialClusteringStep, "thresholdsByDetector"): + if hasattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThreshold") and isinstance(prod.initialClusteringStep.thresholdsByDetector.gatheringThreshold, cms.vdouble): + prod.initialClusteringStep.thresholdsByDetector.gatheringThresholds = prod.initialClusteringStep.thresholdsByDetector.gatheringThreshold + delattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThreshold") + if hasattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThresholdPt") and isinstance(prod.initialClusteringStep.thresholdsByDetector.gatheringThresholdPt, cms.vdouble): + prod.initialClusteringStep.thresholdsByDetector.gatheringThresholdsPt = prod.initialClusteringStep.thresholdsByDetector.gatheringThresholdPt + delattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThresholdPt") + if hasattr(prod, "seedFinder") and hasattr(prod.seedFinder, "thresholdsByDetector"): + if hasattr(prod.seedFinder.thresholdsByDetector, "seedingThreshold") and isinstance(prod.seedFinder.thresholdsByDetector.seedingThreshold, cms.vdouble): + prod.seedFinder.thresholdsByDetector.seedingThresholds = prod.seedFinder.thresholdsByDetector.seedingThreshold + delattr(prod.seedFinder.thresholdsByDetector, "seedingThreshold") + if hasattr(prod.seedFinder.thresholdsByDetector, "seedingThresholdPt") and isinstance(prod.seedFinder.thresholdsByDetector.seedingThresholdPt, cms.vdouble): + prod.seedFinder.thresholdsByDetector.seedingThresholdsPt = prod.seedFinder.thresholdsByDetector.seedingThresholdPt + delattr(prod.seedFinder.thresholdsByDetector, "seedingThresholdPt") + for n in ["positionCalc", "allCellsPositionCalc"]: + if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, n) and hasattr(getattr(prod.pfClusterBuilder, n), "recHitEnergyNorms") and hasattr(getattr(prod.pfClusterBuilder, n).recHitEnergyNorms, "recHitEnergyNorm") and isinstance(getattr(prod.pfClusterBuilder, n).recHitEnergyNorms.recHitEnergyNorm, cms.vdouble): + getattr(prod.pfClusterBuilder, n).recHitEnergyNorms.recHitEnergyNorms = getattr(prod.pfClusterBuilder, n).recHitEnergyNorms.recHitEnergyNorm + delattr(getattr(prod.pfClusterBuilder, n).recHitEnergyNorms, "recHitEnergyNorm") + return process # CMSSW version specific customizations diff --git a/RecoParticleFlow/PFClusterProducer/interface/InitialClusteringStepBase.h b/RecoParticleFlow/PFClusterProducer/interface/InitialClusteringStepBase.h index f70e7b6f35440..07a6e547f6607 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/InitialClusteringStepBase.h +++ b/RecoParticleFlow/PFClusterProducer/interface/InitialClusteringStepBase.h @@ -54,8 +54,8 @@ class InitialClusteringStepBase { if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) { depths = pset.getParameter >("depths"); - thresh_E = pset.getParameter >("gatheringThreshold"); - thresh_pT = pset.getParameter >("gatheringThresholdPt"); + thresh_E = pset.getParameter >("gatheringThresholds"); + thresh_pT = pset.getParameter >("gatheringThresholdsPt"); if (thresh_E.size() != depths.size() || thresh_pT.size() != depths.size()) { throw cms::Exception("InvalidGatheringThreshold") << "gatheringThresholds mismatch with the numbers of depths"; diff --git a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc index c8c4e632c9936..143dcc97306e1 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc @@ -106,7 +106,7 @@ Basic2DGenericPFlowClusterizer::Basic2DGenericPFlowClusterizer(const edm::Parame if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) { depths = pset.getParameter >("depths"); - rhE_norm = pset.getParameter >("recHitEnergyNorm"); + rhE_norm = pset.getParameter >("recHitEnergyNorms"); } else { depths.push_back(0); rhE_norm.push_back(pset.getParameter("recHitEnergyNorm")); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/LocalMaximumSeedFinder.cc b/RecoParticleFlow/PFClusterProducer/plugins/LocalMaximumSeedFinder.cc index 86bccb6dbaf7b..2b0539cf78eff 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/LocalMaximumSeedFinder.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/LocalMaximumSeedFinder.cc @@ -67,8 +67,8 @@ LocalMaximumSeedFinder::LocalMaximumSeedFinder(const edm::ParameterSet& conf) if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) { depths = pset.getParameter >("depths"); - thresh_E = pset.getParameter >("seedingThreshold"); - thresh_pT = pset.getParameter >("seedingThresholdPt"); + thresh_E = pset.getParameter >("seedingThresholds"); + thresh_pT = pset.getParameter >("seedingThresholdsPt"); if (thresh_E.size() != depths.size() || thresh_pT.size() != depths.size()) { throw cms::Exception("InvalidGatheringThreshold") << "gatheringThresholds mismatch with the numbers of depths"; } diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc index a3fdfe33dbed0..459dc72b0681c 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc @@ -50,26 +50,164 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip edm::ParameterSetDescription desc; desc.add("recHitsSource", {}); desc.add("usePFThresholdsFromDB", false); - edm::ParameterSetDescription psd; - psd.setUnknown(); - desc.addVPSet("recHitCleaners", psd, {}); { - edm::ParameterSetDescription psd1; - psd1.add>("RecHitFlagsToBeExcluded", {}); - psd1.add("algoName"); - desc.addVPSet("seedCleaners", psd1, {}); + edm::ParameterSetDescription psd; + psd.add("algoName", ""); + desc.addVPSet("recHitCleaners", psd, {}); + } + { + edm::ParameterSetDescription psd; + psd.add("algoName", ""); + psd.add>("RecHitFlagsToBeExcluded", {}); + desc.addVPSet("seedCleaners", psd, {}); } { edm::ParameterSetDescription pset; - pset.add("algoName"); + pset.add("algoName", ""); pset.add("nNeighbours", 0); - pset.addVPSet("thresholdsByDetector", psd, {}); + { + edm::ParameterSetDescription psd; + psd.add("detector", ""); + psd.addOptional("seedingThreshold", 0); + psd.addOptional("seedingThresholdPt", 0); + psd.addOptional>("depths", {}); + psd.addOptional>("seedingThresholds", {}); + psd.addOptional>("seedingThresholdsPt", {}); + pset.addVPSet("thresholdsByDetector", psd, {}); + } desc.add("seedFinder", pset); } - desc.add("initialClusteringStep", psd); - desc.add("pfClusterBuilder", psd); - desc.add("positionReCalc", psd); - desc.add("energyCorrector", psd); + { + edm::ParameterSetDescription pset; + pset.add("algoName", ""); + { + edm::ParameterSetDescription psd; + psd.add("detector", ""); + psd.addOptional("gatheringThreshold", 0); + psd.addOptional("gatheringThresholdPt", 0); + psd.addOptional>("depths", {}); + psd.addOptional>("gatheringThresholds", {}); + psd.addOptional>("gatheringThresholdsPt", {}); + pset.addVPSet("thresholdsByDetector", psd, {}); + } + pset.addOptional("useCornerCells", false); + pset.addOptional("clusterSrc", {}); + pset.addOptional("filterByTracksterIteration", false); + pset.addOptional("filterByTracksterPID", false); + pset.addOptional>("filter_on_categories", {}); + pset.addOptional>("filter_on_iterations", {}); + pset.addOptional("pid_threshold", 0); + pset.addOptional("tracksterSrc", {}); + pset.addOptional("exclusiveFraction", 0); + pset.addOptional("invisibleFraction", 0); + pset.addOptional("maxDistanceFilter", false); + pset.addOptional("maxDistance", 0); + pset.addOptional("maxDforTimingSquared", 0); + pset.addOptional("timeOffset", 0); + pset.addOptional("minNHitsforTiming", 0); + pset.addOptional("useMCFractionsForExclEnergy", false); + pset.addOptional>("hadronCalib", {}); + pset.addOptional>("egammaCalib", {}); + pset.addOptional("calibMinEta", 0); + pset.addOptional("calibMaxEta", 0); + pset.addOptional("simClusterSrc", {}); + desc.add("initialClusteringStep", pset); + } + { + edm::ParameterSetDescription pset; + pset.addOptional("algoName"); + { + edm::ParameterSetDescription pset2; + pset2.addOptional("algoName"); + pset2.addOptional("minFractionInCalc", 0); + pset2.addOptional("posCalcNCrystals", -1); + { + edm::ParameterSetDescription psd; + psd.add("detector", ""); + psd.add>("depths", {}); + psd.add>("logWeightDenominator", {}); + pset2.addVPSetOptional("logWeightDenominatorByDetector", psd, {}); + } + pset2.addOptional("logWeightDenominator", 0); + pset2.addOptional("minAllowedNormalization", 0); + { + edm::ParameterSetDescription pset3; + pset3.addOptional("constantTerm", 0); + pset3.addOptional("constantTermLowE", 0); + pset3.addOptional("corrTermLowE", 0); + pset3.addOptional("noiseTerm", 0); + pset3.addOptional("noiseTermLowE", 0); + pset3.addOptional("threshHighE", 0); + pset3.addOptional("threshLowE", 0); + pset2.addOptional("timeResolutionCalcBarrel", pset3); + pset2.addOptional("timeResolutionCalcEndcap", pset3); + } + pset.addOptional("allCellsPositionCalc", pset2); + pset.addOptional("positionCalc", pset2); + } + pset.addOptional("minFractionToKeep", 0); + pset.addOptional("nSigmaEta", 0); + pset.addOptional("nSigmaPhi", 0); + pset.addOptional("excludeOtherSeeds", false); + pset.addOptional("maxIterations", 0); + pset.addOptional("minFracTot", 0); + { + edm::ParameterSetDescription pset2; + pset2.addOptional("algoName"); + pset2.addOptional("minFractionInCalc", 0); + pset2.addOptional("T0_EB", 0); + pset2.addOptional("T0_EE", 0); + pset2.addOptional("T0_ES", 0); + pset2.addOptional("W0", 0); + pset2.addOptional("X0", 0); + pset2.addOptional("minAllowedNormalization", 0); + pset2.addOptional("timeResolutionCalc", {}); + pset.addOptional("positionCalcForConvergence", pset2); + } + { + edm::ParameterSetDescription psd; + psd.add("detector", ""); + psd.addOptional("recHitEnergyNorm", 0); + psd.addOptional>("depths", {}); + psd.addOptional>("recHitEnergyNorms", {}); + pset.addVPSetOptional("recHitEnergyNorms", psd); + } + pset.addOptional("showerSigma", 1.5); + pset.addOptional("stoppingTolerance", 1e-08); + pset.addOptional("clusterTimeResFromSeed", false); + pset.addOptional("maxNSigmaTime", 10.0); + pset.addOptional("minChi2Prob", 0); + { + edm::ParameterSetDescription pset2; + pset2.add("constantTerm", 0); + pset2.add("constantTermLowE", 0); + pset2.add("corrTermLowE", 0); + pset2.add("noiseTerm", 0); + pset2.add("noiseTermLowE", 0); + pset2.add("threshHighE", 0); + pset2.add("threshLowE", 0); + pset.addOptional("timeResolutionCalcBarrel", pset2); + pset.addOptional("timeResolutionCalcEndcap", pset2); + } + pset.addOptional("timeSigmaEB", 10.0); + pset.addOptional("timeSigmaEE", 10.0); + desc.add("pfClusterBuilder", pset); + } + { + edm::ParameterSetDescription pset; + pset.addOptional("algoName"); + pset.addOptional("minFractionInCalc", 0); + pset.addOptional("updateTiming", false); + pset.addOptional("T0_EB", 0); + pset.addOptional("T0_EE", 0); + pset.addOptional("T0_ES", 0); + pset.addOptional("W0", 0); + pset.addOptional("X0", 0); + pset.addOptional("minAllowedNormalization", 0); + pset.addOptional("timeResolutionCalc", {}); + desc.add("positionReCalc", pset); + } + desc.add("energyCorrector", {}); descriptions.addWithDefaultLabel(desc); } diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc index 5f8079449c560..4f0b15c29f8dc 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc @@ -23,7 +23,7 @@ class PFRecHitProducer final : public edm::stream::EDProducer<> { private: void produce(edm::Event&, const edm::EventSetup&) override; void beginRun(edm::Run const&, const edm::EventSetup&) override; - std::vector > creators_; + std::vector> creators_; std::unique_ptr navigator_; bool init_; }; @@ -44,7 +44,7 @@ PFRecHitProducer::PFRecHitProducer(const edm::ParameterSet& iConfig) { edm::ConsumesCollector cc = consumesCollector(); - std::vector creators = iConfig.getParameter >("producers"); + std::vector creators = iConfig.getParameter>("producers"); for (auto& creator : creators) { std::string name = creator.getParameter("name"); creators_.emplace_back(PFRecHitFactory::get()->create(name, creator, cc)); @@ -101,9 +101,62 @@ void PFRecHitProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup void PFRecHitProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - edm::ParameterSetDescription psd; - psd.setUnknown(); - desc.add("navigator", psd); - desc.addVPSet("producers", psd, {}); + { + edm::ParameterSetDescription pset; + pset.add("name", ""); + pset.addOptional>("hcalEnums", {}); + pset.addOptional("barrel", {}); + pset.addOptional("endcap", {}); + { + edm::ParameterSetDescription pset2; + pset2.add("name", ""); + pset2.add("topologySource", ""); + pset.addOptional("hgcee", pset2); + pset.addOptional("hgcheb", pset2); + pset.addOptional("hgchef", pset2); + } + desc.add("navigator", pset); + } + { + edm::ParameterSetDescription psd; + psd.add("name", ""); + psd.add("src", {}); + { + edm::ParameterSetDescription psd2; + psd2.add("name", ""); + psd2.addOptional>("maxSeverities", {}); + psd2.addOptional>("cleaningThresholds", {}); + psd2.addOptional>("flags", {}); + psd2.addOptional("usePFThresholdsFromDB", false); + { + edm::ParameterSetDescription psd3; + psd3.add>("depth", {}); + psd3.add>("threshold", {}); + psd3.add("detectorEnum", 0); + psd2.addVPSetOptional("cuts", psd3, {}); + } + psd2.addOptional("thresholdSNR", 0); + psd2.addOptional("applySelectionsToAllCrystals", false); + psd2.addOptional("cleaningThreshold", 0); + psd2.addOptional("timingCleaning", false); + psd2.addOptional("topologicalCleaning", false); + psd2.addOptional("skipTTRecoveredHits", false); + psd2.addOptional("threshold", 0); + psd2.addOptional("threshold_ring0", 0); + psd2.addOptional("threshold_ring12", 0); + psd.addVPSet("qualityTests", psd2, {}); + } + psd.addOptional("EMDepthCorrection", 0); + psd.addOptional("HADDepthCorrection", 0); + psd.addOptional("thresh_HF", 0); + psd.addOptional("ShortFibre_Cut", 0); + psd.addOptional("LongFibre_Fraction", 0); + psd.addOptional("LongFibre_Cut", 0); + psd.addOptional("ShortFibre_Fraction", 0); + psd.addOptional("HFCalib29", 0); + psd.addOptional("srFlags", {}); + psd.addOptional("geometryInstance"); + desc.addVPSet("producers", psd, {}); + } descriptions.addWithDefaultLabel(desc); } diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py index d63aea725f500..72443bcf90fd6 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py @@ -27,13 +27,13 @@ thresholdsByDetector = cms.VPSet( cms.PSet( detector = cms.string("HCAL_BARREL1"), depths = cms.vint32(1, 2, 3, 4), - seedingThreshold = _seedingThresholdsHB, - seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) + seedingThresholds = _seedingThresholdsHB, + seedingThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) ), cms.PSet( detector = cms.string("HCAL_ENDCAP"), depths = cms.vint32(1, 2, 3, 4, 5, 6, 7), - seedingThreshold = _seedingThresholdsHE, - seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) + seedingThresholds = _seedingThresholdsHE, + seedingThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ) ), nNeighbours = cms.int32(4), @@ -43,13 +43,13 @@ thresholdsByDetector = cms.VPSet( cms.PSet( detector = cms.string("HCAL_BARREL1"), depths = cms.vint32(1, 2, 3, 4), - gatheringThreshold = _thresholdsHB, - gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) + gatheringThresholds = _thresholdsHB, + gatheringThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) ), cms.PSet( detector = cms.string("HCAL_ENDCAP"), depths = cms.vint32(1, 2, 3, 4, 5, 6, 7), - gatheringThreshold = _thresholdsHE, - gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) + gatheringThresholds = _thresholdsHE, + gatheringThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ) ), useCornerCells = cms.bool(True) @@ -112,11 +112,11 @@ recHitEnergyNorms = cms.VPSet( cms.PSet( detector = cms.string("HCAL_BARREL1"), depths = cms.vint32(1, 2, 3, 4), - recHitEnergyNorm = _thresholdsHB, + recHitEnergyNorms = _thresholdsHB, ), cms.PSet( detector = cms.string("HCAL_ENDCAP"), depths = cms.vint32(1, 2, 3, 4, 5, 6, 7), - recHitEnergyNorm = _thresholdsHE, + recHitEnergyNorms = _thresholdsHE, ) ) ), @@ -130,10 +130,10 @@ from Configuration.Eras.Modifier_run2_HE_2018_cff import run2_HE_2018 from Configuration.ProcessModifiers.run2_HECollapse_2018_cff import run2_HECollapse_2018 (run2_HE_2018 & ~run2_HECollapse_2018).toModify(particleFlowClusterHBHE, - seedFinder = dict(thresholdsByDetector = {1 : dict(seedingThreshold = _seedingThresholdsHEphase1) } ), - initialClusteringStep = dict(thresholdsByDetector = {1 : dict(gatheringThreshold = _thresholdsHEphase1) } ), + seedFinder = dict(thresholdsByDetector = {1 : dict(seedingThresholds = _seedingThresholdsHEphase1) } ), + initialClusteringStep = dict(thresholdsByDetector = {1 : dict(gatheringThresholds = _thresholdsHEphase1) } ), pfClusterBuilder = dict( - recHitEnergyNorms = {1 : dict(recHitEnergyNorm = _thresholdsHEphase1) }, + recHitEnergyNorms = {1 : dict(recHitEnergyNorms = _thresholdsHEphase1) }, positionCalc = dict(logWeightDenominatorByDetector = {1 : dict(logWeightDenominator = _thresholdsHEphase1) } ), allCellsPositionCalc = dict(logWeightDenominatorByDetector = {1 : dict(logWeightDenominator = _thresholdsHEphase1) } ), ), @@ -142,10 +142,10 @@ # offline 2019 from Configuration.Eras.Modifier_run3_HB_cff import run3_HB run3_HB.toModify(particleFlowClusterHBHE, - seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThreshold = _seedingThresholdsHBphase1) } ), - initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThreshold = _thresholdsHBphase1) } ), + seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThresholds = _seedingThresholdsHBphase1) } ), + initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThresholds = _thresholdsHBphase1) } ), pfClusterBuilder = dict( - recHitEnergyNorms = {0 : dict(recHitEnergyNorm = _thresholdsHBphase1) }, + recHitEnergyNorms = {0 : dict(recHitEnergyNorms = _thresholdsHBphase1) }, positionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1) } ), allCellsPositionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1) } ), ), @@ -154,10 +154,10 @@ # offline 2023 from Configuration.Eras.Modifier_run3_egamma_2023_cff import run3_egamma_2023 run3_egamma_2023.toModify(particleFlowClusterHBHE, - seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThreshold = _seedingThresholdsHBphase1_2023) } ), - initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThreshold = _thresholdsHBphase1_2023) } ), + seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThresholds = _seedingThresholdsHBphase1_2023) } ), + initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThresholds = _thresholdsHBphase1_2023) } ), pfClusterBuilder = dict( - recHitEnergyNorms = {0 : dict(recHitEnergyNorm = _thresholdsHBphase1_2023) }, + recHitEnergyNorms = {0 : dict(recHitEnergyNorms = _thresholdsHBphase1_2023) }, positionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1_2023) } ), allCellsPositionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1_2023) } ), ), diff --git a/RecoParticleFlow/PFSimProducer/plugins/PFSimParticleProducer.cc b/RecoParticleFlow/PFSimProducer/plugins/PFSimParticleProducer.cc index 9f94a78e079a4..503c6477f8fd9 100644 --- a/RecoParticleFlow/PFSimProducer/plugins/PFSimParticleProducer.cc +++ b/RecoParticleFlow/PFSimProducer/plugins/PFSimParticleProducer.cc @@ -122,11 +122,7 @@ void PFSimParticleProducer::fillDescriptions(edm::ConfigurationDescriptions& des desc.add("ecalRecHitsEE", edm::InputTag("caloRecHits", "EcalRecHitsEE")); desc.add("ecalRecHitsEB", edm::InputTag("caloRecHits", "EcalRecHitsEB")); desc.addUntracked("process_RecTracks", false); - { - edm::ParameterSetDescription psd0; - psd0.setUnknown(); - desc.add("ParticleFilter", psd0); - } + desc.add("ParticleFilter", {}); desc.add("TTRHBuilder", "WithTrackAngle"); desc.addUntracked("process_Particles", true); desc.add("Propagator", "PropagatorWithMaterial"); From a848a6c0ac22d23ae66d13f7c993f3c7ecdb1a15 Mon Sep 17 00:00:00 2001 From: Andre Govinda Stahl Leiton Date: Sun, 16 Jun 2024 18:20:28 +0200 Subject: [PATCH 5/7] Implemented comments --- .../PFProducer/plugins/PFConcretePFCandidateProducer.cc | 2 +- RecoParticleFlow/PFProducer/plugins/PFLinker.cc | 2 +- RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py | 2 +- RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc | 2 +- RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc | 2 +- .../PFTracking/plugins/PFDisplacedVertexProducer.cc | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/RecoParticleFlow/PFProducer/plugins/PFConcretePFCandidateProducer.cc b/RecoParticleFlow/PFProducer/plugins/PFConcretePFCandidateProducer.cc index 652ebaa96a908..905f22628e252 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFConcretePFCandidateProducer.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFConcretePFCandidateProducer.cc @@ -25,7 +25,7 @@ DEFINE_FWK_MODULE(PFConcretePFCandidateProducer); void PFConcretePFCandidateProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("src", {"particleFlow"}); - descriptions.add("pfConcretePFCandidateProducer", desc); + descriptions.addWithDefaultLabel(desc); } PFConcretePFCandidateProducer::PFConcretePFCandidateProducer(const edm::ParameterSet& iConfig) diff --git a/RecoParticleFlow/PFProducer/plugins/PFLinker.cc b/RecoParticleFlow/PFProducer/plugins/PFLinker.cc index 2e8b5fd964bdc..cf476c2cd7187 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFLinker.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFLinker.cc @@ -91,7 +91,7 @@ void PFLinker::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { desc.add("ValueMapPhotons", "photons"); desc.add("ValueMapMerged", "all"); desc.add("forceElectronsInHGCAL", false); - descriptions.add("pfLinker", desc); + descriptions.addWithDefaultLabel(desc); } PFLinker::PFLinker(const edm::ParameterSet& iConfig) { diff --git a/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py b/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py index 9d61ee2d58de0..aff7fe598f0a5 100644 --- a/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py +++ b/RecoParticleFlow/PFProducer/python/pfElectronTranslator_cfi.py @@ -3,4 +3,4 @@ from RecoParticleFlow.PFProducer.pfElectronTranslatorMVACut_cfi import * from RecoParticleFlow.PFProducer.modules import PFElectronTranslator -pfElectronTranslator = PFElectronTranslator().clone(MVACutBlock = cms.PSet(pfElecMva)) +pfElectronTranslator = PFElectronTranslator(MVACutBlock = cms.PSet(pfElecMva)) diff --git a/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc b/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc index 8090d739758b0..e7fc86cf18432 100644 --- a/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc +++ b/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc @@ -85,7 +85,7 @@ PFRecHitProducerTest::PFRecHitProducerTest(const edm::ParameterSet& conf) dumpFirstEvent_(conf.getUntrackedParameter("dumpFirstEvent")), dumpFirstError_(conf.getUntrackedParameter("dumpFirstError")) { const auto& caloRecHits = conf.getUntrackedParameter("caloRecHits", {}); - if (caloRecHits.label() != "") + if (!caloRecHits.label().empty()) caloRecHitsToken_.emplace(consumes(caloRecHits)); const edm::InputTag input[2] = {conf.getUntrackedParameter("pfRecHitsSource1"), diff --git a/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc b/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc index c2dde4e70ae09..520078d482276 100644 --- a/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc +++ b/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc @@ -105,7 +105,7 @@ void SimPFProducer::fillDescriptions(edm::ConfigurationDescriptions& description desc.addOptional("gsfTrackTimeErrorMap"); desc.addOptional("gsfTrackTimeQualityMap"); - descriptions.add("simPFProducer", desc); + descriptions.addWithDefaultLabel(desc); } namespace { diff --git a/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexProducer.cc b/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexProducer.cc index a81d564fee85e..93e450b6205de 100644 --- a/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexProducer.cc +++ b/RecoParticleFlow/PFTracking/plugins/PFDisplacedVertexProducer.cc @@ -73,7 +73,7 @@ void PFDisplacedVertexProducer::fillDescriptions(edm::ConfigurationDescriptions& // minimal radius below which we do not reconstruct interactions // typically the position of the first Pixel layer or beam pipe desc.add("primaryVertexCut", 1.8); - // radius below which we don't wamt to reconstruct displaced + // radius below which we don't want to reconstruct displaced // vertices desc.add("tobCut", 100); // z below which we don't want to reconstruct displaced From c85415bc65ac6663b9a4d267d545c6402d82a540 Mon Sep 17 00:00:00 2001 From: Andre Govinda Stahl Leiton Date: Tue, 18 Jun 2024 21:32:23 +0200 Subject: [PATCH 6/7] Remove optional condition on parameters --- ...eFlowClusterECALUncorrectedL1Seeded_cfi.py | 8 +- ...eFlowClusterECALUncorrectedUnseeded_cfi.py | 8 +- .../modules/hltParticleFlowClusterHBHE_cfi.py | 9 +- .../modules/hltParticleFlowClusterHCAL_cfi.py | 5 +- .../particleFlowClusterECALUncorrected_cfi.py | 8 +- .../modules/particleFlowClusterHF_cfi.py | 11 +- .../modules/particleFlowClusterHO_cfi.py | 11 +- .../python/customizeHLTforCMSSW.py | 52 ----- .../interface/HGCRecHitNavigator.h | 6 +- .../interface/PFClusterBuilderBase.h | 3 +- .../plugins/Basic2DGenericPFlowClusterizer.cc | 6 +- .../Basic2DGenericPFlowPositionCalc.cc | 4 +- .../plugins/LegacyPFClusterProducer.cc | 6 +- .../plugins/PFClusterProducer.cc | 189 +++++++++--------- .../plugins/PFMultiDepthClusterProducer.cc | 8 +- .../plugins/PFMultiDepthClusterizer.cc | 3 +- .../plugins/PFRecHitProducer.cc | 60 +++--- .../plugins/PFlow2DClusterizerWithTime.cc | 6 +- .../PFProducer/plugins/PFBlockProducer.cc | 80 ++++---- .../test/PFRecHitProducerTest.cc | 2 +- .../PFSimProducer/plugins/SimPFProducer.cc | 14 +- 21 files changed, 213 insertions(+), 286 deletions(-) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedL1Seeded_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedL1Seeded_cfi.py index 36bf37e658224..4978081125065 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedL1Seeded_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedL1Seeded_cfi.py @@ -25,7 +25,6 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(-1), @@ -55,7 +54,6 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(9), @@ -86,8 +84,7 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0), - timeResolutionCalc = cms.PSet() + minFractionInCalc = cms.double(0.0) ), recHitEnergyNorms = cms.VPSet( cms.PSet( @@ -110,8 +107,7 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0), - timeResolutionCalc = cms.PSet() + minFractionInCalc = cms.double(0.0) ), recHitCleaners = cms.VPSet(), recHitsSource = cms.InputTag("hltParticleFlowRecHitECALL1Seeded"), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedUnseeded_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedUnseeded_cfi.py index 89aef3ee04b7c..112d8ffd0e6db 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedUnseeded_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterECALUncorrectedUnseeded_cfi.py @@ -25,7 +25,6 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(-1), @@ -55,7 +54,6 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(9), @@ -86,8 +84,7 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0), - timeResolutionCalc = cms.PSet() + minFractionInCalc = cms.double(0.0) ), recHitEnergyNorms = cms.VPSet( cms.PSet( @@ -110,8 +107,7 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0), - timeResolutionCalc = cms.PSet() + minFractionInCalc = cms.double(0.0) ), recHitCleaners = cms.VPSet(), recHitsSource = cms.InputTag("hltParticleFlowRecHitECALUnseeded"), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py index 5246a276df96c..f7983b260e7b4 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py @@ -55,9 +55,7 @@ ), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(-1), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + posCalcNCrystals = cms.int32(-1) ), clusterTimeResFromSeed = cms.bool(False), excludeOtherSeeds = cms.bool(True), @@ -88,11 +86,8 @@ ), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(5), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + posCalcNCrystals = cms.int32(5) ), - positionCalcForConvergence = cms.PSet(), recHitEnergyNorms = cms.VPSet( cms.PSet( depths = cms.vint32(1, 2, 3, 4), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHCAL_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHCAL_cfi.py index fd30e7f3f0af7..0dc128be8a605 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHCAL_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHCAL_cfi.py @@ -29,11 +29,8 @@ ), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(-1), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + posCalcNCrystals = cms.int32(-1) ), - positionCalc = cms.PSet(), minFractionToKeep = cms.double(1e-07), nSigmaEta = cms.double(2.0), nSigmaPhi = cms.double(2.0) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterECALUncorrected_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterECALUncorrected_cfi.py index 37b0519a8a59b..1ca6e4675d1af 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterECALUncorrected_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterECALUncorrected_cfi.py @@ -25,7 +25,6 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(-1), @@ -55,7 +54,6 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.08), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), posCalcNCrystals = cms.int32(9), @@ -86,8 +84,7 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0), - timeResolutionCalc = cms.PSet() + minFractionInCalc = cms.double(0.0) ), recHitEnergyNorms = cms.VPSet( cms.PSet( @@ -110,8 +107,7 @@ X0 = cms.double(0.89), algoName = cms.string('ECAL2DPositionCalcWithDepthCorr'), minAllowedNormalization = cms.double(0.0), - minFractionInCalc = cms.double(0.0), - timeResolutionCalc = cms.PSet() + minFractionInCalc = cms.double(0.0) ), recHitCleaners = cms.VPSet(), recHitsSource = cms.InputTag("particleFlowRecHitECAL"), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHF_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHF_cfi.py index b4a1fadcd84a6..d6a428f93dbee 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHF_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHF_cfi.py @@ -25,12 +25,9 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.8), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(-1), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + posCalcNCrystals = cms.int32(-1) ), excludeOtherSeeds = cms.bool(True), maxIterations = cms.uint32(50), @@ -39,14 +36,10 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.8), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(5), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + posCalcNCrystals = cms.int32(5) ), - positionCalcForConvergence = cms.PSet(), recHitEnergyNorms = cms.VPSet( cms.PSet( detector = cms.string('HF_EM'), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHO_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHO_cfi.py index ddfafe0894c3b..9a76156e662b6 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHO_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/particleFlowClusterHO_cfi.py @@ -25,12 +25,9 @@ allCellsPositionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.05), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(-1), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + posCalcNCrystals = cms.int32(-1) ), excludeOtherSeeds = cms.bool(True), maxIterations = cms.uint32(50), @@ -39,14 +36,10 @@ positionCalc = cms.PSet( algoName = cms.string('Basic2DGenericPFlowPositionCalc'), logWeightDenominator = cms.double(0.05), - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-09), minFractionInCalc = cms.double(1e-09), - posCalcNCrystals = cms.int32(5), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + posCalcNCrystals = cms.int32(5) ), - positionCalcForConvergence = cms.PSet(), recHitEnergyNorms = cms.VPSet( cms.PSet( detector = cms.string('HCAL_BARREL2_RING0'), diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index d399b935b76fd..6000de4aace86 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -316,58 +316,6 @@ def customizeHLTfor45063(process): return process def customizeHLTfor45212(process): - # Add missing parameters for Basic2DGenericPFlowPositionCalc - for p in ["PFClusterProducer", "LegacyPFClusterProducer", "PFMultiDepthClusterProducer"]: - for prod in producers_by_type(process, p): - for n in ["positionCalc", "allCellsPositionCalc"]: - if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, n) and hasattr(getattr(prod.pfClusterBuilder, n), "algoName") and (getattr(prod.pfClusterBuilder, n).algoName == "Basic2DGenericPFlowPositionCalc"): - if not hasattr(getattr(prod.pfClusterBuilder, n), "logWeightDenominatorByDetector"): - getattr(prod.pfClusterBuilder, n).logWeightDenominatorByDetector = cms.VPSet() - if not hasattr(getattr(prod.pfClusterBuilder, n), "timeResolutionCalcBarrel"): - getattr(prod.pfClusterBuilder, n).timeResolutionCalcBarrel = cms.PSet() - if not hasattr(getattr(prod.pfClusterBuilder, n), "timeResolutionCalcEndcap"): - getattr(prod.pfClusterBuilder, n).timeResolutionCalcEndcap = cms.PSet() - - # Add missing parameters for ECAL2DPositionCalcWithDepthCorr - for prod in producers_by_type(process, 'PFClusterProducer'): - if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, "positionCalcForConvergence") and hasattr(prod.pfClusterBuilder.positionCalcForConvergence, "algoName") and (prod.pfClusterBuilder.positionCalcForConvergence.algoName == "ECAL2DPositionCalcWithDepthCorr"): - if not hasattr(prod.pfClusterBuilder.positionCalcForConvergence, "timeResolutionCalc"): - prod.pfClusterBuilder.positionCalcForConvergence.timeResolutionCalc = cms.PSet() - if hasattr(prod, "positionReCalc") and hasattr(prod.positionReCalc, "algoName") and (prod.positionReCalc.algoName == "ECAL2DPositionCalcWithDepthCorr"): - if not hasattr(prod.positionReCalc, "timeResolutionCalc"): - prod.positionReCalc.timeResolutionCalc = cms.PSet() - - # Add missing parameters for Basic2DGenericPFlowClusterizer - for p in ["PFClusterProducer", "LegacyPFClusterProducer"]: - for prod in producers_by_type(process, p): - if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, "algoName") and (prod.pfClusterBuilder.algoName == "Basic2DGenericPFlowClusterizer"): - if not hasattr(prod.pfClusterBuilder, "positionCalc"): - prod.pfClusterBuilder.positionCalc = cms.PSet() - if not hasattr(prod.pfClusterBuilder, "allCellsPositionCalc"): - prod.pfClusterBuilder.allCellsPositionCalc = cms.PSet() - if not hasattr(prod.pfClusterBuilder, "positionCalcForConvergence"): - prod.pfClusterBuilder.positionCalcForConvergence = cms.PSet() - - # Add missing parameters for PFMultiDepthClusterizer - for prod in producers_by_type(process, 'PFMultiDepthClusterProducer'): - if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, "algoName") and (prod.pfClusterBuilder.algoName == "PFMultiDepthClusterizer"): - if not hasattr(prod.pfClusterBuilder, "positionCalc"): - prod.pfClusterBuilder.positionCalc = cms.PSet() - if not hasattr(prod.pfClusterBuilder, "allCellsPositionCalc"): - prod.pfClusterBuilder.allCellsPositionCalc = cms.PSet() - - # Add missing parameters for PFCandConnector - for prod in producers_by_type(process, 'PFProducer'): - if hasattr(prod, "iCfgCandConnector"): - if not hasattr(prod.iCfgCandConnector, "dptRel_PrimaryTrack"): - prod.iCfgCandConnector.dptRel_PrimaryTrack = cms.double(0) - if not hasattr(prod.iCfgCandConnector, "dptRel_MergedTrack"): - prod.iCfgCandConnector.dptRel_MergedTrack = cms.double(0) - if not hasattr(prod.iCfgCandConnector, "ptErrorSecondary"): - prod.iCfgCandConnector.ptErrorSecondary = cms.double(0) - if not hasattr(prod.iCfgCandConnector, "nuclCalibFactors"): - prod.iCfgCandConnector.nuclCalibFactors = cms.vdouble() - # Fix types for gathering and seeding thresholds, and recHitEnergyNorm for prod in producers_by_type(process, 'PFClusterProducer'): if hasattr(prod, "initialClusteringStep") and hasattr(prod.initialClusteringStep, "thresholdsByDetector"): diff --git a/RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h b/RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h index fa00c1f46624b..b14ff55271954 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h +++ b/RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h @@ -44,19 +44,19 @@ class HGCRecHitNavigator : public PFRecHitNavigatorBase { HGCRecHitNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc) { const auto& pset_hgcee = iConfig.getParameter("hgcee"); - if (!pset_hgcee.empty()) { + if (!pset_hgcee.empty() && !pset_hgcee.getParameter("name").empty()) { eeNav_ = new hgcee(pset_hgcee, cc); } else { eeNav_ = nullptr; } const auto& pset_hgchef = iConfig.getParameter("hgchef"); - if (!pset_hgchef.empty()) { + if (!pset_hgchef.empty() && !pset_hgchef.getParameter("name").empty()) { hefNav_ = new hgchef(pset_hgchef, cc); } else { hefNav_ = nullptr; } const auto& pset_hgcheb = iConfig.getParameter("hgcheb"); - if (!pset_hgcheb.empty()) { + if (!pset_hgcheb.empty() && !pset_hgcheb.getParameter("name").empty()) { hebNav_ = new hgcheb(pset_hgcheb, cc); } else { hebNav_ = nullptr; diff --git a/RecoParticleFlow/PFClusterProducer/interface/PFClusterBuilderBase.h b/RecoParticleFlow/PFClusterProducer/interface/PFClusterBuilderBase.h index 5231c41eccc66..ae7892188ac68 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/PFClusterBuilderBase.h +++ b/RecoParticleFlow/PFClusterProducer/interface/PFClusterBuilderBase.h @@ -31,7 +31,8 @@ class PFClusterBuilderBase { const auto& pcConf = conf.getParameterSet("positionCalc"); if (!pcConf.empty()) { const std::string& algo = pcConf.getParameter("algoName"); - _positionCalc = PFCPositionCalculatorFactory::get()->create(algo, pcConf, cc); + if (!algo.empty()) + _positionCalc = PFCPositionCalculatorFactory::get()->create(algo, pcConf, cc); } } virtual ~PFClusterBuilderBase() = default; diff --git a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc index 143dcc97306e1..8e6adb499af9d 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc @@ -128,13 +128,15 @@ Basic2DGenericPFlowClusterizer::Basic2DGenericPFlowClusterizer(const edm::Parame const auto& acConf = conf.getParameterSet("allCellsPositionCalc"); if (!acConf.empty()) { const std::string& algoac = acConf.getParameter("algoName"); - _allCellsPosCalc = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); + if (!algoac.empty()) + _allCellsPosCalc = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); } // if necessary a third pos calc for convergence testing const auto& convConf = conf.getParameterSet("positionCalcForConvergence"); if (!convConf.empty()) { const std::string& algoconv = convConf.getParameter("algoName"); - _convergencePosCalc = PFCPositionCalculatorFactory::get()->create(algoconv, convConf, cc); + if (!algoconv.empty()) + _convergencePosCalc = PFCPositionCalculatorFactory::get()->create(algoconv, convConf, cc); } } diff --git a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowPositionCalc.cc b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowPositionCalc.cc index 5a77e194f0c41..860614dea52c4 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowPositionCalc.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowPositionCalc.cc @@ -68,11 +68,11 @@ class Basic2DGenericPFlowPositionCalc : public PFCPositionCalculatorBase { _timeResolutionCalcBarrel.reset(nullptr); const auto& timeResConfBarrel = conf.getParameterSet("timeResolutionCalcBarrel"); - if (!timeResConfBarrel.empty()) + if (!timeResConfBarrel.empty() && timeResConfBarrel.getParameter("threshHighE") >= 0) _timeResolutionCalcBarrel = std::make_unique(timeResConfBarrel); _timeResolutionCalcEndcap.reset(nullptr); const auto& timeResConfEndcap = conf.getParameterSet("timeResolutionCalcEndcap"); - if (!timeResConfEndcap.empty()) + if (!timeResConfEndcap.empty() && timeResConfEndcap.getParameter("threshHighE") >= 0) _timeResolutionCalcEndcap = std::make_unique(timeResConfEndcap); switch (_posCalcNCrystals) { diff --git a/RecoParticleFlow/PFClusterProducer/plugins/LegacyPFClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/LegacyPFClusterProducer.cc index 33701815564df..3ab90658ae02c 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/LegacyPFClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/LegacyPFClusterProducer.cc @@ -51,13 +51,15 @@ class LegacyPFClusterProducer : public edm::stream::EDProducer<> { const auto& acConf = pfcConf.getParameterSet("positionCalc"); if (!acConf.empty()) { const std::string& algoac = acConf.getParameter("algoName"); - positionCalc_ = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); + if (!algoac.empty()) + positionCalc_ = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); } const auto& acConf2 = pfcConf.getParameterSet("allCellsPositionCalc"); if (!acConf2.empty()) { const std::string& algoac = acConf2.getParameter("algoName"); - allCellsPositionCalc_ = PFCPositionCalculatorFactory::get()->create(algoac, acConf2, cc); + if (!algoac.empty()) + allCellsPositionCalc_ = PFCPositionCalculatorFactory::get()->create(algoac, acConf2, cc); } } } diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc index 459dc72b0681c..da2c22d2fc63f 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc @@ -68,11 +68,11 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip { edm::ParameterSetDescription psd; psd.add("detector", ""); - psd.addOptional("seedingThreshold", 0); - psd.addOptional("seedingThresholdPt", 0); - psd.addOptional>("depths", {}); - psd.addOptional>("seedingThresholds", {}); - psd.addOptional>("seedingThresholdsPt", {}); + psd.add("seedingThreshold", 0); + psd.add("seedingThresholdPt", 0); + psd.add>("depths", {}); + psd.add>("seedingThresholds", {}); + psd.add>("seedingThresholdsPt", {}); pset.addVPSet("thresholdsByDetector", psd, {}); } desc.add("seedFinder", pset); @@ -83,100 +83,100 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip { edm::ParameterSetDescription psd; psd.add("detector", ""); - psd.addOptional("gatheringThreshold", 0); - psd.addOptional("gatheringThresholdPt", 0); - psd.addOptional>("depths", {}); - psd.addOptional>("gatheringThresholds", {}); - psd.addOptional>("gatheringThresholdsPt", {}); + psd.add("gatheringThreshold", 0); + psd.add("gatheringThresholdPt", 0); + psd.add>("depths", {}); + psd.add>("gatheringThresholds", {}); + psd.add>("gatheringThresholdsPt", {}); pset.addVPSet("thresholdsByDetector", psd, {}); } - pset.addOptional("useCornerCells", false); - pset.addOptional("clusterSrc", {}); - pset.addOptional("filterByTracksterIteration", false); - pset.addOptional("filterByTracksterPID", false); - pset.addOptional>("filter_on_categories", {}); - pset.addOptional>("filter_on_iterations", {}); - pset.addOptional("pid_threshold", 0); - pset.addOptional("tracksterSrc", {}); - pset.addOptional("exclusiveFraction", 0); - pset.addOptional("invisibleFraction", 0); - pset.addOptional("maxDistanceFilter", false); - pset.addOptional("maxDistance", 0); - pset.addOptional("maxDforTimingSquared", 0); - pset.addOptional("timeOffset", 0); - pset.addOptional("minNHitsforTiming", 0); - pset.addOptional("useMCFractionsForExclEnergy", false); - pset.addOptional>("hadronCalib", {}); - pset.addOptional>("egammaCalib", {}); - pset.addOptional("calibMinEta", 0); - pset.addOptional("calibMaxEta", 0); - pset.addOptional("simClusterSrc", {}); + pset.add("useCornerCells", false); + pset.add("clusterSrc", {}); + pset.add("filterByTracksterIteration", false); + pset.add("filterByTracksterPID", false); + pset.add>("filter_on_categories", {}); + pset.add>("filter_on_iterations", {}); + pset.add("pid_threshold", 0); + pset.add("tracksterSrc", {}); + pset.add("exclusiveFraction", 0); + pset.add("invisibleFraction", 0); + pset.add("maxDistanceFilter", false); + pset.add("maxDistance", 0); + pset.add("maxDforTimingSquared", 0); + pset.add("timeOffset", 0); + pset.add("minNHitsforTiming", 0); + pset.add("useMCFractionsForExclEnergy", false); + pset.add>("hadronCalib", {}); + pset.add>("egammaCalib", {}); + pset.add("calibMinEta", 0); + pset.add("calibMaxEta", 0); + pset.add("simClusterSrc", {}); desc.add("initialClusteringStep", pset); } { edm::ParameterSetDescription pset; - pset.addOptional("algoName"); + pset.add("algoName", ""); { edm::ParameterSetDescription pset2; - pset2.addOptional("algoName"); - pset2.addOptional("minFractionInCalc", 0); - pset2.addOptional("posCalcNCrystals", -1); + pset2.add("algoName", ""); + pset2.add("minFractionInCalc", 0); + pset2.add("posCalcNCrystals", -1); { edm::ParameterSetDescription psd; psd.add("detector", ""); psd.add>("depths", {}); psd.add>("logWeightDenominator", {}); - pset2.addVPSetOptional("logWeightDenominatorByDetector", psd, {}); + pset2.addVPSet("logWeightDenominatorByDetector", psd, {}); } - pset2.addOptional("logWeightDenominator", 0); - pset2.addOptional("minAllowedNormalization", 0); + pset2.add("logWeightDenominator", 0); + pset2.add("minAllowedNormalization", 0); { edm::ParameterSetDescription pset3; - pset3.addOptional("constantTerm", 0); - pset3.addOptional("constantTermLowE", 0); - pset3.addOptional("corrTermLowE", 0); - pset3.addOptional("noiseTerm", 0); - pset3.addOptional("noiseTermLowE", 0); - pset3.addOptional("threshHighE", 0); - pset3.addOptional("threshLowE", 0); - pset2.addOptional("timeResolutionCalcBarrel", pset3); - pset2.addOptional("timeResolutionCalcEndcap", pset3); + pset3.add("constantTerm", 0); + pset3.add("constantTermLowE", 0); + pset3.add("corrTermLowE", 0); + pset3.add("noiseTerm", 0); + pset3.add("noiseTermLowE", 0); + pset3.add("threshHighE", -1.); + pset3.add("threshLowE", -1.); + pset2.add("timeResolutionCalcBarrel", pset3); + pset2.add("timeResolutionCalcEndcap", pset3); } - pset.addOptional("allCellsPositionCalc", pset2); - pset.addOptional("positionCalc", pset2); + pset.add("allCellsPositionCalc", pset2); + pset.add("positionCalc", pset2); } - pset.addOptional("minFractionToKeep", 0); - pset.addOptional("nSigmaEta", 0); - pset.addOptional("nSigmaPhi", 0); - pset.addOptional("excludeOtherSeeds", false); - pset.addOptional("maxIterations", 0); - pset.addOptional("minFracTot", 0); + pset.add("minFractionToKeep", 0); + pset.add("nSigmaEta", 0); + pset.add("nSigmaPhi", 0); + pset.add("excludeOtherSeeds", false); + pset.add("maxIterations", 0); + pset.add("minFracTot", 0); { edm::ParameterSetDescription pset2; - pset2.addOptional("algoName"); - pset2.addOptional("minFractionInCalc", 0); - pset2.addOptional("T0_EB", 0); - pset2.addOptional("T0_EE", 0); - pset2.addOptional("T0_ES", 0); - pset2.addOptional("W0", 0); - pset2.addOptional("X0", 0); - pset2.addOptional("minAllowedNormalization", 0); - pset2.addOptional("timeResolutionCalc", {}); - pset.addOptional("positionCalcForConvergence", pset2); + pset2.add("algoName", ""); + pset2.add("minFractionInCalc", 0); + pset2.add("T0_EB", 0); + pset2.add("T0_EE", 0); + pset2.add("T0_ES", 0); + pset2.add("W0", 0); + pset2.add("X0", 0); + pset2.add("minAllowedNormalization", 0); + pset2.add("timeResolutionCalc", {}); + pset.add("positionCalcForConvergence", pset2); } { edm::ParameterSetDescription psd; psd.add("detector", ""); - psd.addOptional("recHitEnergyNorm", 0); - psd.addOptional>("depths", {}); - psd.addOptional>("recHitEnergyNorms", {}); - pset.addVPSetOptional("recHitEnergyNorms", psd); + psd.add("recHitEnergyNorm", 0); + psd.add>("depths", {}); + psd.add>("recHitEnergyNorms", {}); + pset.addVPSet("recHitEnergyNorms", psd, {}); } - pset.addOptional("showerSigma", 1.5); - pset.addOptional("stoppingTolerance", 1e-08); - pset.addOptional("clusterTimeResFromSeed", false); - pset.addOptional("maxNSigmaTime", 10.0); - pset.addOptional("minChi2Prob", 0); + pset.add("showerSigma", 1.5); + pset.add("stoppingTolerance", 1e-08); + pset.add("clusterTimeResFromSeed", false); + pset.add("maxNSigmaTime", 10.0); + pset.add("minChi2Prob", 0); { edm::ParameterSetDescription pset2; pset2.add("constantTerm", 0); @@ -184,27 +184,27 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip pset2.add("corrTermLowE", 0); pset2.add("noiseTerm", 0); pset2.add("noiseTermLowE", 0); - pset2.add("threshHighE", 0); - pset2.add("threshLowE", 0); - pset.addOptional("timeResolutionCalcBarrel", pset2); - pset.addOptional("timeResolutionCalcEndcap", pset2); + pset2.add("threshHighE", -1.); + pset2.add("threshLowE", -1.); + pset.add("timeResolutionCalcBarrel", pset2); + pset.add("timeResolutionCalcEndcap", pset2); } - pset.addOptional("timeSigmaEB", 10.0); - pset.addOptional("timeSigmaEE", 10.0); + pset.add("timeSigmaEB", 10.0); + pset.add("timeSigmaEE", 10.0); desc.add("pfClusterBuilder", pset); } { edm::ParameterSetDescription pset; - pset.addOptional("algoName"); - pset.addOptional("minFractionInCalc", 0); - pset.addOptional("updateTiming", false); - pset.addOptional("T0_EB", 0); - pset.addOptional("T0_EE", 0); - pset.addOptional("T0_ES", 0); - pset.addOptional("W0", 0); - pset.addOptional("X0", 0); - pset.addOptional("minAllowedNormalization", 0); - pset.addOptional("timeResolutionCalc", {}); + pset.add("algoName", ""); + pset.add("minFractionInCalc", 0); + pset.add("updateTiming", false); + pset.add("T0_EB", 0); + pset.add("T0_EE", 0); + pset.add("T0_ES", 0); + pset.add("W0", 0); + pset.add("X0", 0); + pset.add("minAllowedNormalization", 0); + pset.add("timeResolutionCalc", {}); desc.add("positionReCalc", pset); } desc.add("energyCorrector", {}); @@ -260,19 +260,22 @@ PFClusterProducer::PFClusterProducer(const edm::ParameterSet& conf) const edm::ParameterSet& pfcConf = conf.getParameterSet("pfClusterBuilder"); if (!pfcConf.empty()) { const std::string& pfcName = pfcConf.getParameter("algoName"); - _pfClusterBuilder = PFClusterBuilderFactory::get()->create(pfcName, pfcConf, cc); + if (!pfcName.empty()) + _pfClusterBuilder = PFClusterBuilderFactory::get()->create(pfcName, pfcConf, cc); } //setup (possible) recalcuation of positions const edm::ParameterSet& pConf = conf.getParameterSet("positionReCalc"); if (!pConf.empty()) { const std::string& pName = pConf.getParameter("algoName"); - _positionReCalc = PFCPositionCalculatorFactory::get()->create(pName, pConf, cc); + if (!pName.empty()) + _positionReCalc = PFCPositionCalculatorFactory::get()->create(pName, pConf, cc); } // see if new need to apply corrections, setup if there. const edm::ParameterSet& cConf = conf.getParameterSet("energyCorrector"); if (!cConf.empty()) { const std::string& cName = cConf.getParameter("algoName"); - _energyCorrector = PFClusterEnergyCorrectorFactory::get()->create(cName, cConf); + if (!cName.empty()) + _energyCorrector = PFClusterEnergyCorrectorFactory::get()->create(cName, cConf); } if (_prodInitClusters) { diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc index bd6e553fce41d..8885e89c3a02c 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterProducer.cc @@ -54,7 +54,7 @@ void PFMultiDepthClusterProducer::fillDescriptions(edm::ConfigurationDescription { edm::ParameterSetDescription psd; psd.add>("depths", {}); - psd.add("detector"); + psd.add("detector", ""); psd.add>("logWeightDenominator", {}); pset1.addVPSet("logWeightDenominatorByDetector", psd, {}); } @@ -101,13 +101,15 @@ PFMultiDepthClusterProducer::PFMultiDepthClusterProducer(const edm::ParameterSet if (!pfcConf.empty()) { const std::string& pfcName = pfcConf.getParameter("algoName"); - _pfClusterBuilder = PFClusterBuilderFactory::get()->create(pfcName, pfcConf, cc); + if (!pfcName.empty()) + _pfClusterBuilder = PFClusterBuilderFactory::get()->create(pfcName, pfcConf, cc); } // see if new need to apply corrections, setup if there. const edm::ParameterSet& cConf = conf.getParameterSet("energyCorrector"); if (!cConf.empty()) { const std::string& cName = cConf.getParameter("algoName"); - _energyCorrector = PFClusterEnergyCorrectorFactory::get()->create(cName, cConf); + if (!cName.empty()) + _energyCorrector = PFClusterEnergyCorrectorFactory::get()->create(cName, cConf); } produces(); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterizer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterizer.cc index 24bea0a22ec0c..056329a5da671 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterizer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFMultiDepthClusterizer.cc @@ -83,7 +83,8 @@ PFMultiDepthClusterizer::PFMultiDepthClusterizer(const edm::ParameterSet& conf, const auto& acConf = conf.getParameterSet("allCellsPositionCalc"); if (!acConf.empty()) { const std::string& algoac = acConf.getParameter("algoName"); - _allCellsPosCalc = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); + if (!algoac.empty()) + _allCellsPosCalc = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); } nSigmaEta_ = pow(conf.getParameter("nSigmaEta"), 2); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc index 4f0b15c29f8dc..a80a6adceedd1 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc @@ -104,16 +104,16 @@ void PFRecHitProducer::fillDescriptions(edm::ConfigurationDescriptions& descript { edm::ParameterSetDescription pset; pset.add("name", ""); - pset.addOptional>("hcalEnums", {}); - pset.addOptional("barrel", {}); - pset.addOptional("endcap", {}); + pset.add>("hcalEnums", {}); + pset.add("barrel", {}); + pset.add("endcap", {}); { edm::ParameterSetDescription pset2; pset2.add("name", ""); pset2.add("topologySource", ""); - pset.addOptional("hgcee", pset2); - pset.addOptional("hgcheb", pset2); - pset.addOptional("hgchef", pset2); + pset.add("hgcee", pset2); + pset.add("hgcheb", pset2); + pset.add("hgchef", pset2); } desc.add("navigator", pset); } @@ -124,38 +124,38 @@ void PFRecHitProducer::fillDescriptions(edm::ConfigurationDescriptions& descript { edm::ParameterSetDescription psd2; psd2.add("name", ""); - psd2.addOptional>("maxSeverities", {}); - psd2.addOptional>("cleaningThresholds", {}); - psd2.addOptional>("flags", {}); - psd2.addOptional("usePFThresholdsFromDB", false); + psd2.add>("maxSeverities", {}); + psd2.add>("cleaningThresholds", {}); + psd2.add>("flags", {}); + psd2.add("usePFThresholdsFromDB", false); { edm::ParameterSetDescription psd3; psd3.add>("depth", {}); psd3.add>("threshold", {}); psd3.add("detectorEnum", 0); - psd2.addVPSetOptional("cuts", psd3, {}); + psd2.addVPSet("cuts", psd3, {}); } - psd2.addOptional("thresholdSNR", 0); - psd2.addOptional("applySelectionsToAllCrystals", false); - psd2.addOptional("cleaningThreshold", 0); - psd2.addOptional("timingCleaning", false); - psd2.addOptional("topologicalCleaning", false); - psd2.addOptional("skipTTRecoveredHits", false); - psd2.addOptional("threshold", 0); - psd2.addOptional("threshold_ring0", 0); - psd2.addOptional("threshold_ring12", 0); + psd2.add("thresholdSNR", 0); + psd2.add("applySelectionsToAllCrystals", false); + psd2.add("cleaningThreshold", 0); + psd2.add("timingCleaning", false); + psd2.add("topologicalCleaning", false); + psd2.add("skipTTRecoveredHits", false); + psd2.add("threshold", 0); + psd2.add("threshold_ring0", 0); + psd2.add("threshold_ring12", 0); psd.addVPSet("qualityTests", psd2, {}); } - psd.addOptional("EMDepthCorrection", 0); - psd.addOptional("HADDepthCorrection", 0); - psd.addOptional("thresh_HF", 0); - psd.addOptional("ShortFibre_Cut", 0); - psd.addOptional("LongFibre_Fraction", 0); - psd.addOptional("LongFibre_Cut", 0); - psd.addOptional("ShortFibre_Fraction", 0); - psd.addOptional("HFCalib29", 0); - psd.addOptional("srFlags", {}); - psd.addOptional("geometryInstance"); + psd.add("EMDepthCorrection", 0); + psd.add("HADDepthCorrection", 0); + psd.add("thresh_HF", 0); + psd.add("ShortFibre_Cut", 0); + psd.add("LongFibre_Fraction", 0); + psd.add("LongFibre_Cut", 0); + psd.add("ShortFibre_Fraction", 0); + psd.add("HFCalib29", 0); + psd.add("srFlags", {}); + psd.add("geometryInstance", ""); desc.addVPSet("producers", psd, {}); } descriptions.addWithDefaultLabel(desc); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFlow2DClusterizerWithTime.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFlow2DClusterizerWithTime.cc index 684f33f9e293a..9021783922ef4 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFlow2DClusterizerWithTime.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFlow2DClusterizerWithTime.cc @@ -133,13 +133,15 @@ PFlow2DClusterizerWithTime::PFlow2DClusterizerWithTime(const edm::ParameterSet& const auto& acConf = conf.getParameterSet("allCellsPositionCalc"); if (!acConf.empty()) { const std::string& algoac = acConf.getParameter("algoName"); - _allCellsPosCalc = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); + if (!algoac.empty()) + _allCellsPosCalc = PFCPositionCalculatorFactory::get()->create(algoac, acConf, cc); } // if necessary a third pos calc for convergence testing const auto& convConf = conf.getParameterSet("positionCalcForConvergence"); if (!convConf.empty()) { const std::string& algoconv = convConf.getParameter("algoName"); - _convergencePosCalc = PFCPositionCalculatorFactory::get()->create(algoconv, convConf, cc); + if (!algoconv.empty()) + _convergencePosCalc = PFCPositionCalculatorFactory::get()->create(algoconv, convConf, cc); } const auto& timeResConfBarrel = conf.getParameterSet("timeResolutionCalcBarrel"); if (!timeResConfBarrel.empty()) diff --git a/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc b/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc index b1960ccffbe97..82273b24aeec7 100644 --- a/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc +++ b/RecoParticleFlow/PFProducer/plugins/PFBlockProducer.cc @@ -158,39 +158,39 @@ void PFBlockProducer::fillDescriptions(edm::ConfigurationDescriptions& descripti vpset.emplace_back(pset); } edm::ParameterSetDescription psd; - psd.add("importerName"); + psd.add("importerName", ""); psd.add("source", {}); - psd.addOptional("gsfsAreSecondary", false); - psd.addOptional("superClustersArePF", false); - psd.addOptional("source_eb", {}); - psd.addOptional("source_ee", {}); - psd.addOptional("maximumHoverE", 1E9); - psd.addOptional("minSuperClusterPt", -1); - psd.addOptional("minPTforBypass", -1); - psd.addOptional("hbheRecHitsTag", {}); - psd.addOptional("maxSeverityHB", 1E9); - psd.addOptional("maxSeverityHE", 1E9); - psd.addOptional("usePFThresholdsFromDB", false); - psd.addOptional("vetoEndcap", false); - psd.addOptional("muonSrc", {}); - psd.addOptional("trackQuality"); - psd.addOptional("cleanBadConvertedBrems", false); - psd.addOptional("useIterativeTracking", false); - psd.addOptional>("DPtOverPtCuts_byTrackAlgo", {}); - psd.addOptional>("NHitCuts_byTrackAlgo", {}); - psd.addOptional("muonMaxDPtOPt", 1E9); - psd.addOptional("BCtoPFCMap", {}); - psd.addOptional("maxDPtOPt", 1E9); - psd.addOptional("vetoMode", 0); - psd.addOptional("vetoSrc", {}); - psd.addOptional("timeValueMap", {}); - psd.addOptional("timeErrorMap", {}); - psd.addOptional("timeQualityMap", {}); - psd.addOptional("timeQualityThreshold", 0); - psd.addOptional("timeValueMapGsf", {}); - psd.addOptional("timeErrorMapGsf", {}); - psd.addOptional("timeQualityMapGsf", {}); - psd.addOptional("useTimeQuality", false); + psd.add("gsfsAreSecondary", false); + psd.add("superClustersArePF", false); + psd.add("source_eb", {}); + psd.add("source_ee", {}); + psd.add("maximumHoverE", 0); + psd.add("minSuperClusterPt", 0); + psd.add("minPTforBypass", 0); + psd.add("hbheRecHitsTag", {}); + psd.add("maxSeverityHB", 0); + psd.add("maxSeverityHE", 0); + psd.add("usePFThresholdsFromDB", false); + psd.add("vetoEndcap", false); + psd.add("muonSrc", {}); + psd.add("trackQuality", ""); + psd.add("cleanBadConvertedBrems", false); + psd.add("useIterativeTracking", false); + psd.add>("DPtOverPtCuts_byTrackAlgo", {}); + psd.add>("NHitCuts_byTrackAlgo", {}); + psd.add("muonMaxDPtOPt", 0); + psd.add("BCtoPFCMap", {}); + psd.add("maxDPtOPt", 0); + psd.add("vetoMode", 0); + psd.add("vetoSrc", {}); + psd.add("timeValueMap", {}); + psd.add("timeErrorMap", {}); + psd.add("timeQualityMap", {}); + psd.add("timeQualityThreshold", 0); + psd.add("timeValueMapGsf", {}); + psd.add("timeErrorMapGsf", {}); + psd.add("timeQualityMapGsf", {}); + psd.add("useTimeQuality", false); desc.addVPSet("elementImporters", psd, vpset); } //linking definitions @@ -337,15 +337,15 @@ void PFBlockProducer::fillDescriptions(edm::ConfigurationDescriptions& descripti vpset.emplace_back(pset); } edm::ParameterSetDescription psd; - psd.add("linkerName"); - psd.add("linkType"); + psd.add("linkerName", ""); + psd.add("linkType", ""); psd.add("useKDTree", false); - psd.addOptional("trajectoryLayerEntrance"); - psd.addOptional("trajectoryLayerExit"); - psd.addOptional("nMaxHcalLinksPerTrack", 0); - psd.addOptional("minAbsEtaEcal", -1); - psd.addOptional("useConvertedBrems", false); - psd.addOptional("SuperClusterMatchByRef", false); + psd.add("trajectoryLayerEntrance", ""); + psd.add("trajectoryLayerExit", ""); + psd.add("nMaxHcalLinksPerTrack", 0); + psd.add("minAbsEtaEcal", 0); + psd.add("useConvertedBrems", false); + psd.add("SuperClusterMatchByRef", false); desc.addVPSet("linkDefinitions", psd, vpset); } descriptions.addWithDefaultLabel(desc); diff --git a/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc b/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc index e7fc86cf18432..10c9972881d01 100644 --- a/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc +++ b/RecoParticleFlow/PFRecHitProducer/test/PFRecHitProducerTest.cc @@ -214,7 +214,7 @@ void PFRecHitProducerTest::dumpEvent(const edm::Event& event, void PFRecHitProducerTest::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - desc.addOptionalUntracked("caloRecHits") + desc.addUntracked("caloRecHits", {}) ->setComment("CaloRecHitSoA, if supplied, it is dumped alongside the PFRecHits"); desc.addUntracked("pfRecHitsSource1")->setComment("First PFRecHit list for comparison"); desc.addUntracked("pfRecHitsSource2")->setComment("Second PFRecHit list for comparison"); diff --git a/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc b/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc index 520078d482276..2567f45850086 100644 --- a/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc +++ b/RecoParticleFlow/PFSimProducer/plugins/SimPFProducer.cc @@ -97,13 +97,13 @@ void SimPFProducer::fillDescriptions(edm::ConfigurationDescriptions& description // if useTiming_ desc.add("useTiming", false); desc.add("useTimingQuality", false); - desc.addOptional("trackTimeValueMap"); - desc.addOptional("trackTimeErrorMap"); - desc.addOptional("trackTimeQualityMap"); - desc.addOptional("timingQualityThreshold"); - desc.addOptional("gsfTrackTimeValueMap"); - desc.addOptional("gsfTrackTimeErrorMap"); - desc.addOptional("gsfTrackTimeQualityMap"); + desc.add("trackTimeValueMap", {}); + desc.add("trackTimeErrorMap", {}); + desc.add("trackTimeQualityMap", {}); + desc.add("timingQualityThreshold", 0); + desc.add("gsfTrackTimeValueMap", {}); + desc.add("gsfTrackTimeErrorMap", {}); + desc.add("gsfTrackTimeQualityMap", {}); descriptions.addWithDefaultLabel(desc); } From 9fee0bbed1f2099220fa99c13d22fcc9c84e62fe Mon Sep 17 00:00:00 2001 From: Andre Govinda Stahl Leiton Date: Wed, 19 Jun 2024 02:40:13 +0200 Subject: [PATCH 7/7] Undo the renaming of gathering, seeding and reHitEnergyNorm double vectors --- .../modules/hltParticleFlowClusterHBHE_cfi.py | 20 ++++---- .../python/customizeHLTforCMSSW.py | 29 +---------- .../interface/InitialClusteringStepBase.h | 4 +- .../plugins/Basic2DGenericPFlowClusterizer.cc | 2 +- .../plugins/LocalMaximumSeedFinder.cc | 4 +- .../plugins/PFClusterProducer.cc | 26 +++++----- .../particleFlowClusterECALUncorrected_cfi.py | 4 +- .../python/particleFlowClusterHBHE_cfi.py | 48 +++++++++---------- .../python/particleFlowClusterHCAL_cfi.py | 5 +- .../python/particleFlowClusterHF_cfi.py | 6 +-- .../python/particleFlowClusterHO_cfi.py | 6 +-- .../python/particleFlowClusterPS_cfi.py | 7 +-- 12 files changed, 57 insertions(+), 104 deletions(-) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py index f7983b260e7b4..552b0472cff12 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltParticleFlowClusterHBHE_cfi.py @@ -10,8 +10,8 @@ cms.PSet( depths = cms.vint32(1, 2, 3, 4), detector = cms.string('HCAL_BARREL1'), - gatheringThresholds = cms.vdouble(0.1, 0.2, 0.3, 0.3), - gatheringThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) + gatheringThreshold = cms.vdouble(0.1, 0.2, 0.3, 0.3), + gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) ), cms.PSet( depths = cms.vint32( @@ -19,11 +19,11 @@ 6, 7 ), detector = cms.string('HCAL_ENDCAP'), - gatheringThresholds = cms.vdouble( + gatheringThreshold = cms.vdouble( 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2 ), - gatheringThresholdsPt = cms.vdouble( + gatheringThresholdPt = cms.vdouble( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) @@ -92,7 +92,7 @@ cms.PSet( depths = cms.vint32(1, 2, 3, 4), detector = cms.string('HCAL_BARREL1'), - recHitEnergyNorms = cms.vdouble(0.1, 0.2, 0.3, 0.3) + recHitEnergyNorm = cms.vdouble(0.1, 0.2, 0.3, 0.3) ), cms.PSet( depths = cms.vint32( @@ -100,7 +100,7 @@ 6, 7 ), detector = cms.string('HCAL_ENDCAP'), - recHitEnergyNorms = cms.vdouble( + recHitEnergyNorm = cms.vdouble( 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2 ) @@ -142,8 +142,8 @@ cms.PSet( depths = cms.vint32(1, 2, 3, 4), detector = cms.string('HCAL_BARREL1'), - seedingThresholds = cms.vdouble(0.125, 0.25, 0.35, 0.35), - seedingThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) + seedingThreshold = cms.vdouble(0.125, 0.25, 0.35, 0.35), + seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) ), cms.PSet( depths = cms.vint32( @@ -151,11 +151,11 @@ 6, 7 ), detector = cms.string('HCAL_ENDCAP'), - seedingThresholds = cms.vdouble( + seedingThreshold = cms.vdouble( 0.1375, 0.275, 0.275, 0.275, 0.275, 0.275, 0.275 ), - seedingThresholdsPt = cms.vdouble( + seedingThresholdPt = cms.vdouble( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 6000de4aace86..86a58c7de66d2 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -52,8 +52,8 @@ def customiseHCALFor2018Input(process): for producer in producers_by_type(process, "PFClusterProducer"): if producer.seedFinder.thresholdsByDetector[0].detector.value() == 'HCAL_BARREL1': - producer.seedFinder.thresholdsByDetector[0].seedingThresholds = _seedingThresholdsHB - producer.initialClusteringStep.thresholdsByDetector[0].gatheringThresholds = _thresholdsHB + producer.seedFinder.thresholdsByDetector[0].seedingThreshold = _seedingThresholdsHB + producer.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = _thresholdsHB producer.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = _thresholdsHB producer.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018 producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018 @@ -314,30 +314,6 @@ def customizeHLTfor45063(process): delattr(prod,"mvaScaleStdEL2") return process - -def customizeHLTfor45212(process): - # Fix types for gathering and seeding thresholds, and recHitEnergyNorm - for prod in producers_by_type(process, 'PFClusterProducer'): - if hasattr(prod, "initialClusteringStep") and hasattr(prod.initialClusteringStep, "thresholdsByDetector"): - if hasattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThreshold") and isinstance(prod.initialClusteringStep.thresholdsByDetector.gatheringThreshold, cms.vdouble): - prod.initialClusteringStep.thresholdsByDetector.gatheringThresholds = prod.initialClusteringStep.thresholdsByDetector.gatheringThreshold - delattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThreshold") - if hasattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThresholdPt") and isinstance(prod.initialClusteringStep.thresholdsByDetector.gatheringThresholdPt, cms.vdouble): - prod.initialClusteringStep.thresholdsByDetector.gatheringThresholdsPt = prod.initialClusteringStep.thresholdsByDetector.gatheringThresholdPt - delattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThresholdPt") - if hasattr(prod, "seedFinder") and hasattr(prod.seedFinder, "thresholdsByDetector"): - if hasattr(prod.seedFinder.thresholdsByDetector, "seedingThreshold") and isinstance(prod.seedFinder.thresholdsByDetector.seedingThreshold, cms.vdouble): - prod.seedFinder.thresholdsByDetector.seedingThresholds = prod.seedFinder.thresholdsByDetector.seedingThreshold - delattr(prod.seedFinder.thresholdsByDetector, "seedingThreshold") - if hasattr(prod.seedFinder.thresholdsByDetector, "seedingThresholdPt") and isinstance(prod.seedFinder.thresholdsByDetector.seedingThresholdPt, cms.vdouble): - prod.seedFinder.thresholdsByDetector.seedingThresholdsPt = prod.seedFinder.thresholdsByDetector.seedingThresholdPt - delattr(prod.seedFinder.thresholdsByDetector, "seedingThresholdPt") - for n in ["positionCalc", "allCellsPositionCalc"]: - if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, n) and hasattr(getattr(prod.pfClusterBuilder, n), "recHitEnergyNorms") and hasattr(getattr(prod.pfClusterBuilder, n).recHitEnergyNorms, "recHitEnergyNorm") and isinstance(getattr(prod.pfClusterBuilder, n).recHitEnergyNorms.recHitEnergyNorm, cms.vdouble): - getattr(prod.pfClusterBuilder, n).recHitEnergyNorms.recHitEnergyNorms = getattr(prod.pfClusterBuilder, n).recHitEnergyNorms.recHitEnergyNorm - delattr(getattr(prod.pfClusterBuilder, n).recHitEnergyNorms, "recHitEnergyNorm") - - return process # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): @@ -350,6 +326,5 @@ def customizeHLTforCMSSW(process, menuType="GRun"): process = checkHLTfor43774(process) process = customizeHLTfor44576(process) process = customizeHLTfor45063(process) - process = customizeHLTfor45212(process) return process diff --git a/RecoParticleFlow/PFClusterProducer/interface/InitialClusteringStepBase.h b/RecoParticleFlow/PFClusterProducer/interface/InitialClusteringStepBase.h index 07a6e547f6607..f70e7b6f35440 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/InitialClusteringStepBase.h +++ b/RecoParticleFlow/PFClusterProducer/interface/InitialClusteringStepBase.h @@ -54,8 +54,8 @@ class InitialClusteringStepBase { if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) { depths = pset.getParameter >("depths"); - thresh_E = pset.getParameter >("gatheringThresholds"); - thresh_pT = pset.getParameter >("gatheringThresholdsPt"); + thresh_E = pset.getParameter >("gatheringThreshold"); + thresh_pT = pset.getParameter >("gatheringThresholdPt"); if (thresh_E.size() != depths.size() || thresh_pT.size() != depths.size()) { throw cms::Exception("InvalidGatheringThreshold") << "gatheringThresholds mismatch with the numbers of depths"; diff --git a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc index 8e6adb499af9d..925a8a6db8705 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/Basic2DGenericPFlowClusterizer.cc @@ -106,7 +106,7 @@ Basic2DGenericPFlowClusterizer::Basic2DGenericPFlowClusterizer(const edm::Parame if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) { depths = pset.getParameter >("depths"); - rhE_norm = pset.getParameter >("recHitEnergyNorms"); + rhE_norm = pset.getParameter >("recHitEnergyNorm"); } else { depths.push_back(0); rhE_norm.push_back(pset.getParameter("recHitEnergyNorm")); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/LocalMaximumSeedFinder.cc b/RecoParticleFlow/PFClusterProducer/plugins/LocalMaximumSeedFinder.cc index 2b0539cf78eff..86bccb6dbaf7b 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/LocalMaximumSeedFinder.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/LocalMaximumSeedFinder.cc @@ -67,8 +67,8 @@ LocalMaximumSeedFinder::LocalMaximumSeedFinder(const edm::ParameterSet& conf) if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) { depths = pset.getParameter >("depths"); - thresh_E = pset.getParameter >("seedingThresholds"); - thresh_pT = pset.getParameter >("seedingThresholdsPt"); + thresh_E = pset.getParameter >("seedingThreshold"); + thresh_pT = pset.getParameter >("seedingThresholdPt"); if (thresh_E.size() != depths.size() || thresh_pT.size() != depths.size()) { throw cms::Exception("InvalidGatheringThreshold") << "gatheringThresholds mismatch with the numbers of depths"; } diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc index da2c22d2fc63f..4650a8b6f6450 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc @@ -68,11 +68,11 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip { edm::ParameterSetDescription psd; psd.add("detector", ""); - psd.add("seedingThreshold", 0); - psd.add("seedingThresholdPt", 0); - psd.add>("depths", {}); - psd.add>("seedingThresholds", {}); - psd.add>("seedingThresholdsPt", {}); + psd.addNode((edm::ParameterDescription("seedingThreshold", 0, true) and + edm::ParameterDescription("seedingThresholdPt", 0, true)) xor + (edm::ParameterDescription>("depths", {}, true) and + edm::ParameterDescription>("seedingThreshold", {}, true) and + edm::ParameterDescription>("seedingThresholdPt", {}, true))); pset.addVPSet("thresholdsByDetector", psd, {}); } desc.add("seedFinder", pset); @@ -83,11 +83,11 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip { edm::ParameterSetDescription psd; psd.add("detector", ""); - psd.add("gatheringThreshold", 0); - psd.add("gatheringThresholdPt", 0); - psd.add>("depths", {}); - psd.add>("gatheringThresholds", {}); - psd.add>("gatheringThresholdsPt", {}); + psd.addNode((edm::ParameterDescription("gatheringThreshold", 0, true) and + edm::ParameterDescription("gatheringThresholdPt", 0, true)) xor + (edm::ParameterDescription>("depths", {}, true) and + edm::ParameterDescription>("gatheringThreshold", {}, true) and + edm::ParameterDescription>("gatheringThresholdPt", {}, true))); pset.addVPSet("thresholdsByDetector", psd, {}); } pset.add("useCornerCells", false); @@ -167,9 +167,9 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip { edm::ParameterSetDescription psd; psd.add("detector", ""); - psd.add("recHitEnergyNorm", 0); - psd.add>("depths", {}); - psd.add>("recHitEnergyNorms", {}); + psd.addNode(edm::ParameterDescription("recHitEnergyNorm", 0, true) xor + (edm::ParameterDescription>("depths", {}, true) and + edm::ParameterDescription>("recHitEnergyNorm", {}, true))); pset.addVPSet("recHitEnergyNorms", psd, {}); } pset.add("showerSigma", 1.5); diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALUncorrected_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALUncorrected_cfi.py index cd5b74231d3bb..e86856d6a048b 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALUncorrected_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterECALUncorrected_cfi.py @@ -86,7 +86,6 @@ minFractionInCalc = cms.double(1e-9), posCalcNCrystals = cms.int32(-1), logWeightDenominator = cms.double(0.08), # same as gathering threshold - logWeightDenominatorByDetector = cms.VPSet(), minAllowedNormalization = cms.double(1e-9), timeResolutionCalcBarrel = _timeResolutionECALBarrel, timeResolutionCalcEndcap = _timeResolutionECALEndcap, @@ -103,8 +102,7 @@ T0_EE = cms.double(3.1), T0_ES = cms.double(1.2), W0 = cms.double(4.2), - X0 = cms.double(0.89), - timeResolutionCalc = cms.PSet() + X0 = cms.double(0.89) ) # pf clustering diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py index 72443bcf90fd6..36b780828dbb2 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHBHE_cfi.py @@ -27,13 +27,13 @@ thresholdsByDetector = cms.VPSet( cms.PSet( detector = cms.string("HCAL_BARREL1"), depths = cms.vint32(1, 2, 3, 4), - seedingThresholds = _seedingThresholdsHB, - seedingThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) + seedingThreshold = _seedingThresholdsHB, + seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) ), cms.PSet( detector = cms.string("HCAL_ENDCAP"), depths = cms.vint32(1, 2, 3, 4, 5, 6, 7), - seedingThresholds = _seedingThresholdsHE, - seedingThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) + seedingThreshold = _seedingThresholdsHE, + seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ) ), nNeighbours = cms.int32(4), @@ -43,13 +43,13 @@ thresholdsByDetector = cms.VPSet( cms.PSet( detector = cms.string("HCAL_BARREL1"), depths = cms.vint32(1, 2, 3, 4), - gatheringThresholds = _thresholdsHB, - gatheringThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) + gatheringThreshold = _thresholdsHB, + gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0) ), cms.PSet( detector = cms.string("HCAL_ENDCAP"), depths = cms.vint32(1, 2, 3, 4, 5, 6, 7), - gatheringThresholds = _thresholdsHE, - gatheringThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) + gatheringThreshold = _thresholdsHE, + gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ) ), useCornerCells = cms.bool(True) @@ -73,9 +73,7 @@ logWeightDenominator = _thresholdsHE, ) ), - minAllowedNormalization = cms.double(1e-9), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + minAllowedNormalization = cms.double(1e-9) ), allCellsPositionCalc =cms.PSet( algoName = cms.string("Basic2DGenericPFlowPositionCalc"), @@ -91,11 +89,9 @@ logWeightDenominator = _thresholdsHE, ) ), - minAllowedNormalization = cms.double(1e-9), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + minAllowedNormalization = cms.double(1e-9) ), - positionCalcForConvergence = cms.PSet(), + timeSigmaEB = cms.double(10.), timeSigmaEE = cms.double(10.), @@ -112,11 +108,11 @@ recHitEnergyNorms = cms.VPSet( cms.PSet( detector = cms.string("HCAL_BARREL1"), depths = cms.vint32(1, 2, 3, 4), - recHitEnergyNorms = _thresholdsHB, + recHitEnergyNorm = _thresholdsHB, ), cms.PSet( detector = cms.string("HCAL_ENDCAP"), depths = cms.vint32(1, 2, 3, 4, 5, 6, 7), - recHitEnergyNorms = _thresholdsHE, + recHitEnergyNorm = _thresholdsHE, ) ) ), @@ -130,10 +126,10 @@ from Configuration.Eras.Modifier_run2_HE_2018_cff import run2_HE_2018 from Configuration.ProcessModifiers.run2_HECollapse_2018_cff import run2_HECollapse_2018 (run2_HE_2018 & ~run2_HECollapse_2018).toModify(particleFlowClusterHBHE, - seedFinder = dict(thresholdsByDetector = {1 : dict(seedingThresholds = _seedingThresholdsHEphase1) } ), - initialClusteringStep = dict(thresholdsByDetector = {1 : dict(gatheringThresholds = _thresholdsHEphase1) } ), + seedFinder = dict(thresholdsByDetector = {1 : dict(seedingThreshold = _seedingThresholdsHEphase1) } ), + initialClusteringStep = dict(thresholdsByDetector = {1 : dict(gatheringThreshold = _thresholdsHEphase1) } ), pfClusterBuilder = dict( - recHitEnergyNorms = {1 : dict(recHitEnergyNorms = _thresholdsHEphase1) }, + recHitEnergyNorms = {1 : dict(recHitEnergyNorm = _thresholdsHEphase1) }, positionCalc = dict(logWeightDenominatorByDetector = {1 : dict(logWeightDenominator = _thresholdsHEphase1) } ), allCellsPositionCalc = dict(logWeightDenominatorByDetector = {1 : dict(logWeightDenominator = _thresholdsHEphase1) } ), ), @@ -142,10 +138,10 @@ # offline 2019 from Configuration.Eras.Modifier_run3_HB_cff import run3_HB run3_HB.toModify(particleFlowClusterHBHE, - seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThresholds = _seedingThresholdsHBphase1) } ), - initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThresholds = _thresholdsHBphase1) } ), + seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThreshold = _seedingThresholdsHBphase1) } ), + initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThreshold = _thresholdsHBphase1) } ), pfClusterBuilder = dict( - recHitEnergyNorms = {0 : dict(recHitEnergyNorms = _thresholdsHBphase1) }, + recHitEnergyNorms = {0 : dict(recHitEnergyNorm = _thresholdsHBphase1) }, positionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1) } ), allCellsPositionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1) } ), ), @@ -154,10 +150,10 @@ # offline 2023 from Configuration.Eras.Modifier_run3_egamma_2023_cff import run3_egamma_2023 run3_egamma_2023.toModify(particleFlowClusterHBHE, - seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThresholds = _seedingThresholdsHBphase1_2023) } ), - initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThresholds = _thresholdsHBphase1_2023) } ), + seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThreshold = _seedingThresholdsHBphase1_2023) } ), + initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThreshold = _thresholdsHBphase1_2023) } ), pfClusterBuilder = dict( - recHitEnergyNorms = {0 : dict(recHitEnergyNorms = _thresholdsHBphase1_2023) }, + recHitEnergyNorms = {0 : dict(recHitEnergyNorm = _thresholdsHBphase1_2023) }, positionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1_2023) } ), allCellsPositionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1_2023) } ), ), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHCAL_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHCAL_cfi.py index aea12920cb824..ebab00eafee74 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHCAL_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHCAL_cfi.py @@ -16,7 +16,6 @@ nSigmaPhi = cms.double(2.), #pf clustering parameters minFractionToKeep = cms.double(1e-7), - positionCalc = cms.PSet(), allCellsPositionCalc = cms.PSet( algoName = cms.string("Basic2DGenericPFlowPositionCalc"), minFractionInCalc = cms.double(1e-9), @@ -31,9 +30,7 @@ logWeightDenominator = _thresholdsHE, ) ), - minAllowedNormalization = cms.double(1e-9), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + minAllowedNormalization = cms.double(1e-9) ) ), positionReCalc = cms.PSet(), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHF_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHF_cfi.py index 6559b47839370..76aa58c69f062 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHF_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHF_cfi.py @@ -72,10 +72,7 @@ minFractionInCalc = cms.double(1e-9), posCalcNCrystals = cms.int32(5), logWeightDenominator = cms.double(0.8), # same as gathering threshold - logWeightDenominatorByDetector = cms.VPSet(), - minAllowedNormalization = cms.double(1e-9), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + minAllowedNormalization = cms.double(1e-9) ) _positionCalcHF_all_nodepth = _positionCalcHF_cross_nodepth.clone( @@ -89,7 +86,6 @@ minFractionToKeep = cms.double(1e-7), positionCalc = _positionCalcHF_cross_nodepth, allCellsPositionCalc = _positionCalcHF_all_nodepth, - positionCalcForConvergence = cms.PSet(), showerSigma = cms.double(10.0), stoppingTolerance = cms.double(1e-8), maxIterations = cms.uint32(50), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHO_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHO_cfi.py index 7af2c636de8b3..6d1fbfc4da45d 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHO_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterHO_cfi.py @@ -45,10 +45,7 @@ minFractionInCalc = cms.double(1e-9), posCalcNCrystals = cms.int32(5), logWeightDenominator = cms.double(0.5), # same as gathering threshold - logWeightDenominatorByDetector = cms.VPSet(), - minAllowedNormalization = cms.double(1e-9), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + minAllowedNormalization = cms.double(1e-9) ) _positionCalcHO_all_nodepth = _positionCalcHO_cross_nodepth.clone( @@ -62,7 +59,6 @@ minFractionToKeep = cms.double(1e-7), positionCalc = _positionCalcHO_cross_nodepth, allCellsPositionCalc = _positionCalcHO_all_nodepth, - positionCalcForConvergence = cms.PSet(), showerSigma = cms.double(10.0), stoppingTolerance = cms.double(1e-8), maxIterations = cms.uint32(50), diff --git a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterPS_cfi.py b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterPS_cfi.py index 15a0b08b5180f..d2b9c8ae2ec08 100644 --- a/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterPS_cfi.py +++ b/RecoParticleFlow/PFClusterProducer/python/particleFlowClusterPS_cfi.py @@ -44,10 +44,7 @@ minFractionInCalc = cms.double(1e-9), posCalcNCrystals = cms.int32(-1), logWeightDenominator = cms.double(6e-5), # same as gathering threshold - logWeightDenominatorByDetector = cms.VPSet(), - minAllowedNormalization = cms.double(1e-9), - timeResolutionCalcBarrel = cms.PSet(), - timeResolutionCalcEndcap = cms.PSet() + minAllowedNormalization = cms.double(1e-9) ) #pf clustering @@ -56,8 +53,6 @@ #pf clustering parameters minFractionToKeep = cms.double(1e-7), positionCalc = _positionCalcPS_all_nodepth, - allCellsPositionCalc = cms.PSet(), - positionCalcForConvergence = cms.PSet(), showerSigma = cms.double(0.3), stoppingTolerance = cms.double(1e-8), maxIterations = cms.uint32(50),