From ef74e4df96d99a2d63c70cc02504858a19ea9416 Mon Sep 17 00:00:00 2001 From: Sandro Wenzel Date: Sun, 15 Nov 2026 10:20:44 +0100 Subject: [PATCH] Take the TPC ionisation of a stopping step from the energy deposit 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 --- Detectors/TPC/simulation/src/Detector.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Detectors/TPC/simulation/src/Detector.cxx b/Detectors/TPC/simulation/src/Detector.cxx index fcb546abb63b3..c0f4cc0da9e9e 100644 --- a/Detectors/TPC/simulation/src/Detector.cxx +++ b/Detectors/TPC/simulation/src/Detector.cxx @@ -211,7 +211,8 @@ Bool_t Detector::ProcessHits(FairVolume* vol) // I.H. - the type expected in addHit is float // use Geant4 energy deposit directly for ionisation (Kr-83m calibration simulations) - if (detParam.UseGeant4Edep) { + // and for the step that ends a track, whose post-step momentum cannot describe the step + if (detParam.UseGeant4Edep || fMC->IsTrackStop()) { // We have multiple collisions and add fluctuations: smear nel using // gamma distr with mean = meanIon and variance = meanIon*FanoFactorG4. // These parameters were tuned for GEANT4.