Skip to content

o2-sim: Improvements for media initialization order and strong track-seeding for Geant4 - #15663

Merged
sawenzel merged 4 commits into
AliceO2Group:devfrom
sawenzel:fix/track-seeding-pretrack
Aug 6, 2026
Merged

o2-sim: Improvements for media initialization order and strong track-seeding for Geant4#15663
sawenzel merged 4 commits into
AliceO2Group:devfrom
sawenzel:fix/track-seeding-pretrack

Conversation

@sawenzel

Copy link
Copy Markdown
Collaborator

Fixing a long standing bug in the order of initialization between magnetic field and media (harmless).

Providing strong track seeding and better reproducibility for Geant4 (so far only worked for Geant3).

Fixing a long standing error message about "No magnetic field found"
when initializing tracking media.
Fixed by reordering of initializations.
SimCutParams.trackSeed was so far a no-op with Geant4 because seeding only
occurred in the Geant3 stack-pop path. Add the missing seeding hook in
O2MCApplicationBase::PreTrack(), which Geant4 invokes for both primary and
secondary tracks on their first step.
Geant3 continues to seed at stack-pop time. This preserves existing behaviour
and avoids moving seeding to a later hook, which measurably reduces
reproducibility.
The PreTrack seed is derived from the engine track state rather than
Stack::GetCurrentTrack(), which is only reliable for Geant4 primaries.
Also add diagnostics to detect missing seed propagation by counting successful
seed applications and warning at the end of the event if track seeding was
requested but never performed.
Verified on both Geant3 and Geant4: per-track seeding now works as intended and
existing Geant3 behaviour remains unchanged.
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for 7376225 at 2026-08-05 13:35:

## sw/BUILD/O2-latest/log
CMake Error in Detectors/Base/CMakeLists.txt:

Full log here.

Removed redundant comments about Geant3 seeding comparison.
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for d464385 at 2026-08-06 00:04:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

@sawenzel
sawenzel merged commit 2ef5876 into AliceO2Group:devAug 6, 2026
8 of 10 checks passed
@sawenzel
sawenzel deleted the fix/track-seeding-pretrack branch August 6, 2026 08:19
Sign up for freeto 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

@sawenzel@alibuild