Fix independent LF resonance gun RNG seeding - #2456
Merged
Merged
Conversation
Seed the separate Pythia gun RNG from ROOT before reading decayer settings. Preserve ROOT SetSeed(0) and explicit decayer configuration priority. Log the effective gun seed once during construction and warn when seeding is disabled or nonpositive.
|
REQUEST FOR PRODUCTION RELEASES: This will add The following labels are available |
njacazio
approved these changes
Sep 9, 2026
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.
Summary
The LF resonance gun uses a separate Pythia random-number generator (RNG) for mass sampling and decays, which was not explicitly seeded. Initialize it with a
positive seed drawn from ROOT to avoid unintended reuse of the default random sequence.
gRandom->SetSeed(0)behavior and explicit decayer configuration overrides.Details
Previously, the gun's separate RandomNumberGenerator was left at its default initialization.
Independently launched jobs could therefore reuse the same random sequence, producing repeated resonance-mass sequences and artificial structures in the combined daughter invariant-mass spectrum, as illustrated in Figure 1 (from the recent production for 23 periods in this JIRA ticket).
Figure 2 compares injected Xi(1820) daughter invariant-mass distributions before (blue) and after (red) this change, using 20,000 injected resonances per version.
In this local generator-level comparison, the updated sample no longer exhibits repeated mass sequences across jobs and more smoothly samples the configured Pythia