![]() |
SHiP Random
Random number helpers shared by the SHiP software
|
Counter-based random number generator for reproducible, thread-safe event processing. More...
#include <Random123/philox.h>#include <cmath>#include <cstdint>#include <numbers>#include <stdexcept>Go to the source code of this file.
Classes | |
| class | SHiP::random::PhiloxRng |
Namespaces | |
| namespace | SHiP |
| namespace | SHiP::random |
Enumerations | |
| enum class | SHiP::random::Precision : std::uint8_t { SHiP::random::Bits32 , SHiP::random::Bits53 } |
Counter-based random number generator for reproducible, thread-safe event processing.
Random123 Philox 4x32 is deterministic per seed with no shared state, so each event seeds a fresh instance and the result is reproducible and thread-safe by construction.
The counter advances sequentially (ctr[0]++ per 4-word block) and the Philox output block is buffered; uniform() returns successive words of the buffered output, which preserves Philox's guaranteed period.
The draws are part of the physics output of every package that uses this class: changing how a value is computed changes simulated, digitised and reconstructed events. tests/philox_rng_test.cpp pins the sequences.