From c53c52aa2d28cdd3c50e230b4bf034d5d182ad8f Mon Sep 17 00:00:00 2001 From: Tim Adye Date: Fri, 25 Oct 2024 17:37:35 +0100 Subject: [PATCH 1/4] protect TrackSelector against eta=nan --- Core/include/Acts/TrackFinding/TrackSelector.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/include/Acts/TrackFinding/TrackSelector.hpp b/Core/include/Acts/TrackFinding/TrackSelector.hpp index bca7fa8d2a0..1442e393007 100644 --- a/Core/include/Acts/TrackFinding/TrackSelector.hpp +++ b/Core/include/Acts/TrackFinding/TrackSelector.hpp @@ -427,8 +427,8 @@ bool TrackSelector::isValidTrack(const track_proxy_t& track) const { const Config* cutsPtr{nullptr}; if (!m_isUnbinned) { - if (absEta() < m_cfg.absEtaEdges.front() || - _absEta >= m_cfg.absEtaEdges.back()) { + if (!(absEta() >= m_cfg.absEtaEdges.front() && + _absEta < m_cfg.absEtaEdges.back())) { return false; } cutsPtr = &m_cfg.getCuts(_eta); From 7da22843a14c386fbbaa1049852006cd3a951ecc Mon Sep 17 00:00:00 2001 From: Tim Adye Date: Fri, 25 Oct 2024 17:48:19 +0100 Subject: [PATCH 2/4] add comment --- Core/include/Acts/TrackFinding/TrackSelector.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/include/Acts/TrackFinding/TrackSelector.hpp b/Core/include/Acts/TrackFinding/TrackSelector.hpp index 1442e393007..e9e251a4fb3 100644 --- a/Core/include/Acts/TrackFinding/TrackSelector.hpp +++ b/Core/include/Acts/TrackFinding/TrackSelector.hpp @@ -427,6 +427,7 @@ bool TrackSelector::isValidTrack(const track_proxy_t& track) const { const Config* cutsPtr{nullptr}; if (!m_isUnbinned) { + // return false if |eta| is outside its range, or nan. if (!(absEta() >= m_cfg.absEtaEdges.front() && _absEta < m_cfg.absEtaEdges.back())) { return false; From e79eb0814a3d55bc1b56d7c98a101171e9710289 Mon Sep 17 00:00:00 2001 From: Tim Adye Date: Fri, 25 Oct 2024 17:51:08 +0100 Subject: [PATCH 3/4] format --- Core/include/Acts/TrackFinding/TrackSelector.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/include/Acts/TrackFinding/TrackSelector.hpp b/Core/include/Acts/TrackFinding/TrackSelector.hpp index e9e251a4fb3..459ab996857 100644 --- a/Core/include/Acts/TrackFinding/TrackSelector.hpp +++ b/Core/include/Acts/TrackFinding/TrackSelector.hpp @@ -429,7 +429,7 @@ bool TrackSelector::isValidTrack(const track_proxy_t& track) const { if (!m_isUnbinned) { // return false if |eta| is outside its range, or nan. if (!(absEta() >= m_cfg.absEtaEdges.front() && - _absEta < m_cfg.absEtaEdges.back())) { + _absEta < m_cfg.absEtaEdges.back())) { return false; } cutsPtr = &m_cfg.getCuts(_eta); From 1ace19a48dfe21879aa50f20015e009e0517fef2 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Wed, 30 Oct 2024 10:10:32 +0100 Subject: [PATCH 4/4] fix: MeasSel error output, config check --- Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp | 2 +- Core/src/TrackFinding/MeasurementSelector.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp index 05e236e1e29..35acbc49feb 100644 --- a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp +++ b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp @@ -399,7 +399,7 @@ class CombinatorialKalmanFilter { measurementSelector(trackStateCandidates, isOutlier, logger); if (!selectorResult.ok()) { ACTS_ERROR("Selection of calibrated measurements failed: " - << selectorResult.error()); + << selectorResult.error().message()); resultTrackStateList = ResultTrackStateList::failure(selectorResult.error()); } else { diff --git a/Core/src/TrackFinding/MeasurementSelector.cpp b/Core/src/TrackFinding/MeasurementSelector.cpp index 130c8381536..f3de466f5df 100644 --- a/Core/src/TrackFinding/MeasurementSelector.cpp +++ b/Core/src/TrackFinding/MeasurementSelector.cpp @@ -29,6 +29,11 @@ MeasurementSelector::MeasurementSelector(const MeasurementSelectorCuts& cuts) : MeasurementSelector({{GeometryIdentifier(), cuts}}) {} MeasurementSelector::MeasurementSelector(const Config& config) { + if (config.empty()) { + throw std::invalid_argument( + "MeasurementSelector: Configuration must not be empty"); + } + std::vector tmp; tmp.reserve(config.size()); for (std::size_t i = 0; i < config.size(); ++i) {