Skip to content

Add a unit test for isFromRadDecay and fix its ancestry walk - #15675

Open
sawenzel wants to merge 1 commit into
AliceO2Group:devfrom
sawenzel:fix-isFromRadDecay-ancestry-walk
Open

Add a unit test for isFromRadDecay and fix its ancestry walk#15675
sawenzel wants to merge 1 commit into
AliceO2Group:devfrom
sawenzel:fix-isFromRadDecay-ancestry-walk

Conversation

@sawenzel

Copy link
Copy Markdown
Collaborator

This PR adds a unit test and fixes two bugs in the isFromRadDecay query introduced in #15470.

  • New test case in testStack.cxx — builds a small stack with a radioactive decay as the first secondary of its primary. Four of its checks fail on dev today.
  • Primaries wrongly returned truemTrackIDtoParticlesEntry is meaningless for a primary, since primaries never enter mParticles, so the lookup landed on an unrelated secondary.
  • Descendants of a radioactive decay wrongly returned falsewhile (imo > 0) skipped buffer entry 0, which after FinishPrimary() is the first secondary of the current primary.
  • Fix: walk trackIDs, stop at mNumberOfPrimaryParticles — the same primary test selectTracks() uses, so the mapping is never consulted for a primary.
  • Const correctness, reference-vs-copy, and include fixes.

The query added in AliceO2Group#15470 gave two wrong answers. Primaries returned true,
because mTrackIDtoParticlesEntry is meaningless for them - primaries never
enter mParticles - so the lookup landed on an unrelated secondary. Descendants
of a radioactive decay returned false, because the `imo > 0` guard skipped
buffer entry 0, which after FinishPrimary() is the first secondary of the
current primary.

Walking trackIDs and stopping at mNumberOfPrimaryParticles removes both, and
the method becomes const, binds a reference instead of copying the MCTrack, and
drops the two includes MCTrack.h already provides. The new test case fails on
all four affected checks without this change.
@sawenzel
sawenzel requested a review from shahor02 as a code owner August 10, 2026 13:00
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for bb4b31e at 2026-08-10 18:49:

## sw/BUILD/O2-full-system-test-latest/log
command /sw/slc9_x86-64/O2/slc9_x86-64-slc9_x86-64-local3/prodtests/full-system-test/dpl-workflow.sh had nonzero exit code 1
[12976:internal-dpl-injected-dummy-sink]: [18:48:29][ERROR] Failed binding socket internal-dpl-injected-dummy-sink.metric-feedback[0].push, address: ipc://@metric-feedback-0, reason: Address already in use
[12976:internal-dpl-injected-dummy-sink]: [18:48:29][ERROR] failed to attach channel metric-feedback[0] (bind on ipc://@metric-feedback-0)
[12976:internal-dpl-injected-dummy-sink]: [18:48:29][ERROR] 1 of the binding channels could not initialize. Initial configuration incomplete.
[12976:internal-dpl-injected-dummy-sink]: [18:48:29][FATAL] error while setting up workflow in o2-ctf-reader-workflow: 1 of the binding channels could not initialize. Initial configuration incomplete.
[ERROR] Workflow crashed - PID 12976 (internal-dpl-injected-dummy-sink) did not exit correctly however it's not clear why. Exit code forced to 128.
[ERROR]  - Device internal-dpl-injected-dummy-sink: pid 12976 (exit 128)
[INFO]    - First error: [18:48:29][FATAL] error while setting up workflow in o2-ctf-reader-workflow: 1 of the binding channels could not initialize. Initial configuration incomplete.
[ERROR] SEVERE: Device internal-dpl-injected-dummy-sink (12976) had at least one message above severity 7: error while setting up workflow in o2-ctf-reader-workflow: 1 of the binding channels could not initialize. Initial configuration incomplete.


## sw/BUILD/o2checkcode-latest/log
--
========== List of errors found ==========
++ GRERR=0
++ grep -v clang-diagnostic-error error-log.txt
++ grep ' error:'
grep: error-log.txt: binary file matches
++ GRERR=1
++ [[ 1 == 0 ]]
++ mkdir -p /sw/INSTALLROOT/d1bb118a6115773ad0a0b24a3cc0e461bab8cd69/slc9_x86-64/o2checkcode/1.0-local9/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='safe_int googlebenchmark bz2 ninja-fortran alibuild-recipe-tools O2-customization ninja date pytorch_cpuinfo UUID Python-modules-list MPFR CMake Alice-GRID-Utils json-c double-conversion FairCMakeModules defaults-release'
+ echo 'FULL_BUILD_REQUIRES=safe_int googlebenchmark bz2 ninja-fortran alibuild-recipe-tools O2-customization ninja date pytorch_cpuinfo UUID Python-modules-list MPFR CMake Alice-GRID-Utils json-c double-conversion FairCMakeModules defaults-release'
FULL_BUILD_REQUIRES=safe_int googlebenchmark bz2 ninja-fortran alibuild-recipe-tools O2-customization ninja date pytorch_cpuinfo UUID Python-modules-list MPFR CMake Alice-GRID-Utils json-c double-conversion FairCMakeModules defaults-release
++ 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 10
+ REVISION_VALUE=10
++ eval 'echo $LIBFFI_VERSION'
+++ echo v3.2.1-alice1
+ VERSION_VALUE=v3.2.1-alice1
[0 more errors; see full log]

Full log here.

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.

2 participants