From 5fc391b302b076a2cdd645ef57fc2efb36f80313 Mon Sep 17 00:00:00 2001 From: Pierfrancesco Butti Date: Tue, 12 Nov 2024 09:09:29 +0100 Subject: [PATCH] fix: Track selector printouts to be in line with actual cuts (#3815) Minor fix to the printouts in the track selector to show the right limits applied to the counters. ## Summary by CodeRabbit - **New Features** - Enhanced output clarity with new printing functions for cut values in track selection. - Added validation checks for `etaMax` parameter and improved error handling for bin indexing. - **Bug Fixes** - Updated logic for evaluating track validity to ensure accurate results. --- .../Acts/TrackFinding/TrackSelector.hpp | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/Core/include/Acts/TrackFinding/TrackSelector.hpp b/Core/include/Acts/TrackFinding/TrackSelector.hpp index 459ab996857..5a2cf53df27 100644 --- a/Core/include/Acts/TrackFinding/TrackSelector.hpp +++ b/Core/include/Acts/TrackFinding/TrackSelector.hpp @@ -304,24 +304,32 @@ inline TrackSelector::Config& TrackSelector::Config::pt(double min, inline std::ostream& operator<<(std::ostream& os, const TrackSelector::Config& cuts) { - auto print = [&](const char* name, const auto& min, const auto& max) { + // for printing cuts set up with `within` + auto printMinMax = [&](const char* name, const auto& min, const auto& max) { os << " - " << min << " <= " << name << " < " << max << "\n"; }; + // for printing cuts set up with `checkMin` + auto printMin = [&](const char* name, const auto& min) { + os << " - " << min << " <= " << name << "\n"; + }; + // for printing cuts set up with `checkMax` + auto printMax = [&](const char* name, const auto& max) { + os << " - " << name << " <= " << max << "\n"; + }; - print("loc0", cuts.loc0Min, cuts.loc0Max); - print("loc1", cuts.loc1Min, cuts.loc1Max); - print("time", cuts.timeMin, cuts.timeMax); - print("phi", cuts.phiMin, cuts.phiMax); - print("eta", cuts.etaMin, cuts.etaMax); - print("absEta", cuts.absEtaMin, cuts.absEtaMax); - print("pt", cuts.ptMin, cuts.ptMax); - print("nHoles", 0, cuts.maxHoles); - print("nOutliers", 0, cuts.maxOutliers); - print("nHoles + nOutliers", 0, cuts.maxHolesAndOutliers); - print("nSharedHits", 0, cuts.maxSharedHits); - print("chi2", 0.0, cuts.maxChi2); - os << " - " << cuts.minMeasurements << " <= nMeasurements\n"; - + printMinMax("loc0", cuts.loc0Min, cuts.loc0Max); + printMinMax("loc1", cuts.loc1Min, cuts.loc1Max); + printMinMax("time", cuts.timeMin, cuts.timeMax); + printMinMax("phi", cuts.phiMin, cuts.phiMax); + printMinMax("eta", cuts.etaMin, cuts.etaMax); + printMinMax("absEta", cuts.absEtaMin, cuts.absEtaMax); + printMinMax("pt", cuts.ptMin, cuts.ptMax); + printMax("nHoles", cuts.maxHoles); + printMax("nOutliers", cuts.maxOutliers); + printMax("nHoles + nOutliers", cuts.maxHolesAndOutliers); + printMax("nSharedHits", cuts.maxSharedHits); + printMax("chi2", cuts.maxChi2); + printMin("nMeasurements", cuts.minMeasurements); return os; }