Skip to content

TrackParametrization: use double math functions for TrackParD - #15990

Merged
shahor02 merged 1 commit into
AliceO2Group:devfrom
matthias-kleiner:trackpard-double-math
Oct 21, 2026
Merged

shahor02 merged 1 commit into
AliceO2Group:devfrom
matthias-kleiner:trackpard-double-math

Conversation

@matthias-kleiner

Copy link
Copy Markdown
Contributor

Follow-up to #15986. TrackParametrization, TrackParametrizationWithError and TrackUtils call the float-only gpu::CAMath functions (Sqrt, ASin, ATan2, ...), so TrackParD / PropagatorD is effectively float. Compared with a std:: double reference, propagateParamTo(x, b[3]) from x = 85 to 250 cm in 100 steps is off by 0.4 to 74 µm, depending on pt and the field (toy fields with a transverse component, no material), and finite-difference derivatives through it are noisy. This affects the barrel alignment (Detectors/Align) and the ITS3 alignment; no reconstruction workflow uses the double types.

Call math_utils::detail::{sqrt, asin, ...}<value_t> instead, as Propagator.cxx already does: for double these dispatch to the double functions, for float to the same functions as before. Add GPUCommonMath::Expd and math_utils::detail::exp for the remaining Exp calls. This restores the math_utils::detail calls of cd9835a (switched back to CAMath in bf65d3c) and extends them to TrackParametrizationWithError and TrackUtils.

Float results are bit-identical; TrackParD now agrees exactly with the double reference.

Follow-up to AliceO2Group#15986. TrackParametrization, TrackParametrizationWithError and
TrackUtils call the float-only gpu::CAMath functions (Sqrt, ASin, ATan2, ...),
so TrackParD / PropagatorD is effectively float. Compared with a std:: double
reference, propagateParamTo(x, b[3]) from x = 85 to 250 cm in 100 steps is off
by 0.4 to 74 µm, depending on pt and the field (toy fields with a transverse
component, no material), and finite-difference derivatives through it are
noisy. This affects the barrel alignment (Detectors/Align) and the ITS3
alignment; no reconstruction workflow uses the double types.

Call math_utils::detail::{sqrt, asin, ...}<value_t> instead, as Propagator.cxx
already does: for double these dispatch to the double functions, for float to
the same functions as before. Add GPUCommonMath::Expd and
math_utils::detail::exp for the remaining Exp calls. This restores the
math_utils::detail calls of cd9835a (switched back to CAMath in bf65d3c)
and extends them to TrackParametrizationWithError and TrackUtils.

Float results are bit-identical; TrackParD now agrees exactly with the double
reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@shahor02 shahor02 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting and fixing!

@davidrohr davidrohr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok for GPUCommonMath changes

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for 98bcd15 at 2026-10-21 12:37:

## sw/BUILD/O2-full-system-test-latest/log
command /sw/slc9_x86-64/O2/slc9_x86-64-slc9_x86-64-local11/prodtests/full-system-test/dpl-workflow.sh had nonzero exit code 1
[5586:internal-dpl-ccdb-backend]: [12:37:15][ERROR] CCDBDownloader CURL transfer error - Timeout was reached
[5586:internal-dpl-ccdb-backend]: [12:37:15][ERROR] CcdbDownloader finished transfer http://alice-ccdb.cern.ch/TRD/Calib/CalGain for 1550600800023 (agent_id: o2-itsmft-stf-d/o2-itsmft-stf-decoder-workflow@5586 target/Linux_x86_64 init/1792578817806 id/mesosci@alissandra02 session/IPvB49pK) with http code: 0
[5586:internal-dpl-ccdb-backend]: [12:37:15][ERROR] File TRD/Calib/CalGain could not be retrieved. No more hosts to try.
[5586:internal-dpl-ccdb-backend]: [12:37:15][FATAL] Unable to find CCDB object TRD/Calib/CalGain/1550600800023
[5586:internal-dpl-ccdb-backend]: [12:37:16][ERROR] Exception while running: Fatal error. Rethrowing.
[5586:internal-dpl-ccdb-backend]: [12:37:16][FATAL] Unhandled o2::framework::runtime_error reached the top of main of o2-itsmft-stf-decoder-workflow, device shutting down. Reason: Fatal error
[ERROR] Workflow crashed - PID 5586 (internal-dpl-ccdb-backend) did not exit correctly however it's not clear why. Exit code forced to 128.
[ERROR]  - Device internal-dpl-ccdb-backend: pid 5586 (exit 128)
[INFO]    - First error: [12:37:15][FATAL] Unable to find CCDB object TRD/Calib/CalGain/1550600800023
[ERROR] SEVERE: Device internal-dpl-ccdb-backend (5586) had at least one message above severity 7: Unable to find CCDB object TRD/Calib/CalGain/1550600800023


## sw/BUILD/o2checkcode-latest/log
--
========== List of errors found ==========
++ GRERR=0
++ grep -a -v clang-diagnostic-error error-log.txt
++ grep -a ' error:'
++ GRERR=1
++ [[ 1 == 0 ]]
++ mkdir -p /sw/INSTALLROOT/11de5df8da57992a091a6434770fd0656d5ad36f/slc9_x86-64/o2checkcode/1.0-local17/etc/modulefiles
++ alibuild-generate-module
+ HAS_BIN=
+ HAS_LIB=
+ HAS_CMAKE=
+ HAS_ROOT=
+ '[' 0 '!=' 0 ']'
+ cat
+ printf 'if ![ is-loaded '\''BASE/1.0'\'' ] {\n module load BASE/1.0\n}'
+ echo 'BUILD_REQUIRES=CMake alibuild-recipe-tools defaults-release'
BUILD_REQUIRES=CMake alibuild-recipe-tools defaults-release
+ FULL_BUILD_REQUIRES='FairCMakeModules pytorch_cpuinfo double-conversion ninja-fortran alibuild-recipe-tools googlebenchmark json-c O2-customization MPFR Alice-GRID-Utils CMake defaults-release safe_int Python-modules-list date bz2 ninja UUID'
+ echo 'FULL_BUILD_REQUIRES=FairCMakeModules pytorch_cpuinfo double-conversion ninja-fortran alibuild-recipe-tools googlebenchmark json-c O2-customization MPFR Alice-GRID-Utils CMake defaults-release safe_int Python-modules-list date bz2 ninja UUID'
FULL_BUILD_REQUIRES=FairCMakeModules pytorch_cpuinfo double-conversion ninja-fortran alibuild-recipe-tools googlebenchmark json-c O2-customization MPFR Alice-GRID-Utils CMake defaults-release safe_int Python-modules-list date bz2 ninja UUID
++ env
++ cut -f1 -d=
++ grep -v '^DEFAULT_'
++ grep -v PKGREVISION
++ grep -v ALIBUILD_RECIPE_TOOLS
++ grep REVISION
++ sed -e s/_REVISION//
+ for x in $(env | cut -f1 -d= | grep -v "^DEFAULT_" | grep -v PKGREVISION | grep -v ALIBUILD_RECIPE_TOOLS | grep REVISION | sed -e 's/_REVISION//')
++ eval 'echo $LIBFFI_REVISION'
+++ echo 14
+ REVISION_VALUE=14
++ eval 'echo $LIBFFI_VERSION'
+++ echo v3.2.1-alice1
[0 more errors; see full log]

Full log here.

@shahor02
shahor02 merged commit e02a56e into AliceO2Group:dev Oct 21, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants