From 70bcd44fffa85eb20d3e93cf18c8203629e41cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Kr=C3=BCger?= Date: Fri, 13 Nov 2026 11:08:14 +0100 Subject: [PATCH] [ALICE3] Protect LUT smearing against negative eigenvalues A LUT covariance matrix close to singular (strongly correlated track parameters at low pT) can carry a tiny negative eigenvalue (~ -1e-7) from numerical precision. std::sqrt of it gives NaN, the smeared track gets NaN parameters and is dropped by the on-the-fly tracker (hNaNBookkeeping). This shows up as holes in the tracking efficiency in single pT bins and eta halves, e.g. for e, pi, K, p between 0.09 and 0.25 GeV/c with 0.5 T LUTs. Clamp the eigenvalue at zero before taking the square root: such a mode has practically zero width, so it is simply not smeared. --- ALICE3/Core/FlatTrackSmearer.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ALICE3/Core/FlatTrackSmearer.cxx b/ALICE3/Core/FlatTrackSmearer.cxx index 9617315d2e4..c8c5a4555a5 100644 --- a/ALICE3/Core/FlatTrackSmearer.cxx +++ b/ALICE3/Core/FlatTrackSmearer.cxx @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -323,7 +324,10 @@ bool TrackSmearer::smearTrack(O2Track& o2track, const lutEntry_t* lutEntry, cons for (int j = 0; j < kNumEigenModes; ++j) { val += lutEntry->eigvec[j][i] * o2track.getParam(j); } - params[i] = gRandom->Gaus(val, std::sqrt(lutEntry->eigval[i])); + // A LUT covariance close to singular (strongly correlated parameters at low pT) can carry a tiny negative + // eigenvalue from numerical precision. std::sqrt of it gives NaN and the track is dropped later on, which + // shows up as holes in the tracking efficiency. Such a mode has practically zero width: do not smear along it. + params[i] = gRandom->Gaus(val, std::sqrt(std::max(0.f, lutEntry->eigval[i]))); } // Transform back params vector