Multi-Channel Positronium Decay Source Model#763
Merged
kochebina merged 152 commits intoJun 9, 2026
Conversation
Also, fix some comments.
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.
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.
It was reversed.
…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.
docs: add PositroniumSource user documentation
Also, prevent crash in PositroniumSource. Changes in GateCrystalSD: add fallback dynamic_cast to GateLegacy::GateEmittedGammaInformation when the primary cast to ::GateEmittedGammaInformation returns nullptr. The legacy ExtendedVSource attaches GateLegacy::GateEmittedGammaInformation objects, which are a different C++ type (separate namespace) from the new class, causing all three ROOT fields (sourceType, decayType, gammaType) to be written as 0. The fallback restores the correct values (sourceType=2/3, decayType=1/2, gammaType=2/3) for ExtendedVSource hits while leaving the PositroniumSource code path unchanged. Changes in GatePositroniumDecayModel: guard fPositronInteractions access in GetSourceKind with a bounds check to prevent an out-of-bounds crash when setPositronInteractions is not called (e.g. when only setDecayKinds is used). k2Gamma cannot be safely mapped to ParaPositronium because oPs pick-off/quenching also produces 2 gammas, so no fallback inference from fDecayKind is performed. SetSourceKind is only called when GetSourceKind returns a value other than NotDefined, preserving the base-class default (sourceType=1) when fPositronInteractions is not set. Changes in GatePositroniumDecayParamsGenerator: emit a one-time warning at parameter validation time when fPositronInteractions is empty, explaining that sourceType will be 1 (SingleGammaEmitter generic default) and why inference from decayKind is not done. Also, remove test_dummy.cpp
It should solve the fftw3 problem. It is not found correctly by cmake so part of the linking is failing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
legacylayer.In addition to the source-model refactoring, the branch introduces a new multiphoton analysis module integrated with the existing
digits_hitsand 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
GatePositronium,GatePositroniumSource,GatePositroniumSourceMessenger,GatePositroniumHelper,GatePositroniumDecayParamsGenerator,GatePositroniumConstants, andGatePositroniumDecayModelParams.GatePositroniumSourcestructure was simplified and the parameter flow between the messenger, decay parameter generator, and decay model was clarified.GatePositroniumDecayModeland related classes were refactored to improve naming, physical constants, decay channel handling, and parameter validation.2. Backward compatibility through legacy extraction
ExtendedVSource,GammaEmissionModel, andEmittedGammaInformationwere moved into thelegacynamespace.CMakeLists.txtandGateSourceMgrconnect the new implementation while preserving a backward-compatible execution path.3. Extended physics configuration and decay parameter handling
decayIndex.4. New multiphoton analysis module
source/digits_hits, includingGateMultiPhotonAnalysis, its messenger, helper utilities, andGateMultiPhotonTrajectoryNavigator.GateHit,GateOutputMgr,GateToTree, and ROOT-related definitions.5. Expanded tests and build integration
GatePositronium,GatePositroniumDecayModel,GatePositroniumDecayParamsGenerator,GatePositroniumHelper,GatePositroniumSourceMessenger, andGateExtendedVSource.TestingTools.h,test_dummy.cpp) and CMake test registration were also extended.ExtendedVSourcebenchmark, is added here: T35 Benchmark positronium source GateBenchmarks#110Short 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
legacylayer. 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