Skip to content

Fix user limits (step limiter)#835

Open
nkrah wants to merge 10 commits into
masterfrom
debug_slow_dose_actor
Open

Fix user limits (step limiter)#835
nkrah wants to merge 10 commits into
masterfrom
debug_slow_dose_actor

Conversation

@nkrah
Copy link
Copy Markdown
Collaborator

@nkrah nkrah commented Nov 5, 2025

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_particles so UserLimits can be applied to arbitrary Geant4 particles, including ions such as GenericIon. The special selectors now have explicit semantics:

  • all applies UserLimits to all particles known to the Geant4 particle table.
  • all_charged follows Geant4's step-limiter behavior for charged particles.
  • Historical aliases such as electron and positron are translated to their Geant4 names.

The PR also updates tests that previously relied on the old all behavior. Where a test should keep the historical four-particle selection, it now explicitly requests proton, gamma, electron, and positron. 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.

@nkrah nkrah changed the title Debug slow dose actor Fix user limits (step limiter) Mar 13, 2026
@dsarrut dsarrut added the bug Something isn't working label Apr 14, 2026
@dsarrut
Copy link
Copy Markdown
Contributor

dsarrut commented Apr 14, 2026

replace test where step_limiter = "all" -> by "e- p etc..."

@nkrah nkrah force-pushed the debug_slow_dose_actor branch from cfa397c to 0b2c5e7 Compare May 21, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants