Skip to content

Commit 0b2823e

Browse files
[ALICE3] Protect LUT smearing against negative eigenvalues (#18726)
1 parent f030a22 commit 0b2823e

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)