Repository navigation
Conversation
This fixes a problem in the TPC ionisation of a step that ends below the validity of the collision model. - The collision model took beta*gamma from the momentum after the step and clamped it at 7e-3. - For a track that ranged out in the step this gave up to 3.5e4 electrons for a 1 mm step, more than its energy allows. - A finite step ending below beta*gamma 7e-3 now takes its charge from Edep / Wion. - Zero-length steps (tracking-cut kills, capture at rest) still give no charge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sawenzel
requested review from
davidrohr,
shahor02 and
wiechula
as code owners
November 15, 2026 19:37
This branch has not been deployed
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 is fixing a problem in the TPC ionisation of a step that ends below the validity of the collision model, found while studying another EM model, and is a preparation towards G4HepEm and AdePT.
The collision model takes beta*gamma from the momentum after the step and clamps it at 7e-3. For a track that ranges out within the step the momentum is zero, and a 1 mm step can then produce up to 3.5e4 ionisation electrons, more than the particle's energy allows. With the current Geant4 setup this is rare for electrons, which are mostly stopped by the 10 keV tracking cut before, but it also hits positrons and muons ranging out in the gas, and an EM model that ranges electrons out to zero energy hits it about once per primary particle.
A finite step that ends below beta*gamma 7e-3 now takes its charge from Edep / Wion. Zero-length steps, from tracks killed by the tracking cut or captured at rest, still give no charge; including their residual energy would raise the median summed TPC charge by 3–4.5 % and is left to a separate decision. With Geant4, the hits above 1e4 electrons from stopping e-, e+ and mu+ are gone, the median summed TPC charge per 1 GeV/c particle is unchanged, and the mean decreases by 1.6 % (e-) and 2.5 % (pi+).
Electrons per TPC hit for 1 GeV/c e⁻ and π⁺, same build and seed with and without the fix.
Implementation assisted by Claude Code.