Repository navigation
Conversation
This fixes a problem in the TPC ionisation of the step that ends a track. - The collision model takes beta*gamma from the momentum after the step, which is zero for a stopping track and is then clamped at 7e-3. - A 1 mm step of a stopping electron could then produce up to 3.5e4 ionisation electrons, more than its energy allows. - With G4HepEm this happened about once per primary particle. - Such steps now use the Geant4 energy deposit, as already done for Kr-83m simulations. 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:14
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 the step that ends a track, found while studying another EM model, and is a preparation towards G4HepEm and AdePT.
The TPC collision model takes betagamma from the momentum after the step. For a track that stops in this step the momentum is zero, betagamma is clamped at 7e-3, and a 1 mm step of a stopping electron can then produce up to 3.5e4 ionisation electrons, more than its energy allows. With the current Geant4 setup this is rare, because electrons are stopped by the 10 keV cut before, but an EM model that ranges electrons out to zero energy hits it about once per primary particle.
The stopping step now takes its charge from the Geant4 energy deposit, as already done for the Kr-83m simulations. With Geant4, this removes the rare hits with 2–4·10⁴ electrons (about 0.008 per 1 GeV/c electron); the median of the summed TPC charge per particle is unchanged, the mean decreases by 1.6–1.9 %.
Electrons per TPC hit for 1 GeV/c e⁻ and π⁺, same build and seed with and without the fix.
Implementation assisted by Claude Code.