Repository navigation
Decay generator particles before transport - #15995
Merged
sawenzel merged 5 commits intoOct 22, 2026
Merged
Conversation
This commit provides a new tool o2-sim-g4-particle-table that writes the Geant4 particle table to a text file. - One line per particle with a PDG code: pdg, Geant4 name, ctau in mm, short-lived flag, decay-table flag. - The Geant4 setup is the same as in o2-sim-g4-determine-unknown-pdg-properties. - Particles that o2-sim adds at run time are not in the table. Usage: o2-sim-g4-particle-table --output g4_particle_table.dat https://its.cern.ch/jira/browse/O2-5903 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit provides a class EventDecayer that decays unstable generator particles with Pythia8 before transport and keeps the full decay chain in the MC truth. - It works in place on a std::vector<TParticle>, so that a generator can call it directly. - Only primaries flagged for transport are decayed; the products are appended with their displaced vertices. - Decayed particles keep their generator status and get HepMC status 2. - By default it reads the DecayerPythia8 configs and never decays species above tau0Max (10 mm/c) or listed in skipPdg. - Particles left for transport are checked against O2DatabasePDG and the Geant4 particle table. - The settings come from the new param EventDecayer. https://its.cern.ch/jira/browse/O2-5903 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit adds an optional decay step to Generator::ReadEvent, run after the trigger and before addTracks, and adds a unit test. - The new parameter EventDecayer.enable (default off) switches the step on. - The generator owns a lazily initialised EventDecayer and prints its report when destroyed. - The step uses the generator's position, time, momentum and energy units. - The step adds the header keys eventDecayer and eventDecayerSeed. - The step compiles out without Pythia8. Usage: o2-sim -g evtpool --configKeyValues "GeneratorEventPool.eventPoolPath=pool.root;EventDecayer.enable=true;EventDecayer.config[1]=my.cfg" https://its.cern.ch/jira/browse/O2-5903 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit updates the tau0 of eight weakly decaying charm and beauty hadrons in base.cfg to the PDG 2026 values. - Xi_c+ (4232): 0.132 -> 0.1358 mm. - Xi_c0 (4132): 0.0336 -> 0.04497 mm. - Omega_c0 (4332): 0.021 -> 0.08214 mm. - B_s0 (531): 0.439 -> 0.4542 mm, from the mean life 1/Gamma_s. - B_c+ (541): 0.138 -> 0.1529 mm. - Xi_b- (5132): 0.364 -> 0.4707 mm. - Xi_b0 (5232): 0.364 -> 0.4413 mm. - Omega_b- (5332): 0.364 -> 0.4917 mm. - Xi_c0 and Omega_c0 now differ from Geant4 by 1.3% and 2.2%, so the event decayer lists them in its lifetime report. - DecayerPythia8 reads the same file, but Geant4 takes only the momenta of the external decayer's products and places them at its own decay point (TG4ExtDecayer, G4Decay), so decays during transport do not change. https://pdglive.lbl.gov/Particle.action?init=0&node=S045 https://pdglive.lbl.gov/Particle.action?init=0&node=S048 https://pdglive.lbl.gov/Particle.action?init=0&node=S047 https://pdglive.lbl.gov/Particle.action?init=0&node=S086 https://pdglive.lbl.gov/Particle.action?init=0&node=S091 https://pdglive.lbl.gov/Particle.action?init=0&node=S069 https://pdglive.lbl.gov/Particle.action?init=0&node=S070 https://pdglive.lbl.gov/Particle.action?init=0&node=S063 https://its.cern.ch/jira/browse/O2-5903 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This rewrites the partonic decay test so that it passes with Pythia8 8.315 and 8.318. - Pythia8 8.318 hadronises the partons of a meMode 91 decay itself, so the decay succeeds, whereas 8.315 leaves partons and the decay fails. - The test now checks that no partonic particle is left to be transported, and the matching outcome in either case. https://its.cern.ch/jira/browse/O2-5903 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 adds a decay step to event generation, so that unstable particles which leave the generator undecayed are decayed by Pythia8 before transport instead of during the Geant4 transport.
Today such particles, for example charm baryons from event pools, are decayed either by Geant4's own tables or by Pythia8 as the VMC external decayer. In the second case Geant4 takes over only the final-state particles of the decay chain, so intermediate resonances are missing from the MC truth. In https://its.cern.ch/jira/browse/O2-7108 this removes the Ξ(1530)⁰ from Ξc⁺ → Ξ(1530)⁰ π⁺ (and the K̄⁰ and φ from Ξc⁺ → p K̄⁰ and p φ), and selecting the resonance for the external decayer instead crashes Geant4 in hadronic interactions.
The new class
o2::eventgen::EventDecayer(paramEventDecayer) decays the particles of one event in place and keeps the full decay chain as generator particles. It is called fromGenerator::ReadEventafter the trigger whenEventDecayer.enable=true, so it works for every generator including event-pool replay. By default it reads the same configs asDecayerPythia8, never decays species abovetau0Max(10 mm/c) or inskipPdg, and reports PDG codes unknown toO2DatabasePDGor to the Geant4 particle table written by the newo2-sim-g4-particle-table. An existing Kine file can be decayed the same way by replaying it with-g extkinO2. The PR also updates eight charm and beauty lifetimes in the Pythia8 decay base config to PDG 2026 values (e.g. Ω_c⁰ 0.021 → 0.082 mm).On 1102 events of the EP25i1 Ξc⁺ pool, compared with the current production route on the same events:
The Ξ, π, p and K spectra from the Ξc decays agree (worst p-value 0.10), and the Ξ*⁰ also survives into the AOD
McParticles. Box-gun runs with 2 × 10⁴ Ξc⁺ and anti-Ξc⁺ give no crash in 30 transports, the configured branching ratios, the 2:1 Ξ⁻π⁺ : Ξ⁰π⁰ split and the configured cτ.Note that the step is off by default, so nothing changes for existing productions. The 0.6% larger Kine files come from the existing rule that stores every child of a primary.
https://its.cern.ch/jira/browse/O2-5903
Assisted by Claude Code.