From 6114caa16aa0df71ac05a4a690d626495a594502 Mon Sep 17 00:00:00 2001 From: Mario Masciovecchio Date: Fri, 8 Apr 2022 13:28:37 -0700 Subject: [PATCH 1/2] Introduce minPt cut for track building --- .../IterativeTracking/python/DetachedQuadStep_cff.py | 1 + .../IterativeTracking/python/DetachedTripletStep_cff.py | 1 + .../IterativeTracking/python/HighPtTripletStep_cff.py | 1 + RecoTracker/IterativeTracking/python/InitialStep_cff.py | 1 + RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py | 1 + .../IterativeTracking/python/LowPtTripletStep_cff.py | 1 + .../IterativeTracking/python/MixedTripletStep_cff.py | 1 + RecoTracker/IterativeTracking/python/PixelLessStep_cff.py | 1 + RecoTracker/IterativeTracking/python/TobTecStep_cff.py | 1 + .../MkFit/plugins/MkFitIterationConfigESProducer.cc | 7 ++++++- RecoTracker/MkFitCore/interface/IterationConfig.h | 3 +++ RecoTracker/MkFitCore/src/MkBuilder.cc | 8 ++++++++ 12 files changed, 26 insertions(+), 1 deletion(-) diff --git a/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py b/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py index f29aafe816b9d..407e5aacd6023 100644 --- a/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py +++ b/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py @@ -212,6 +212,7 @@ mkFitSeeds = 'detachedQuadStepTrackCandidatesMkFitSeeds', tracks = 'detachedQuadStepTrackCandidatesMkFit', )) +(pp_on_XeXe_2017 | pp_on_AA).toModify(detachedQuadStepTrackCandidatesMkFitConfig, minPt=0.9) #For FastSim phase1 tracking import FastSimulation.Tracking.TrackCandidateProducer_cfi diff --git a/RecoTracker/IterativeTracking/python/DetachedTripletStep_cff.py b/RecoTracker/IterativeTracking/python/DetachedTripletStep_cff.py index 7ac9c667233d0..fe75163cac66c 100644 --- a/RecoTracker/IterativeTracking/python/DetachedTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/DetachedTripletStep_cff.py @@ -242,6 +242,7 @@ mkFitSeeds = 'detachedTripletStepTrackCandidatesMkFitSeeds', tracks = 'detachedTripletStepTrackCandidatesMkFit', )) +(pp_on_XeXe_2017 | pp_on_AA).toModify(detachedTripletStepTrackCandidatesMkFitConfig, minPt=0.9) import FastSimulation.Tracking.TrackCandidateProducer_cfi _fastSim_detachedTripletStepTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone( diff --git a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py index ec90002ed0d3c..74c7b0e38c30e 100644 --- a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py @@ -242,6 +242,7 @@ mkFitSeeds = 'highPtTripletStepTrackCandidatesMkFitSeeds', tracks = 'highPtTripletStepTrackCandidatesMkFit', )) +(pp_on_XeXe_2017 | pp_on_AA).toModify(highPtTripletStepTrackCandidatesMkFitConfig, minPt=0.7) # For Phase2PU140 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits as _trajectoryCleanerBySharedHits diff --git a/RecoTracker/IterativeTracking/python/InitialStep_cff.py b/RecoTracker/IterativeTracking/python/InitialStep_cff.py index 2bf9f026fafb8..65f7af1f42d89 100644 --- a/RecoTracker/IterativeTracking/python/InitialStep_cff.py +++ b/RecoTracker/IterativeTracking/python/InitialStep_cff.py @@ -257,6 +257,7 @@ mkFitSeeds = 'initialStepTrackCandidatesMkFitSeeds', tracks = 'initialStepTrackCandidatesMkFit', )) +(pp_on_XeXe_2017 | pp_on_AA).toModify(initialStepTrackCandidatesMkFitConfig, minPt=0.6) import FastSimulation.Tracking.TrackCandidateProducer_cfi fastSim.toReplaceWith(initialStepTrackCandidates, diff --git a/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py index fd016d178d8f7..79f9c8e4239a4 100644 --- a/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py @@ -202,6 +202,7 @@ mkFitSeeds = 'lowPtQuadStepTrackCandidatesMkFitSeeds', tracks = 'lowPtQuadStepTrackCandidatesMkFit', )) +(pp_on_XeXe_2017 | pp_on_AA).toModify(lowPtQuadStepTrackCandidatesMkFitConfig, minPt=0.49) #For FastSim phase1 tracking import FastSimulation.Tracking.TrackCandidateProducer_cfi diff --git a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py index ed2d5d12713f4..25496dfb2ee8a 100644 --- a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py @@ -270,6 +270,7 @@ mkFitSeeds = 'lowPtTripletStepTrackCandidatesMkFitSeeds', tracks = 'lowPtTripletStepTrackCandidatesMkFit', )) +(pp_on_XeXe_2017 | pp_on_AA).toModify(lowPtTripletStepTrackCandidatesMkFitConfig, minPt=0.49) import FastSimulation.Tracking.TrackCandidateProducer_cfi fastSim.toReplaceWith(lowPtTripletStepTrackCandidates, diff --git a/RecoTracker/IterativeTracking/python/MixedTripletStep_cff.py b/RecoTracker/IterativeTracking/python/MixedTripletStep_cff.py index e0030ba00181b..104c76948b8d3 100644 --- a/RecoTracker/IterativeTracking/python/MixedTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/MixedTripletStep_cff.py @@ -318,6 +318,7 @@ mkFitSeeds = 'mixedTripletStepTrackCandidatesMkFitSeeds', tracks = 'mixedTripletStepTrackCandidatesMkFit', )) +(pp_on_XeXe_2017 | pp_on_AA).toModify(mixedTripletStepTrackCandidatesMkFitConfig, minPt=0.4) import FastSimulation.Tracking.TrackCandidateProducer_cfi fastSim.toReplaceWith(mixedTripletStepTrackCandidates, diff --git a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py index fd9fc14d1edf5..bdc52bb2747e8 100644 --- a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py @@ -322,6 +322,7 @@ mkFitSeeds = 'pixelLessStepTrackCandidatesMkFitSeeds', tracks = 'pixelLessStepTrackCandidatesMkFit', )) +(pp_on_XeXe_2017 | pp_on_AA).toModify(pixelLessStepTrackCandidatesMkFitConfig, minPt=2.0) import FastSimulation.Tracking.TrackCandidateProducer_cfi fastSim.toReplaceWith(pixelLessStepTrackCandidates, diff --git a/RecoTracker/IterativeTracking/python/TobTecStep_cff.py b/RecoTracker/IterativeTracking/python/TobTecStep_cff.py index ed0cfd8ca5e4d..cfdf57de90906 100644 --- a/RecoTracker/IterativeTracking/python/TobTecStep_cff.py +++ b/RecoTracker/IterativeTracking/python/TobTecStep_cff.py @@ -305,6 +305,7 @@ mkFitSeeds = 'tobTecStepTrackCandidatesMkFitSeeds', tracks = 'tobTecStepTrackCandidatesMkFit', )) +(pp_on_XeXe_2017 | pp_on_AA).toModify(tobTecStepTrackCandidatesMkFitConfig, minPt=2.0) import FastSimulation.Tracking.TrackCandidateProducer_cfi fastSim.toReplaceWith(tobTecStepTrackCandidates, diff --git a/RecoTracker/MkFit/plugins/MkFitIterationConfigESProducer.cc b/RecoTracker/MkFit/plugins/MkFitIterationConfigESProducer.cc index a1f134a3ef3a6..7f1c24b026522 100644 --- a/RecoTracker/MkFit/plugins/MkFitIterationConfigESProducer.cc +++ b/RecoTracker/MkFit/plugins/MkFitIterationConfigESProducer.cc @@ -218,16 +218,19 @@ class MkFitIterationConfigESProducer : public edm::ESProducer { private: const edm::ESGetToken geomToken_; const std::string configFile_; + const float minPtCut_; }; MkFitIterationConfigESProducer::MkFitIterationConfigESProducer(const edm::ParameterSet &iConfig) : geomToken_{setWhatProduced(this, iConfig.getParameter("ComponentName")).consumes()}, - configFile_{iConfig.getParameter("config").fullPath()} {} + configFile_{iConfig.getParameter("config").fullPath()}, + minPtCut_{(float)iConfig.getParameter("minPt")} {} void MkFitIterationConfigESProducer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { edm::ParameterSetDescription desc; desc.add("ComponentName")->setComment("Product label"); desc.add("config")->setComment("Path to the JSON file for the mkFit configuration parameters"); + desc.add("minPt", 0.0)->setComment("min pT cut applied during track building"); descriptions.addWithDefaultLabel(desc); } @@ -235,6 +238,8 @@ std::unique_ptr MkFitIterationConfigESProducer::produce( const TrackerRecoGeometryRecord &iRecord) { mkfit::ConfigJson cj; auto it_conf = cj.load_File(configFile_); + it_conf->m_params.minPtCut = minPtCut_; + it_conf->m_backward_params.minPtCut = minPtCut_; it_conf->m_partition_seeds = partitionSeeds1; return it_conf; } diff --git a/RecoTracker/MkFitCore/interface/IterationConfig.h b/RecoTracker/MkFitCore/interface/IterationConfig.h index 93eb5f627f497..cdf33abd8cc05 100644 --- a/RecoTracker/MkFitCore/interface/IterationConfig.h +++ b/RecoTracker/MkFitCore/interface/IterationConfig.h @@ -112,6 +112,9 @@ namespace mkfit { float drth_central = 0.001; float drth_obarrel = 0.001; float drth_forward = 0.001; + + //min pT cut + float minPtCut = 0.0; }; //============================================================================== diff --git a/RecoTracker/MkFitCore/src/MkBuilder.cc b/RecoTracker/MkFitCore/src/MkBuilder.cc index 5ba073bfb298f..5c237563bd5b9 100644 --- a/RecoTracker/MkFitCore/src/MkBuilder.cc +++ b/RecoTracker/MkFitCore/src/MkBuilder.cc @@ -614,6 +614,9 @@ namespace mkfit { seed_cand_vec.clear(); + auto &iter_params = (iteration_dir == SteeringParams::IT_BkwSearch) ? m_job->m_iter_config.m_backward_params + : m_job->m_iter_config.m_params; + for (int iseed = start_seed; iseed < end_seed; ++iseed) { CombCandidate &ccand = m_event_of_comb_cands[iseed]; @@ -624,6 +627,11 @@ namespace mkfit { bool active = false; for (int ic = 0; ic < (int)ccand.size(); ++ic) { if (ccand[ic].getLastHitIdx() != -2) { + // Stop candidates with pT Date: Thu, 21 Apr 2022 00:05:39 +0200 Subject: [PATCH 2/2] modernize SiStripProcessedRawDigiProducer --- .../plugins/SealModules.cc | 8 -- .../SiStripProcessedRawDigiProducer.cc | 91 ++++++++++++++----- .../plugins/SiStripProcessedRawDigiProducer.h | 54 ----------- 3 files changed, 69 insertions(+), 84 deletions(-) delete mode 100644 AnalysisAlgos/SiStripClusterInfoProducer/plugins/SealModules.cc delete mode 100644 AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h diff --git a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SealModules.cc b/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SealModules.cc deleted file mode 100644 index ebe98c1137682..0000000000000 --- a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SealModules.cc +++ /dev/null @@ -1,8 +0,0 @@ - -#include "FWCore/PluginManager/interface/ModuleDef.h" - -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h" - -DEFINE_FWK_MODULE(SiStripProcessedRawDigiProducer); diff --git a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.cc b/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.cc index 04ea834f65969..0a9d4b79d66f7 100644 --- a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.cc +++ b/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.cc @@ -1,16 +1,58 @@ -#include "AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h" +// system includes +#include +#include +#include +// user includes +#include "CalibFormats/SiStripObjects/interface/SiStripGain.h" +#include "CalibTracker/Records/interface/SiStripGainRcd.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/SiStripDigi/interface/SiStripDigi.h" +#include "DataFormats/SiStripDigi/interface/SiStripProcessedRawDigi.h" +#include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Utilities/interface/transform.h" +#include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripCommonModeNoiseSubtractor.h" +#include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripPedestalsSubtractor.h" +#include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripRawProcessingFactory.h" -#include "DataFormats/SiStripDigi/interface/SiStripDigi.h" -#include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h" -#include "DataFormats/SiStripDigi/interface/SiStripProcessedRawDigi.h" +class SiStripProcessedRawDigiProducer : public edm::stream::EDProducer<> { +public: + explicit SiStripProcessedRawDigiProducer(edm::ParameterSet const&); -#include +private: + void produce(edm::Event& e, const edm::EventSetup& es) override; + template + std::string findInput(edm::Handle& handle, const std::vector >& tokens, const edm::Event& e); + + void vr_process(const edm::DetSetVector&, + edm::DetSetVector&, + const SiStripGain&); + void pr_process(const edm::DetSetVector&, + edm::DetSetVector&, + const SiStripGain&); + void zs_process(const edm::DetSetVector&, + edm::DetSetVector&, + const SiStripGain&); + void common_process(const uint32_t, + std::vector&, + edm::DetSetVector&, + const SiStripGain&); + + const std::vector inputTags_; + const std::vector > > inputTokensDigi_; + const std::vector > > inputTokensRawDigi_; + const edm::ESGetToken gainToken_; + + std::unique_ptr subtractorPed_; + std::unique_ptr subtractorCMN_; +}; SiStripProcessedRawDigiProducer::SiStripProcessedRawDigiProducer(edm::ParameterSet const& conf) : inputTags_(conf.getParameter >("DigiProducersList")), @@ -66,37 +108,37 @@ void SiStripProcessedRawDigiProducer::zs_process(const edm::DetSetVector& output, const SiStripGain& gain) { std::vector digis; - for (edm::DetSetVector::const_iterator detset = input.begin(); detset != input.end(); ++detset) { + for (const auto& detset : input) { digis.clear(); - for (edm::DetSet::const_iterator digi = detset->begin(); digi != detset->end(); ++digi) { - digis.resize(digi->strip(), 0); - digis.push_back(digi->adc()); + for (const auto& digi : detset) { + digis.resize(digi.strip(), 0); + digis.push_back(digi.adc()); } - common_process(detset->id, digis, output, gain); + common_process(detset.id, digis, output, gain); } } void SiStripProcessedRawDigiProducer::pr_process(const edm::DetSetVector& input, edm::DetSetVector& output, const SiStripGain& gain) { - for (edm::DetSetVector::const_iterator detset = input.begin(); detset != input.end(); ++detset) { + for (const auto& detset : input) { std::vector digis; transform( - detset->begin(), detset->end(), back_inserter(digis), std::bind(&SiStripRawDigi::adc, std::placeholders::_1)); - subtractorCMN_->subtract(detset->id, 0, digis); - common_process(detset->id, digis, output, gain); + detset.begin(), detset.end(), back_inserter(digis), std::bind(&SiStripRawDigi::adc, std::placeholders::_1)); + subtractorCMN_->subtract(detset.id, 0, digis); + common_process(detset.id, digis, output, gain); } } void SiStripProcessedRawDigiProducer::vr_process(const edm::DetSetVector& input, edm::DetSetVector& output, const SiStripGain& gain) { - for (edm::DetSetVector::const_iterator detset = input.begin(); detset != input.end(); ++detset) { - std::vector int_digis(detset->size()); - subtractorPed_->subtract(*detset, int_digis); + for (const auto& detset : input) { + std::vector int_digis(detset.size()); + subtractorPed_->subtract(detset, int_digis); std::vector digis(int_digis.begin(), int_digis.end()); - subtractorCMN_->subtract(detset->id, 0, digis); - common_process(detset->id, digis, output, gain); + subtractorCMN_->subtract(detset.id, 0, digis); + common_process(detset.id, digis, output, gain); } } @@ -106,11 +148,16 @@ void SiStripProcessedRawDigiProducer::common_process(const uint32_t detId, const SiStripGain& gain) { //Apply Gains SiStripApvGain::Range detGainRange = gain.getRange(detId); - for (std::vector::iterator it = digis.begin(); it < digis.end(); ++it) - (*it) /= (gain.getStripGain(it - digis.begin(), detGainRange)); + for (auto& it : digis) + it /= (gain.getStripGain(it - *digis.begin(), detGainRange)); //Insert as DetSet edm::DetSet ds(detId); copy(digis.begin(), digis.end(), back_inserter(ds.data)); output.insert(ds); } + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(SiStripProcessedRawDigiProducer); diff --git a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h b/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h deleted file mode 100644 index b383316806919..0000000000000 --- a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef AnalysisAlgos_SiStripClusterInfoProducer_SiStripProcessedRawDigiProducer_H -#define AnalysisAlgos_SiStripClusterInfoProducer_SiStripProcessedRawDigiProducer_H - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Utilities/interface/InputTag.h" - -#include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripPedestalsSubtractor.h" -#include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripCommonModeNoiseSubtractor.h" -#include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripRawProcessingFactory.h" - -#include "CalibFormats/SiStripObjects/interface/SiStripGain.h" -#include "CalibTracker/Records/interface/SiStripGainRcd.h" - -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/SiStripDigi/interface/SiStripDigi.h" -#include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h" -#include -#include - -class SiStripProcessedRawDigi; - -class SiStripProcessedRawDigiProducer : public edm::EDProducer { -public: - explicit SiStripProcessedRawDigiProducer(edm::ParameterSet const&); - -private: - void produce(edm::Event& e, const edm::EventSetup& es) override; - template - std::string findInput(edm::Handle& handle, const std::vector >& tokens, const edm::Event& e); - - void vr_process(const edm::DetSetVector&, - edm::DetSetVector&, - const SiStripGain&); - void pr_process(const edm::DetSetVector&, - edm::DetSetVector&, - const SiStripGain&); - void zs_process(const edm::DetSetVector&, - edm::DetSetVector&, - const SiStripGain&); - void common_process(const uint32_t, - std::vector&, - edm::DetSetVector&, - const SiStripGain&); - - std::vector inputTags_; - std::vector > > inputTokensDigi_; - std::vector > > inputTokensRawDigi_; - edm::ESGetToken gainToken_; - - std::unique_ptr subtractorPed_; - std::unique_ptr subtractorCMN_; -}; -#endif