Expand description
Deterministic RNG streams for the simulation’s noise, keyed by identity rather than by scheduling order.
The m/z jitter and the reference-noise overlay used rand::thread_rng, so which thread picked
up a spectrum decided its noise. That makes a run irreproducible, and it is not a cosmetic
problem: a jittered m/z can cross a TOF bin boundary, which changes the (scan, tof) dedup and
so the peaks written to the file.
Deriving the stream from a master seed plus the stable identifiers already in scope — frame id, peptide id, ion index, scan — makes the draw independent of thread count and scheduling.
Functions§
- noise_
rng - A reproducible RNG for one unit of noise, keyed by
seedandkeys. - stream_
key - Mix a master seed and a list of identifiers into one 64-bit stream key.