Skip to content

Fix independent LF resonance gun RNG seeding - #2456

Merged
njacazio merged 1 commit into
AliceO2Group:masterfrom
mjkim525:fix/lf-resonance-gun-seed
Sep 9, 2026
Merged

Fix independent LF resonance gun RNG seeding#2456
njacazio merged 1 commit into
AliceO2Group:masterfrom
mjkim525:fix/lf-resonance-gun-seed

Conversation

@mjkim525

@mjkim525 mjkim525 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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.

  • Preserve the existing gRandom->SetSeed(0) behavior and explicit decayer configuration overrides.
  • Log the effective gun seed once during construction and warn if seeding is disabled or the seed is nonpositive.

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

Attachment1 Attachment2

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.
@mjkim525
mjkim525 requested a review from a team as a code owner September 9, 2026 11:35
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-PbPb-apass1
async-2024-ppRef-apass1
async-2024-PbPb-apass2
async-2023-PbPb-apass5

@njacazio
njacazio enabled auto-merge (squash) September 9, 2026 11:39
@njacazio
njacazio merged commit 5afa943 into AliceO2Group:master Sep 9, 2026
10 checks passed
@mjkim525
mjkim525 deleted the fix/lf-resonance-gun-seed branch September 9, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants