From 6c16651d1ed273829995c4c134e869c9fca86924 Mon Sep 17 00:00:00 2001 From: Federico Meloni Date: Mon, 24 Nov 2025 16:43:24 +0100 Subject: [PATCH] added max pT to track selector --- source/Utils/include/FilterTracks.h | 1 + source/Utils/src/FilterTracks.cc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/Utils/include/FilterTracks.h b/source/Utils/include/FilterTracks.h index 636eb73..0b701d1 100644 --- a/source/Utils/include/FilterTracks.h +++ b/source/Utils/include/FilterTracks.h @@ -75,6 +75,7 @@ class FilterTracks : public marlin::Processor { //! Cut off for momentum (GeV) float _MinPt = 1.0; // units GeV + float _MaxPt = -99.0; // units GeV //! Cut off for spatial and temporal chi squared values float _Chi2Spatial = 0; diff --git a/source/Utils/src/FilterTracks.cc b/source/Utils/src/FilterTracks.cc index 0f51023..b0364e1 100644 --- a/source/Utils/src/FilterTracks.cc +++ b/source/Utils/src/FilterTracks.cc @@ -54,6 +54,8 @@ FilterTracks::FilterTracks() : Processor("FilterTracks") { registerProcessorParameter("MinPt", "Minimum transverse momentum", _MinPt, _MinPt); + registerProcessorParameter("MaxPt", "Maximum transverse momentum", _MaxPt, _MaxPt); + registerProcessorParameter("MaxD0", "Max d0", _MaxD0, _MaxD0); registerProcessorParameter("MaxZ0", "Max z0", _MaxZ0, _MaxZ0); @@ -168,7 +170,11 @@ void FilterTracks::processEvent(LCEvent* evt) { continue; } if (pt < _MinPt){ - streamlog_out(DEBUG) << "Pt = " << pt << " GeV, skipping track!" << std::endl; + streamlog_out(DEBUG) << "Pt = " << pt << " GeV [below minimum], skipping track!" << std::endl; + continue; + } + if (_MaxPt > 0 && pt > _MaxPt){ + streamlog_out(DEBUG) << "Pt = " << pt << " GeV [above maximum], skipping track!" << std::endl; continue; } if (chi2spatial/ndf > _Chi2Spatial){