Analysis Software
Documentation for sPHENIX simulation software
|
< Mersenne Twister More...
#include <acts/blob/sPHENIX/Examples/Framework/include/ActsExamples/Framework/RandomNumbers.hpp>
Classes | |
struct | Config |
Public Member Functions | |
RandomNumbers (const Config &cfg) | |
RandomEngine | spawnGenerator (const AlgorithmContext &context) const |
uint64_t | generateSeed (const AlgorithmContext &context) const |
Private Attributes | |
Config | m_cfg |
< Mersenne Twister
Provide event and algorithm specific random number generator.s
This provides local random number generators, allowing for thread-safe, lock-free, and reproducible random number generation across single-threaded and multi-threaded test framework runs.
The role of the RandomNumbers is only to spawn local random number generators. It does not, in and of itself, accommodate requests for specific random number distributions (uniform, gaussian, etc). For this purpose, clients should spawn their own local distribution objects as needed, following the C++11 STL design.
Definition at line 41 of file RandomNumbers.hpp.
View newest version in sPHENIX GitHub at line 41 of file RandomNumbers.hpp
ActsExamples::RandomNumbers::RandomNumbers | ( | const Config & | cfg | ) |
Definition at line 21 of file RandomNumbers.cpp.
View newest version in sPHENIX GitHub at line 21 of file RandomNumbers.cpp
uint64_t ActsExamples::RandomNumbers::generateSeed | ( | const AlgorithmContext & | context | ) | const |
Generate a event and algorithm specific seed value.
This should only be used in special cases e.g. where a custom random engine is used and spawnGenerator
can not be used.
Definition at line 28 of file RandomNumbers.cpp.
View newest version in sPHENIX GitHub at line 28 of file RandomNumbers.cpp
References ActsExamples::AlgorithmContext::eventNumber, and m_cfg().
ActsExamples::RandomEngine ActsExamples::RandomNumbers::spawnGenerator | ( | const AlgorithmContext & | context | ) | const |
Spawn an algorithm-local random number generator. To avoid inefficiencies and multiple uses of a given RNG seed, this should only be done once per Algorithm invocation, after what the generator object should be reused.
It calls generateSeed() for an event driven seed
context | is the AlgorithmContext of the host algorithm |
Definition at line 23 of file RandomNumbers.cpp.
View newest version in sPHENIX GitHub at line 23 of file RandomNumbers.cpp
|
private |
Definition at line 65 of file RandomNumbers.hpp.
View newest version in sPHENIX GitHub at line 65 of file RandomNumbers.hpp