Fix user limits (step limiter)#835
Open
nkrah wants to merge 10 commits into
Open
Conversation
Contributor
|
replace test where step_limiter = "all" -> by "e- p etc..." |
… electron, positron, gamma.
…ome trivial and unnecessary
cfa397c to
0b2c5e7
Compare
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.
This PR fixes a performance issue observed in carbon ion therapy simulations where the dose actor could become unexpectedly slow because the step limiter was not applied to all relevant particles.
Previously, GATE treated the particles eligible for UserLimits similarly to production cuts and effectively restricted step-limiter selection to protons, electrons, positrons, and gammas. Geant4 can apply UserLimits to any particle with a process manager, and GATE v9 allowed this broader behavior. As a result, GATE v9 and GATE v10 applied step limiters differently, which could change tracking behavior and degrade performance in the affected simulations.
The main change updates the handling of
sim.physics_manager.user_limits_particlesso UserLimits can be applied to arbitrary Geant4 particles, including ions such asGenericIon. The special selectors now have explicit semantics:allapplies UserLimits to all particles known to the Geant4 particle table.all_chargedfollows Geant4's step-limiter behavior for charged particles.electronandpositronare translated to their Geant4 names.The PR also updates tests that previously relied on the old
allbehavior. Where a test should keep the historical four-particle selection, it now explicitly requestsproton,gamma,electron, andpositron. The user and developer documentation were updated to describe the new API and the internal step-limiter implementation.The temporary debug commits used during the investigation have been removed before merging.