From e6d43ff1138bd8a8c752da2b15169e4555d42552 Mon Sep 17 00:00:00 2001 From: swmukher Date: Tue, 23 Feb 2021 16:54:50 +0100 Subject: [PATCH 1/9] filtering codes --- .../plugins/HLTCaloObjInRegionsProducer.cc | 13 ++ .../L1TEGammaFilteredCollectionProducer.cc | 128 ++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 RecoEgamma/EgammaHLTProducers/plugins/L1TEGammaFilteredCollectionProducer.cc diff --git a/RecoEgamma/EgammaHLTProducers/plugins/HLTCaloObjInRegionsProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/HLTCaloObjInRegionsProducer.cc index 17e7a3c953ad7..7b6580b9a9d0b 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/HLTCaloObjInRegionsProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/HLTCaloObjInRegionsProducer.cc @@ -331,3 +331,16 @@ DEFINE_FWK_MODULE(HLTEcalRecHitsInRegionsProducer); #include "DataFormats/EcalRecHit/interface/EcalUncalibratedRecHit.h" using HLTEcalUnCalibRecHitsInRegionsProducer = HLTCaloObjInRegionsProducer; DEFINE_FWK_MODULE(HLTEcalUnCalibRecHitsInRegionsProducer); + +// HGCAL Digis +#include "DataFormats/HGCDigi/interface/HGCDigiCollections.h" +using HLTHGCalDigisInRegionsProducer = HLTCaloObjInRegionsProducer; +DEFINE_FWK_MODULE(HLTHGCalDigisInRegionsProducer); + +// HGCAL RecHits +#include "DataFormats/HGCRecHit/interface/HGCRecHit.h" +using HLTHGCalRecHitsInRegionsProducer = HLTCaloObjInRegionsProducer; +DEFINE_FWK_MODULE(HLTHGCalRecHitsInRegionsProducer); +#include "DataFormats/HGCRecHit/interface/HGCUncalibratedRecHit.h" +using HLTHGCalUncalibratedRecHitsInRegionsProducer = HLTCaloObjInRegionsProducer; +DEFINE_FWK_MODULE(HLTHGCalUncalibratedRecHitsInRegionsProducer); diff --git a/RecoEgamma/EgammaHLTProducers/plugins/L1TEGammaFilteredCollectionProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/L1TEGammaFilteredCollectionProducer.cc new file mode 100644 index 0000000000000..009e1ea6964d0 --- /dev/null +++ b/RecoEgamma/EgammaHLTProducers/plugins/L1TEGammaFilteredCollectionProducer.cc @@ -0,0 +1,128 @@ +/* + Author: Swagata Mukherjee + + Date: Feb 2021 + + At the time of writing this new module, it is intended to be used mainly for + phase-2. Before feeding in the L1 e/g collection to + HLTEcalRecHitInAllL1RegionsProducer, it can pass through this module which + will filter the collection based on hardware quality and pT. + + The most generic L1 e/g phase-2 collections are: + TkEm, which is std::vector + & + StaEG, which is BXVector + + Despite this technical difference, the objects are almost identical, for all + practical purposes. So any of these two collections could have been used. + Currently, BXVector is recognised by the next step + HLTEcalRecHitInAllL1RegionsProducer, while std::vector is not. So + using BXVector is straightforward. If for some reason one need to + use std::vector, changes in HLTEcalRecHitInAllL1RegionsProducer + would also be necesary. +*/ + +#include "DataFormats/L1TCorrelator/interface/TkEm.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/EventSetupRecord.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +class L1TEGammaFilteredCollectionProducer : public edm::global::EDProducer<> { +public: + explicit L1TEGammaFilteredCollectionProducer(const edm::ParameterSet&); + ~L1TEGammaFilteredCollectionProducer() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + void produce(edm::StreamID sid, edm::Event& iEvent, + const edm::EventSetup& iSetup) const override; + +private: + edm::InputTag l1EgTag_; + edm::EDGetTokenT> l1EgToken_; + int quality_; + bool qualIsMask_; + bool applyQual_; + int minBX_; + int maxBX_; + double minPt_; + std::vector scalings_; // pT scaling factors + double getOfflineEt(double et) const; +}; + +L1TEGammaFilteredCollectionProducer::L1TEGammaFilteredCollectionProducer( + const edm::ParameterSet& iConfig) + : l1EgTag_(iConfig.getParameter("inputTag")), + l1EgToken_(consumes>(l1EgTag_)) { + quality_ = iConfig.getParameter("quality"); + qualIsMask_ = iConfig.getParameter("qualIsMask"); + applyQual_ = iConfig.getParameter("applyQual"); + minBX_ = iConfig.getParameter("minBX"); + maxBX_ = iConfig.getParameter("maxBX"); + minPt_ = iConfig.getParameter("minPt"); + scalings_ = iConfig.getParameter>("scalings"); + + produces>(); +} + +L1TEGammaFilteredCollectionProducer::~L1TEGammaFilteredCollectionProducer() = + default; + +void L1TEGammaFilteredCollectionProducer::fillDescriptions( + edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("inputTag", + edm::InputTag("L1EGammaClusterEmuProducer")); + desc.add("quality", 0x2); + desc.add("qualIsMask", true); + desc.add("applyQual", true); + desc.add("minBX", -1); + desc.add("maxBX", 1); + desc.add("minPt", 5.0); + desc.add>("scalings", {2.6604, 1.06077, 0.0}); + descriptions.add("L1TEGammaFilteredCollectionProducer", desc); +} + +void L1TEGammaFilteredCollectionProducer::produce( + edm::StreamID sid, edm::Event& iEvent, + const edm::EventSetup& iSetup) const { + auto outEgs = std::make_unique>(); + auto l1Egs = iEvent.getHandle(l1EgToken_); + + int startBX = std::max((*l1Egs).getFirstBX(), minBX_); + int endBX = std::min((*l1Egs).getLastBX(), maxBX_); + + for (int bx = startBX; bx <= endBX; bx++) { + // Loop over all L1 e/gamma objects + for (BXVector::const_iterator iEg = (*l1Egs).begin(bx); + iEg != (*l1Egs).end(bx); iEg++) { + double offlineEt = this->getOfflineEt((*iEg).pt()); + bool passQuality(false); + if (applyQual_) { + if (qualIsMask_) + passQuality = ((*iEg).hwQual() & quality_); + else + passQuality = ((*iEg).hwQual() == quality_); + } else + passQuality = true; + + // if quality is passed, put the object in filtered collection + if (passQuality && (offlineEt > minPt_)) { + outEgs->push_back(bx, *iEg); + } + } // l1EG loop ends + } // BX loop ends + iEvent.put(std::move(outEgs)); +} + +double L1TEGammaFilteredCollectionProducer::getOfflineEt(double et) const { + return (scalings_.at(0) + et * scalings_.at(1) + et * et * scalings_.at(2)); +} + +DEFINE_FWK_MODULE(L1TEGammaFilteredCollectionProducer); From 5a6f410491b10919887901d66cd896e6bbab355c Mon Sep 17 00:00:00 2001 From: swmukher Date: Tue, 23 Feb 2021 17:21:04 +0100 Subject: [PATCH 2/9] seed TICL by L1 e/gamma objects --- RecoHGCal/TICL/plugins/BuildFile.xml | 2 + RecoHGCal/TICL/plugins/SeedingRegionByL1.cc | 80 +++++++++++++++++++ RecoHGCal/TICL/plugins/SeedingRegionByL1.h | 45 +++++++++++ .../TICL/plugins/TICLSeedingRegionProducer.cc | 7 ++ 4 files changed, 134 insertions(+) create mode 100644 RecoHGCal/TICL/plugins/SeedingRegionByL1.cc create mode 100644 RecoHGCal/TICL/plugins/SeedingRegionByL1.h diff --git a/RecoHGCal/TICL/plugins/BuildFile.xml b/RecoHGCal/TICL/plugins/BuildFile.xml index 00c267848b23e..706b016c875a4 100644 --- a/RecoHGCal/TICL/plugins/BuildFile.xml +++ b/RecoHGCal/TICL/plugins/BuildFile.xml @@ -5,6 +5,8 @@ + + diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc new file mode 100644 index 0000000000000..047b348e2f189 --- /dev/null +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc @@ -0,0 +1,80 @@ +/* + Author: Swagata Mukherjee + + Date: Feb 2021 + + TICL is currently seeded by tracks, or just globally. + Here, adding option to seed TICL by L1 e/gamma objects (L1 TkEm). + This is expected to be useful for CPU timing at the HLT. +*/ + +#include "SeedingRegionByL1.h" + +#include +#include +#include + +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +ticl::SeedingRegionByL1::SeedingRegionByL1(const edm::ParameterSet &conf, + edm::ConsumesCollector &sumes) + : SeedingRegionAlgoBase(conf, sumes), + l1TkEmsToken_(sumes.consumes>( + conf.getParameter("l1TkEmColl"))), + algoVerbosity_(conf.getParameter("algo_verbosity")), + minPt_(conf.getParameter("minPt")), + minAbsEta_(conf.getParameter("minAbsEta")), + maxAbsEta_(conf.getParameter("maxAbsEta")), + endcapScalings_(conf.getParameter>("endcapScalings")), + quality_(conf.getParameter("quality")) {} + +void ticl::SeedingRegionByL1::makeRegions( + const edm::Event &ev, const edm::EventSetup &es, + std::vector &result) { + auto l1TrkEms = ev.getHandle(l1TkEmsToken_); + edm::ProductID l1tkemsId = l1TrkEms.id(); + + for (size_t indx = 0; indx < (*l1TrkEms).size(); indx++) { + const auto &l1TrkEm = (*l1TrkEms)[indx]; + double offlinePt = this->TkEmOfflineEt(l1TrkEm.pt()); + if ((offlinePt < minPt_) || (std::abs(l1TrkEm.eta()) < minAbsEta_) || + (std::abs(l1TrkEm.eta()) > maxAbsEta_) || + (l1TrkEm.EGRef()->hwQual() != quality_)) { + continue; + } + + int iSide = int(l1TrkEm.eta() > 0); + result.emplace_back( + GlobalPoint(l1TrkEm.p4().X(), l1TrkEm.p4().Y(), l1TrkEm.p4().Z()), + GlobalVector(l1TrkEm.px(), l1TrkEm.py(), l1TrkEm.pz()), iSide, indx, + l1tkemsId); + indx++; + } + + std::sort(result.begin(), result.end(), + [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) { + return a.directionAtOrigin.perp2() > b.directionAtOrigin.perp2(); + }); +} + +double ticl::SeedingRegionByL1::TkEmOfflineEt(double Et) const { + return (endcapScalings_.at(0) + Et * endcapScalings_.at(1) + + Et * Et * endcapScalings_.at(2)); +} + +void ticl::SeedingRegionByL1::fillPSetDescription( + edm::ParameterSetDescription &desc) { + desc.add("l1TkEmColl", edm::InputTag("L1TkPhotonsHGC", "EG")); + desc.add("algo_verbosity", 0); + desc.add("minPt", 10); + desc.add("minAbsEta", 1.479); + desc.add("maxAbsEta", 4.0); + desc.add>("endcapScalings", {3.17445, 1.13219, 0.0}); + desc.add("quality", 5); +} + +edm::ParameterSetDescription ticl::SeedingRegionByL1::makePSetDescription() { + edm::ParameterSetDescription desc; + fillPSetDescription(desc); + return desc; +} diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.h b/RecoHGCal/TICL/plugins/SeedingRegionByL1.h new file mode 100644 index 0000000000000..70c486963c641 --- /dev/null +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.h @@ -0,0 +1,45 @@ +// Author: Swagata Mukherjee + +#ifndef RecoHGCal_TICL_SeedingRegionByL1_h +#define RecoHGCal_TICL_SeedingRegionByL1_h +#include +#include + +#include "DataFormats/L1TCorrelator/interface/TkEm.h" +#include "DataFormats/L1TCorrelator/interface/TkEmFwd.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/ESGetToken.h" +#include "RecoHGCal/TICL/plugins/SeedingRegionAlgoBase.h" + +namespace ticl { + class SeedingRegionByL1 final : public SeedingRegionAlgoBase { + public: + SeedingRegionByL1(const edm::ParameterSet& conf, + edm::ConsumesCollector& sumes); + + void initialize(const edm::EventSetup& es) override{}; + void makeRegions(const edm::Event& ev, const edm::EventSetup& es, + std::vector& result) override; + static void fillPSetDescription(edm::ParameterSetDescription& desc); + static edm::ParameterSetDescription makePSetDescription(); + + private: + edm::EDGetTokenT> l1TkEmsToken_; + int algoVerbosity_ = 0; + double minPt_; // minimum pT of L1 TkEm objects + double minAbsEta_; // minimum |eta| of L1 TkEm objects + double maxAbsEta_; // maximum |eta| of L1 TkEm objects + std::vector endcapScalings_; // pT scaling factors for endcap + int quality_; // hwQual + + double TkEmOfflineEt(double Et) const; + }; +} // namespace ticl +#endif diff --git a/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc b/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc index b886b69aef8e0..0f48a4f26c8d7 100644 --- a/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc +++ b/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc @@ -14,6 +14,7 @@ #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "RecoHGCal/TICL/plugins/SeedingRegionAlgoBase.h" +#include "SeedingRegionByL1.h" #include "SeedingRegionByTracks.h" #include "SeedingRegionGlobal.h" @@ -47,6 +48,10 @@ TICLSeedingRegionProducer::TICLSeedingRegionProducer(const edm::ParameterSet& ps case 2: myAlgo_ = std::make_unique(ps, sumes); break; + case 3: + myAlgo_ = std::make_unique( + ps.getParameterSet("seedTiclByL1Config"), sumes); // needed for HLT + break; default: break; } @@ -62,6 +67,8 @@ void TICLSeedingRegionProducer::fillDescriptions(edm::ConfigurationDescriptions& "hitPattern().numberOfLostHits(\"MISSING_OUTER_HITS\") < 5"); desc.add("propagator", "PropagatorWithMaterial"); desc.add("algoId", 1); + desc.add( + "seedTiclByL1Config", SeedingRegionByL1::makePSetDescription()); descriptions.add("ticlSeedingRegionProducer", desc); } From 17198e46980e27fd2f5c3db3025a1c12003c4161 Mon Sep 17 00:00:00 2001 From: swmukher Date: Tue, 23 Feb 2021 18:45:21 +0100 Subject: [PATCH 3/9] code checks --- .../plugins/HLTCaloObjInRegionsProducer.cc | 2 +- .../L1TEGammaFilteredCollectionProducer.cc | 27 ++++------ RecoHGCal/TICL/plugins/SeedingRegionByL1.cc | 51 +++++++++---------- RecoHGCal/TICL/plugins/SeedingRegionByL1.h | 6 +-- .../TICL/plugins/TICLSeedingRegionProducer.cc | 10 ++-- 5 files changed, 40 insertions(+), 56 deletions(-) diff --git a/RecoEgamma/EgammaHLTProducers/plugins/HLTCaloObjInRegionsProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/HLTCaloObjInRegionsProducer.cc index 7b6580b9a9d0b..ad50363c7355b 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/HLTCaloObjInRegionsProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/HLTCaloObjInRegionsProducer.cc @@ -334,7 +334,7 @@ DEFINE_FWK_MODULE(HLTEcalUnCalibRecHitsInRegionsProducer); // HGCAL Digis #include "DataFormats/HGCDigi/interface/HGCDigiCollections.h" -using HLTHGCalDigisInRegionsProducer = HLTCaloObjInRegionsProducer; +using HLTHGCalDigisInRegionsProducer = HLTCaloObjInRegionsProducer; DEFINE_FWK_MODULE(HLTHGCalDigisInRegionsProducer); // HGCAL RecHits diff --git a/RecoEgamma/EgammaHLTProducers/plugins/L1TEGammaFilteredCollectionProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/L1TEGammaFilteredCollectionProducer.cc index 009e1ea6964d0..b634ea3d4391e 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/L1TEGammaFilteredCollectionProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/L1TEGammaFilteredCollectionProducer.cc @@ -40,8 +40,7 @@ class L1TEGammaFilteredCollectionProducer : public edm::global::EDProducer<> { explicit L1TEGammaFilteredCollectionProducer(const edm::ParameterSet&); ~L1TEGammaFilteredCollectionProducer() override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - void produce(edm::StreamID sid, edm::Event& iEvent, - const edm::EventSetup& iSetup) const override; + void produce(edm::StreamID sid, edm::Event& iEvent, const edm::EventSetup& iSetup) const override; private: edm::InputTag l1EgTag_; @@ -56,10 +55,8 @@ class L1TEGammaFilteredCollectionProducer : public edm::global::EDProducer<> { double getOfflineEt(double et) const; }; -L1TEGammaFilteredCollectionProducer::L1TEGammaFilteredCollectionProducer( - const edm::ParameterSet& iConfig) - : l1EgTag_(iConfig.getParameter("inputTag")), - l1EgToken_(consumes>(l1EgTag_)) { +L1TEGammaFilteredCollectionProducer::L1TEGammaFilteredCollectionProducer(const edm::ParameterSet& iConfig) + : l1EgTag_(iConfig.getParameter("inputTag")), l1EgToken_(consumes>(l1EgTag_)) { quality_ = iConfig.getParameter("quality"); qualIsMask_ = iConfig.getParameter("qualIsMask"); applyQual_ = iConfig.getParameter("applyQual"); @@ -71,14 +68,11 @@ L1TEGammaFilteredCollectionProducer::L1TEGammaFilteredCollectionProducer( produces>(); } -L1TEGammaFilteredCollectionProducer::~L1TEGammaFilteredCollectionProducer() = - default; +L1TEGammaFilteredCollectionProducer::~L1TEGammaFilteredCollectionProducer() = default; -void L1TEGammaFilteredCollectionProducer::fillDescriptions( - edm::ConfigurationDescriptions& descriptions) { +void L1TEGammaFilteredCollectionProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - desc.add("inputTag", - edm::InputTag("L1EGammaClusterEmuProducer")); + desc.add("inputTag", edm::InputTag("L1EGammaClusterEmuProducer")); desc.add("quality", 0x2); desc.add("qualIsMask", true); desc.add("applyQual", true); @@ -89,9 +83,9 @@ void L1TEGammaFilteredCollectionProducer::fillDescriptions( descriptions.add("L1TEGammaFilteredCollectionProducer", desc); } -void L1TEGammaFilteredCollectionProducer::produce( - edm::StreamID sid, edm::Event& iEvent, - const edm::EventSetup& iSetup) const { +void L1TEGammaFilteredCollectionProducer::produce(edm::StreamID sid, + edm::Event& iEvent, + const edm::EventSetup& iSetup) const { auto outEgs = std::make_unique>(); auto l1Egs = iEvent.getHandle(l1EgToken_); @@ -100,8 +94,7 @@ void L1TEGammaFilteredCollectionProducer::produce( for (int bx = startBX; bx <= endBX; bx++) { // Loop over all L1 e/gamma objects - for (BXVector::const_iterator iEg = (*l1Egs).begin(bx); - iEg != (*l1Egs).end(bx); iEg++) { + for (BXVector::const_iterator iEg = (*l1Egs).begin(bx); iEg != (*l1Egs).end(bx); iEg++) { double offlineEt = this->getOfflineEt((*iEg).pt()); bool passQuality(false); if (applyQual_) { diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc index 047b348e2f189..973370e31aaa1 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc @@ -16,54 +16,49 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" -ticl::SeedingRegionByL1::SeedingRegionByL1(const edm::ParameterSet &conf, - edm::ConsumesCollector &sumes) - : SeedingRegionAlgoBase(conf, sumes), - l1TkEmsToken_(sumes.consumes>( - conf.getParameter("l1TkEmColl"))), - algoVerbosity_(conf.getParameter("algo_verbosity")), - minPt_(conf.getParameter("minPt")), - minAbsEta_(conf.getParameter("minAbsEta")), - maxAbsEta_(conf.getParameter("maxAbsEta")), - endcapScalings_(conf.getParameter>("endcapScalings")), - quality_(conf.getParameter("quality")) {} +ticl::SeedingRegionByL1::SeedingRegionByL1(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes) + : SeedingRegionAlgoBase(conf, sumes), + l1TkEmsToken_(sumes.consumes>(conf.getParameter("l1TkEmColl"))), + algoVerbosity_(conf.getParameter("algo_verbosity")), + minPt_(conf.getParameter("minPt")), + minAbsEta_(conf.getParameter("minAbsEta")), + maxAbsEta_(conf.getParameter("maxAbsEta")), + endcapScalings_(conf.getParameter>("endcapScalings")), + quality_(conf.getParameter("quality")) {} -void ticl::SeedingRegionByL1::makeRegions( - const edm::Event &ev, const edm::EventSetup &es, - std::vector &result) { +void ticl::SeedingRegionByL1::makeRegions(const edm::Event &ev, + const edm::EventSetup &es, + std::vector &result) { auto l1TrkEms = ev.getHandle(l1TkEmsToken_); edm::ProductID l1tkemsId = l1TrkEms.id(); for (size_t indx = 0; indx < (*l1TrkEms).size(); indx++) { const auto &l1TrkEm = (*l1TrkEms)[indx]; double offlinePt = this->TkEmOfflineEt(l1TrkEm.pt()); - if ((offlinePt < minPt_) || (std::abs(l1TrkEm.eta()) < minAbsEta_) || - (std::abs(l1TrkEm.eta()) > maxAbsEta_) || + if ((offlinePt < minPt_) || (std::abs(l1TrkEm.eta()) < minAbsEta_) || (std::abs(l1TrkEm.eta()) > maxAbsEta_) || (l1TrkEm.EGRef()->hwQual() != quality_)) { continue; } int iSide = int(l1TrkEm.eta() > 0); - result.emplace_back( - GlobalPoint(l1TrkEm.p4().X(), l1TrkEm.p4().Y(), l1TrkEm.p4().Z()), - GlobalVector(l1TrkEm.px(), l1TrkEm.py(), l1TrkEm.pz()), iSide, indx, - l1tkemsId); + result.emplace_back(GlobalPoint(l1TrkEm.p4().X(), l1TrkEm.p4().Y(), l1TrkEm.p4().Z()), + GlobalVector(l1TrkEm.px(), l1TrkEm.py(), l1TrkEm.pz()), + iSide, + indx, + l1tkemsId); indx++; } - std::sort(result.begin(), result.end(), - [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) { - return a.directionAtOrigin.perp2() > b.directionAtOrigin.perp2(); - }); + std::sort(result.begin(), result.end(), [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) { + return a.directionAtOrigin.perp2() > b.directionAtOrigin.perp2(); + }); } double ticl::SeedingRegionByL1::TkEmOfflineEt(double Et) const { - return (endcapScalings_.at(0) + Et * endcapScalings_.at(1) + - Et * Et * endcapScalings_.at(2)); + return (endcapScalings_.at(0) + Et * endcapScalings_.at(1) + Et * Et * endcapScalings_.at(2)); } -void ticl::SeedingRegionByL1::fillPSetDescription( - edm::ParameterSetDescription &desc) { +void ticl::SeedingRegionByL1::fillPSetDescription(edm::ParameterSetDescription &desc) { desc.add("l1TkEmColl", edm::InputTag("L1TkPhotonsHGC", "EG")); desc.add("algo_verbosity", 0); desc.add("minPt", 10); diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.h b/RecoHGCal/TICL/plugins/SeedingRegionByL1.h index 70c486963c641..e285812d2f13b 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByL1.h +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.h @@ -21,12 +21,10 @@ namespace ticl { class SeedingRegionByL1 final : public SeedingRegionAlgoBase { public: - SeedingRegionByL1(const edm::ParameterSet& conf, - edm::ConsumesCollector& sumes); + SeedingRegionByL1(const edm::ParameterSet& conf, edm::ConsumesCollector& sumes); void initialize(const edm::EventSetup& es) override{}; - void makeRegions(const edm::Event& ev, const edm::EventSetup& es, - std::vector& result) override; + void makeRegions(const edm::Event& ev, const edm::EventSetup& es, std::vector& result) override; static void fillPSetDescription(edm::ParameterSetDescription& desc); static edm::ParameterSetDescription makePSetDescription(); diff --git a/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc b/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc index 0f48a4f26c8d7..197863a58f2cb 100644 --- a/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc +++ b/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc @@ -48,10 +48,9 @@ TICLSeedingRegionProducer::TICLSeedingRegionProducer(const edm::ParameterSet& ps case 2: myAlgo_ = std::make_unique(ps, sumes); break; - case 3: - myAlgo_ = std::make_unique( - ps.getParameterSet("seedTiclByL1Config"), sumes); // needed for HLT - break; + case 3: + myAlgo_ = std::make_unique(ps.getParameterSet("seedTiclByL1Config"), sumes); // needed for HLT + break; default: break; } @@ -67,8 +66,7 @@ void TICLSeedingRegionProducer::fillDescriptions(edm::ConfigurationDescriptions& "hitPattern().numberOfLostHits(\"MISSING_OUTER_HITS\") < 5"); desc.add("propagator", "PropagatorWithMaterial"); desc.add("algoId", 1); - desc.add( - "seedTiclByL1Config", SeedingRegionByL1::makePSetDescription()); + desc.add("seedTiclByL1Config", SeedingRegionByL1::makePSetDescription()); descriptions.add("ticlSeedingRegionProducer", desc); } From 552ae09aca9ab283463e465fb820925d830201ff Mon Sep 17 00:00:00 2001 From: swmukher Date: Tue, 23 Feb 2021 19:40:41 +0100 Subject: [PATCH 4/9] bugfix --- RecoHGCal/TICL/plugins/SeedingRegionByL1.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc index 973370e31aaa1..bff451cde300e 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc @@ -46,7 +46,6 @@ void ticl::SeedingRegionByL1::makeRegions(const edm::Event &ev, iSide, indx, l1tkemsId); - indx++; } std::sort(result.begin(), result.end(), [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) { From 9e202876420b42288790bb49984264f3ff96ff4c Mon Sep 17 00:00:00 2001 From: swmukher Date: Mon, 1 Mar 2021 16:32:32 +0100 Subject: [PATCH 5/9] implementing review comments --- RecoHGCal/TICL/plugins/SeedingRegionByL1.cc | 6 +++--- RecoHGCal/TICL/plugins/SeedingRegionByL1.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc index bff451cde300e..6879ba9ccf61b 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc @@ -34,7 +34,7 @@ void ticl::SeedingRegionByL1::makeRegions(const edm::Event &ev, for (size_t indx = 0; indx < (*l1TrkEms).size(); indx++) { const auto &l1TrkEm = (*l1TrkEms)[indx]; - double offlinePt = this->TkEmOfflineEt(l1TrkEm.pt()); + double offlinePt = this->tkEmOfflineEt(l1TrkEm.pt()); if ((offlinePt < minPt_) || (std::abs(l1TrkEm.eta()) < minAbsEta_) || (std::abs(l1TrkEm.eta()) > maxAbsEta_) || (l1TrkEm.EGRef()->hwQual() != quality_)) { continue; @@ -53,8 +53,8 @@ void ticl::SeedingRegionByL1::makeRegions(const edm::Event &ev, }); } -double ticl::SeedingRegionByL1::TkEmOfflineEt(double Et) const { - return (endcapScalings_.at(0) + Et * endcapScalings_.at(1) + Et * Et * endcapScalings_.at(2)); +double ticl::SeedingRegionByL1::tkEmOfflineEt(double et) const { + return (endcapScalings_.at(0) + et * endcapScalings_.at(1) + et * et * endcapScalings_.at(2)); } void ticl::SeedingRegionByL1::fillPSetDescription(edm::ParameterSetDescription &desc) { diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.h b/RecoHGCal/TICL/plugins/SeedingRegionByL1.h index e285812d2f13b..04f94ce3a9505 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByL1.h +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.h @@ -37,7 +37,7 @@ namespace ticl { std::vector endcapScalings_; // pT scaling factors for endcap int quality_; // hwQual - double TkEmOfflineEt(double Et) const; + double tkEmOfflineEt(double et) const; }; } // namespace ticl #endif From 945bbd7b6655ba0df2ac76e4ce4741cb07bd4fb8 Mon Sep 17 00:00:00 2001 From: Sam Harper Date: Tue, 2 Mar 2021 07:40:07 +0100 Subject: [PATCH 6/9] updating TICLSeedingRegionProducer to use plugins --- .../TICL/plugins/SeedingRegionAlgoBase.h | 3 ++ .../TICL/plugins/SeedingRegionAlgoFactory.cc | 13 +++++++ .../TICL/plugins/SeedingRegionAlgoFactory.h | 10 +++++ RecoHGCal/TICL/plugins/SeedingRegionByL1.cc | 2 +- .../TICL/plugins/SeedingRegionByTracks.cc | 9 +++++ .../TICL/plugins/SeedingRegionByTracks.h | 2 + RecoHGCal/TICL/plugins/SeedingRegionGlobal.cc | 4 ++ RecoHGCal/TICL/plugins/SeedingRegionGlobal.h | 2 + .../TICL/plugins/TICLSeedingRegionProducer.cc | 37 ++++++------------- .../TICL/python/TICLSeedingRegions_cff.py | 6 +-- 10 files changed, 58 insertions(+), 30 deletions(-) create mode 100644 RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.cc create mode 100644 RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.h diff --git a/RecoHGCal/TICL/plugins/SeedingRegionAlgoBase.h b/RecoHGCal/TICL/plugins/SeedingRegionAlgoBase.h index ed30439660e78..5721e2df4227b 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionAlgoBase.h +++ b/RecoHGCal/TICL/plugins/SeedingRegionAlgoBase.h @@ -9,6 +9,7 @@ #include #include "DataFormats/HGCalReco/interface/Common.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "DataFormats/HGCalReco/interface/TICLSeedingRegion.h" #include "FWCore/Framework/interface/ConsumesCollector.h" @@ -30,6 +31,8 @@ namespace ticl { const edm::EventSetup& es, std::vector& result) = 0; + static void fillPSetDescription(edm::ParameterSetDescription& desc) { desc.add("algo_verbosity", 0); } + enum VerbosityLevel { None = 0, Basic, Advanced, Expert, Guru }; protected: diff --git a/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.cc b/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.cc new file mode 100644 index 0000000000000..d3a1261d4b305 --- /dev/null +++ b/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.cc @@ -0,0 +1,13 @@ +#include "FWCore/ParameterSet/interface/ValidatedPluginFactoryMacros.h" +#include "FWCore/ParameterSet/interface/ValidatedPluginMacros.h" +#include "SeedingRegionAlgoFactory.h" +#include "SeedingRegionByTracks.h" +#include "SeedingRegionGlobal.h" +#include "SeedingRegionByL1.h" + +EDM_REGISTER_VALIDATED_PLUGINFACTORY(SeedingRegionAlgoFactory, "SeedingRegionAlgoFactory"); + +DEFINE_EDM_VALIDATED_PLUGIN(SeedingRegionAlgoFactory,ticl::SeedingRegionByTracks,"SeedingRegionByTracks"); +DEFINE_EDM_VALIDATED_PLUGIN(SeedingRegionAlgoFactory,ticl::SeedingRegionGlobal,"SeedingRegionGlobal"); +DEFINE_EDM_VALIDATED_PLUGIN(SeedingRegionAlgoFactory,ticl::SeedingRegionByL1,"SeedingRegionByL1"); + diff --git a/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.h b/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.h new file mode 100644 index 0000000000000..850f3e53846bf --- /dev/null +++ b/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.h @@ -0,0 +1,10 @@ +#ifndef RecoHGCAL_TICL_SeedingRegionAlgoFactory_h +#define RecoHGCAL_TICL_SeedingRegionAlgoFactory_h + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" +#include "SeedingRegionAlgoBase.h" + +using SeedingRegionAlgoFactory = edmplugin::PluginFactory; + +#endif diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc index 6879ba9ccf61b..7fb3fe601a04c 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc @@ -59,12 +59,12 @@ double ticl::SeedingRegionByL1::tkEmOfflineEt(double et) const { void ticl::SeedingRegionByL1::fillPSetDescription(edm::ParameterSetDescription &desc) { desc.add("l1TkEmColl", edm::InputTag("L1TkPhotonsHGC", "EG")); - desc.add("algo_verbosity", 0); desc.add("minPt", 10); desc.add("minAbsEta", 1.479); desc.add("maxAbsEta", 4.0); desc.add>("endcapScalings", {3.17445, 1.13219, 0.0}); desc.add("quality", 5); + SeedingRegionAlgoBase::fillPSetDescription(desc); } edm::ParameterSetDescription ticl::SeedingRegionByL1::makePSetDescription() { diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByTracks.cc b/RecoHGCal/TICL/plugins/SeedingRegionByTracks.cc index 16d69c391f38a..c7b07b757775b 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByTracks.cc +++ b/RecoHGCal/TICL/plugins/SeedingRegionByTracks.cc @@ -65,6 +65,15 @@ void SeedingRegionByTracks::makeRegions(const edm::Event &ev, }); } +void SeedingRegionByTracks::fillPSetDescription(edm::ParameterSetDescription &desc) { + desc.add("tracks", edm::InputTag("generalTracks")); + desc.add("cutTk", + "1.48 < abs(eta) < 3.0 && pt > 1. && quality(\"highPurity\") && " + "hitPattern().numberOfLostHits(\"MISSING_OUTER_HITS\") < 5"); + desc.add("propagator", "PropagatorWithMaterial"); + SeedingRegionAlgoBase::fillPSetDescription(desc); +} + void SeedingRegionByTracks::buildFirstLayers() { float zVal = hgcons_->waferZ(1, true); std::pair rMinMax = hgcons_->rangeR(zVal, true); diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByTracks.h b/RecoHGCal/TICL/plugins/SeedingRegionByTracks.h index d8d9f61214c02..fc8f0f539ef22 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByTracks.h +++ b/RecoHGCal/TICL/plugins/SeedingRegionByTracks.h @@ -37,6 +37,8 @@ namespace ticl { void makeRegions(const edm::Event& ev, const edm::EventSetup& es, std::vector& result) override; + static void fillPSetDescription(edm::ParameterSetDescription& desc); + private: void buildFirstLayers(); diff --git a/RecoHGCal/TICL/plugins/SeedingRegionGlobal.cc b/RecoHGCal/TICL/plugins/SeedingRegionGlobal.cc index 2e7f0c2a10824..96b09dbf02c27 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionGlobal.cc +++ b/RecoHGCal/TICL/plugins/SeedingRegionGlobal.cc @@ -26,3 +26,7 @@ void SeedingRegionGlobal::makeRegions(const edm::Event &ev, result.emplace_back(GlobalPoint(0., 0., 0.), GlobalVector(0., 0., 0.), i, -1, edm::ProductID()); } } + +void SeedingRegionGlobal::fillPSetDescription(edm::ParameterSetDescription &desc) { + SeedingRegionAlgoBase::fillPSetDescription(desc); +} diff --git a/RecoHGCal/TICL/plugins/SeedingRegionGlobal.h b/RecoHGCal/TICL/plugins/SeedingRegionGlobal.h index c5031c38f5dda..09d517ffe6d26 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionGlobal.h +++ b/RecoHGCal/TICL/plugins/SeedingRegionGlobal.h @@ -25,6 +25,8 @@ namespace ticl { void initialize(const edm::EventSetup& es) override{}; void makeRegions(const edm::Event& ev, const edm::EventSetup& es, std::vector& result) override; + + static void fillPSetDescription(edm::ParameterSetDescription& desc); }; } // namespace ticl #endif diff --git a/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc b/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc index 197863a58f2cb..ca4a80c3784e7 100644 --- a/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc +++ b/RecoHGCal/TICL/plugins/TICLSeedingRegionProducer.cc @@ -12,11 +12,13 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/PluginDescription.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "RecoHGCal/TICL/plugins/SeedingRegionAlgoBase.h" #include "SeedingRegionByL1.h" #include "SeedingRegionByTracks.h" #include "SeedingRegionGlobal.h" +#include "SeedingRegionAlgoFactory.h" using namespace ticl; @@ -32,41 +34,24 @@ class TICLSeedingRegionProducer : public edm::stream::EDProducer<> { private: std::unique_ptr myAlgo_; - int algoId_; - std::string seedingId_; }; + DEFINE_FWK_MODULE(TICLSeedingRegionProducer); -TICLSeedingRegionProducer::TICLSeedingRegionProducer(const edm::ParameterSet& ps) - : algoId_(ps.getParameter("algoId")) { +TICLSeedingRegionProducer::TICLSeedingRegionProducer(const edm::ParameterSet& ps) { auto sumes = consumesCollector(); - - switch (algoId_) { - case 1: - myAlgo_ = std::make_unique(ps, sumes); - break; - case 2: - myAlgo_ = std::make_unique(ps, sumes); - break; - case 3: - myAlgo_ = std::make_unique(ps.getParameterSet("seedTiclByL1Config"), sumes); // needed for HLT - break; - default: - break; - } + auto seedingPSet = ps.getParameter("seedingPSet"); + auto algoType = seedingPSet.getParameter("type"); + myAlgo_ = SeedingRegionAlgoFactory::get()->create(algoType, seedingPSet, sumes); produces>(); } void TICLSeedingRegionProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - desc.add("algo_verbosity", 0); - desc.add("tracks", edm::InputTag("generalTracks")); - desc.add("cutTk", - "1.48 < abs(eta) < 3.0 && pt > 1. && quality(\"highPurity\") && " - "hitPattern().numberOfLostHits(\"MISSING_OUTER_HITS\") < 5"); - desc.add("propagator", "PropagatorWithMaterial"); - desc.add("algoId", 1); - desc.add("seedTiclByL1Config", SeedingRegionByL1::makePSetDescription()); + + edm::ParameterSetDescription seedingDesc; + seedingDesc.addNode(edm::PluginDescription("type", "SeedingRegionGlobal", true)); + desc.add("seedingPSet", seedingDesc); descriptions.add("ticlSeedingRegionProducer", desc); } diff --git a/RecoHGCal/TICL/python/TICLSeedingRegions_cff.py b/RecoHGCal/TICL/python/TICLSeedingRegions_cff.py index 4b76fd39d322c..4a8bce783e56f 100644 --- a/RecoHGCal/TICL/python/TICLSeedingRegions_cff.py +++ b/RecoHGCal/TICL/python/TICLSeedingRegions_cff.py @@ -5,13 +5,13 @@ # SEEDING REGION ticlSeedingGlobal = _ticlSeedingRegionProducer.clone( - algoId = 2 + seedingPSet = _ticlSeedingRegionProducer.seedingPSet.clone(type=cms.string("SeedingRegionGlobal")) ) ticlSeedingTrk = _ticlSeedingRegionProducer.clone( - algoId = 1 + seedingPSet = _ticlSeedingRegionProducer.seedingPSet.clone(type=cms.string("SeedingRegionByTracks")) ) ticlSeedingGlobalHFNose = _ticlSeedingRegionProducer.clone( - algoId = 2 + seedingPSet = _ticlSeedingRegionProducer.seedingPSet.clone(type=cms.string("SeedingRegionGlobal")) ) From 0266c5b9c4ea3218363e4f9a4354e279b378a13f Mon Sep 17 00:00:00 2001 From: swmukher Date: Tue, 2 Mar 2021 11:10:37 +0100 Subject: [PATCH 7/9] code checks --- RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.cc | 7 +++---- RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.h | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.cc b/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.cc index d3a1261d4b305..5da8aa8c9e83a 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.cc +++ b/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.cc @@ -7,7 +7,6 @@ EDM_REGISTER_VALIDATED_PLUGINFACTORY(SeedingRegionAlgoFactory, "SeedingRegionAlgoFactory"); -DEFINE_EDM_VALIDATED_PLUGIN(SeedingRegionAlgoFactory,ticl::SeedingRegionByTracks,"SeedingRegionByTracks"); -DEFINE_EDM_VALIDATED_PLUGIN(SeedingRegionAlgoFactory,ticl::SeedingRegionGlobal,"SeedingRegionGlobal"); -DEFINE_EDM_VALIDATED_PLUGIN(SeedingRegionAlgoFactory,ticl::SeedingRegionByL1,"SeedingRegionByL1"); - +DEFINE_EDM_VALIDATED_PLUGIN(SeedingRegionAlgoFactory, ticl::SeedingRegionByTracks, "SeedingRegionByTracks"); +DEFINE_EDM_VALIDATED_PLUGIN(SeedingRegionAlgoFactory, ticl::SeedingRegionGlobal, "SeedingRegionGlobal"); +DEFINE_EDM_VALIDATED_PLUGIN(SeedingRegionAlgoFactory, ticl::SeedingRegionByL1, "SeedingRegionByL1"); diff --git a/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.h b/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.h index 850f3e53846bf..8cb627809a4d7 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.h +++ b/RecoHGCal/TICL/plugins/SeedingRegionAlgoFactory.h @@ -5,6 +5,7 @@ #include "FWCore/PluginManager/interface/PluginFactory.h" #include "SeedingRegionAlgoBase.h" -using SeedingRegionAlgoFactory = edmplugin::PluginFactory; +using SeedingRegionAlgoFactory = + edmplugin::PluginFactory; #endif From 05ec89c37ef10ffad7043d3d4d8dba41d1374842 Mon Sep 17 00:00:00 2001 From: swmukher Date: Tue, 2 Mar 2021 20:33:15 +0100 Subject: [PATCH 8/9] address review comment about makePSetDescription --- RecoHGCal/TICL/plugins/SeedingRegionByL1.cc | 6 ------ RecoHGCal/TICL/plugins/SeedingRegionByL1.h | 1 - 2 files changed, 7 deletions(-) diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc index 7fb3fe601a04c..6a2c62534960d 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.cc @@ -66,9 +66,3 @@ void ticl::SeedingRegionByL1::fillPSetDescription(edm::ParameterSetDescription & desc.add("quality", 5); SeedingRegionAlgoBase::fillPSetDescription(desc); } - -edm::ParameterSetDescription ticl::SeedingRegionByL1::makePSetDescription() { - edm::ParameterSetDescription desc; - fillPSetDescription(desc); - return desc; -} diff --git a/RecoHGCal/TICL/plugins/SeedingRegionByL1.h b/RecoHGCal/TICL/plugins/SeedingRegionByL1.h index 04f94ce3a9505..6daa705cbad8f 100644 --- a/RecoHGCal/TICL/plugins/SeedingRegionByL1.h +++ b/RecoHGCal/TICL/plugins/SeedingRegionByL1.h @@ -26,7 +26,6 @@ namespace ticl { void initialize(const edm::EventSetup& es) override{}; void makeRegions(const edm::Event& ev, const edm::EventSetup& es, std::vector& result) override; static void fillPSetDescription(edm::ParameterSetDescription& desc); - static edm::ParameterSetDescription makePSetDescription(); private: edm::EDGetTokenT> l1TkEmsToken_; From a7afa143ff39dcf585e3bf89e7fbffcaa63eb6e2 Mon Sep 17 00:00:00 2001 From: swmukher Date: Wed, 3 Mar 2021 10:44:20 +0100 Subject: [PATCH 9/9] avoid specifying type in config --- RecoHGCal/TICL/python/TICLSeedingRegions_cff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RecoHGCal/TICL/python/TICLSeedingRegions_cff.py b/RecoHGCal/TICL/python/TICLSeedingRegions_cff.py index 4a8bce783e56f..e5d55aaec4883 100644 --- a/RecoHGCal/TICL/python/TICLSeedingRegions_cff.py +++ b/RecoHGCal/TICL/python/TICLSeedingRegions_cff.py @@ -5,13 +5,13 @@ # SEEDING REGION ticlSeedingGlobal = _ticlSeedingRegionProducer.clone( - seedingPSet = _ticlSeedingRegionProducer.seedingPSet.clone(type=cms.string("SeedingRegionGlobal")) + seedingPSet = _ticlSeedingRegionProducer.seedingPSet.clone(type="SeedingRegionGlobal") ) ticlSeedingTrk = _ticlSeedingRegionProducer.clone( - seedingPSet = _ticlSeedingRegionProducer.seedingPSet.clone(type=cms.string("SeedingRegionByTracks")) + seedingPSet = _ticlSeedingRegionProducer.seedingPSet.clone(type="SeedingRegionByTracks") ) ticlSeedingGlobalHFNose = _ticlSeedingRegionProducer.clone( - seedingPSet = _ticlSeedingRegionProducer.seedingPSet.clone(type=cms.string("SeedingRegionGlobal")) + seedingPSet = _ticlSeedingRegionProducer.seedingPSet.clone(type="SeedingRegionGlobal") )