Skip to content

[WIP] Multi-Channel Positronium Decay Source Model#763

Open
wkrzemien wants to merge 144 commits into
OpenGATE:developfrom
cis-imaging:positronium_source_rebased
Open

[WIP] Multi-Channel Positronium Decay Source Model#763
wkrzemien wants to merge 144 commits into
OpenGATE:developfrom
cis-imaging:positronium_source_rebased

Conversation

@wkrzemien
Copy link
Copy Markdown

@wkrzemien wkrzemien commented May 14, 2026

A Multi-Channel Positronium Decay Source Model

This work introduces an extended positronium source model for GATE, centred on a clearer separation between source configuration, decay parameter generation, and decay model execution. The implementation adds support for multiple decay-related configurations, including prompt gamma handling, Electron Capture, lifetime and energy parameters, and positron range modelling, while preserving backward compatibility through a dedicated legacy layer.

In addition to the source-model refactoring, the branch introduces a new multiphoton analysis module integrated with the existing digits_hits and ROOT output pipeline. The overall change is supported by an expanded set of unit tests and build-system updates, making the new functionality easier to validate and maintain.

Main changes

1. Refactoring and extension of positronium support

  • A new positronium handling layer was extracted and organized, introducing classes such as GatePositronium, GatePositroniumSource, GatePositroniumSourceMessenger, GatePositroniumHelper, GatePositroniumDecayParamsGenerator, GatePositroniumConstants, and GatePositroniumDecayModelParams.
  • The GatePositroniumSource structure was simplified and the parameter flow between the messenger, decay parameter generator, and decay model was clarified.
  • GatePositroniumDecayModel and related classes were refactored to improve naming, physical constants, decay channel handling, and parameter validation.

2. Backward compatibility through legacy extraction

  • Older implementations related to positronium, ExtendedVSource, GammaEmissionModel, and EmittedGammaInformation were moved into the legacy namespace.
  • Changes in CMakeLists.txt and GateSourceMgr connect the new implementation while preserving a backward-compatible execution path.
  • This PR separates ongoing development from old code and reduces the risk of mixing both execution paths.

3. Extended physics configuration and decay parameter handling

  • Support was added for prompt gamma and prompt probabilities in both the messenger and the decay model.
  • Parsing of parameters with units for energies and lifetimes was added, along with improved validation of the number of provided parameters.
  • Support was added for mean positron range and decay vertex shifting.
  • Electron Capture handling was introduced together with additional consistency checks and fixes to warning conditions.
  • The output flow to ROOT was extended, including propagation of decayIndex.

4. New multiphoton analysis module

  • A new multiphoton analysis module was added under source/digits_hits, including GateMultiPhotonAnalysis, its messenger, helper utilities, and GateMultiPhotonTrajectoryNavigator.
  • The changes also integrate with GateHit, GateOutputMgr, GateToTree, and ROOT-related definitions.
  • This is the largest single functional addition outside the positronium refactoring itself.

5. Expanded tests and build integration

  • Tests were added or extended for GatePositronium, GatePositroniumDecayModel, GatePositroniumDecayParamsGenerator, GatePositroniumHelper, GatePositroniumSourceMessenger, and GateExtendedVSource.
  • Test utilities (TestingTools.h, test_dummy.cpp) and CMake test registration were also extended.
  • The commit history also shows a series of fixes driven by those tests, which suggests that the PR stabilizes the new code in parallel with extending it.

Short version for the PR description

This PR reorganizes and extends positronium support in GATE by introducing a new class structure for the source, decay model, and decay parameter generation, while moving older implementations into a legacy layer. It also extends the physics configuration with prompt gamma support, Electron Capture handling, unit-aware parameters, and positron range modeling.

In parallel, the PR adds a new multiphoton analysis module integrated with the existing data output and ROOT pipeline. The overall change is backed by a broad set of unit tests and CMake updates that connect the new functionality with the existing build system.

Authors: W. Krzemien, M. Bala, K. Dulski

wkrzemien added 30 commits May 9, 2026 00:28
Replace in-house code by std::optional. Also, removing const and & from
basic type arguments in setters.
E.g. calling sstringstream constructor instead of adding the value
later.
Also, update the contribution section
!Work in Progress!
Add the stub of the proposed solution
!Work in progress!
We can actually run some simple unit tests for GatePositroniumDecayModel
!Work in Progress!
Add some overlapping functionality e.g. MiniPositroniumDecayModel
to be able to test the new functionality independently. This must be
cleaned up later.
Add Gate initialization
Fix typo in method name, also ordering of the code etc.
Warning this is Work in Progress commit. Some part of code must be
still improved
It contains a raw pointer to fDecayChannel which it does not own.
It is meant to replace the GatePositroniumDecayModel later.
It uses cleaned up GatePositronium class.
wkrzemien and others added 30 commits May 9, 2026 00:31
Also, add a dedicated command to set the probabilites of electron
captures from macro
If, no prompt emission and electron capture happens, then we repeat the sampling
of the channel.
…int>(fractions.size()) - 1;

This -1 could lead to undefined behaviour, since it was used as a index.
Also, remove relevant tests and fix method signatures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants