Skip to content

Commit 70bcd44

Browse files
committed
[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.
1 parent 81202ee commit 70bcd44

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎ALICE3/Core/FlatTrackSmearer.cxx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include <TRandom.h>
2323

24+
#include <algorithm>
2425
#include <cmath>
2526
#include <cstddef>
2627
#include <cstdint>
@@ -323,7 +324,10 @@ bool TrackSmearer::smearTrack(O2Track& o2track, const lutEntry_t* lutEntry, cons
323324
for (int j = 0; j < kNumEigenModes; ++j) {
324325
val += lutEntry->eigvec[j][i] * o2track.getParam(j);
325326
}
326-
params[i] = gRandom->Gaus(val, std::sqrt(lutEntry->eigval[i]));
327+
// A LUT covariance close to singular (strongly correlated parameters at low pT) can carry a tiny negative
328+
// eigenvalue from numerical precision. std::sqrt of it gives NaN and the track is dropped later on, which
329+
// shows up as holes in the tracking efficiency. Such a mode has practically zero width: do not smear along it.
330+
params[i] = gRandom->Gaus(val, std::sqrt(std::max(0.f, lutEntry->eigval[i])));
327331
}
328332

329333
// Transform back params vector

0 commit comments

Comments
 (0)