From 7cbb7c5993f5039d06d4563554a3666a5c519396 Mon Sep 17 00:00:00 2001 From: shahoian Date: Sat, 28 Feb 2026 17:54:43 +0100 Subject: [PATCH] Fix in the 3D field propagation final step --- .../Reconstruction/src/TrackParametrization.cxx | 10 +++++----- .../src/TrackParametrizationWithError.cxx | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DataFormats/Reconstruction/src/TrackParametrization.cxx b/DataFormats/Reconstruction/src/TrackParametrization.cxx index 7fe677a6e1c7a..4b850fe14086b 100644 --- a/DataFormats/Reconstruction/src/TrackParametrization.cxx +++ b/DataFormats/Reconstruction/src/TrackParametrization.cxx @@ -314,14 +314,14 @@ GPUd() bool TrackParametrization::propagateParamTo(value_t xk, const di // Do the final correcting step to the target plane (linear approximation) value_t x = vecLab[0], y = vecLab[1], z = vecLab[2]; - if (gpu::CAMath::Abs(dx) > constants::math::Almost0) { + if (gpu::CAMath::Abs(x - xk) > constants::math::Almost0) { if (gpu::CAMath::Abs(vecLab[3]) < constants::math::Almost0) { return false; } - dx = xk - vecLab[0]; - x += dx; - y += vecLab[4] / vecLab[3] * dx; - z += vecLab[5] / vecLab[3] * dx; + auto dxFin = xk - vecLab[0]; + x += dxFin; + y += vecLab[4] / vecLab[3] * dxFin; + z += vecLab[5] / vecLab[3] * dxFin; } // Calculate the track parameters diff --git a/DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx b/DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx index 2f8f15f783c60..93ff7e1a2eb82 100644 --- a/DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx +++ b/DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx @@ -776,14 +776,14 @@ GPUd() bool TrackParametrizationWithError::propagateTo(value_t xk, cons // Do the final correcting step to the target plane (linear approximation) value_t x = vecLab[0], y = vecLab[1], z = vecLab[2]; - if (gpu::CAMath::Abs(dx) > constants::math::Almost0) { + if (gpu::CAMath::Abs(x - xk) > constants::math::Almost0) { if (gpu::CAMath::Abs(vecLab[3]) < constants::math::Almost0) { return false; } - dx = xk - vecLab[0]; - x += dx; - y += vecLab[4] / vecLab[3] * dx; - z += vecLab[5] / vecLab[3] * dx; + auto dxFin = xk - vecLab[0]; + x += dxFin; + y += vecLab[4] / vecLab[3] * dxFin; + z += vecLab[5] / vecLab[3] * dxFin; } // Calculate the track parameters @@ -896,7 +896,7 @@ GPUd() bool TrackParametrizationWithError::propagateTo(value_t xk, Trac // Do the final correcting step to the target plane (linear approximation) value_t x = vecLab[0], y = vecLab[1], z = vecLab[2]; - if (gpu::CAMath::Abs(dx) > constants::math::Almost0) { + if (gpu::CAMath::Abs(x - xk) > constants::math::Almost0) { if (gpu::CAMath::Abs(vecLab[3]) < constants::math::Almost0) { return false; }