|
MarlinMT
0.1.0
|
RandomSeedManager class. More...
#include <RandomSeedManager.h>
Public Types | |
| typedef unsigned int | SeedType |
| typedef std::hash< const void * > | HashFunction |
| typedef const void * | HashArgument |
| typedef std::size_t | HashResult |
| typedef std::unordered_set< HashResult > | EntryList |
| typedef std::map< HashResult, SeedType > | RandomSeedMap |
| typedef std::mt19937 | RandomGenerator |
| typedef std::uniform_int_distribution< SeedType > | RandomDistribution |
Public Member Functions | |
| RandomSeedManager (const RandomSeedManager &)=delete | |
| RandomSeedManager & | operator= (const RandomSeedManager &)=delete |
| ~RandomSeedManager ()=default | |
| RandomSeedManager (SeedType globalSeed=static_cast< unsigned int >(time(nullptr))) | |
| Constructor with global seed. More... | |
| void | addEntry (HashResult entry) |
| Add an entry to the random seed manager. More... | |
| void | addEntry (HashArgument arg) |
| Add an entry to the random seed manager. More... | |
| std::unique_ptr< RandomSeedMap > | generateRandomSeeds (const EventStore *const evt) |
| Generate a random seed map. More... | |
Static Public Attributes | |
| static const SeedType | MinSeed = 0 |
| static const SeedType | MaxSeed = std::numeric_limits<SeedType>::max() |
Private Member Functions | |
| SeedType | getRandom () |
| Get a new random number from the internal generator. More... | |
Private Attributes | |
| SeedType | _globalSeed {0} |
| The global random seed, if set. More... | |
| EntryList | _entryList {} |
| The entry list. More... | |
| RandomGenerator | _generator {_globalSeed} |
| The random generator engine. More... | |
| RandomDistribution | _rdmDistribution {MinSeed, MaxSeed} |
| The random number distribution. More... | |
RandomSeedManager class.
Definition at line 18 of file RandomSeedManager.h.
| typedef std::unordered_set<HashResult> marlinmt::RandomSeedManager::EntryList |
Definition at line 30 of file RandomSeedManager.h.
| typedef const void* marlinmt::RandomSeedManager::HashArgument |
Definition at line 28 of file RandomSeedManager.h.
| typedef std::hash<const void*> marlinmt::RandomSeedManager::HashFunction |
Definition at line 27 of file RandomSeedManager.h.
| typedef std::size_t marlinmt::RandomSeedManager::HashResult |
Definition at line 29 of file RandomSeedManager.h.
| typedef std::uniform_int_distribution<SeedType> marlinmt::RandomSeedManager::RandomDistribution |
Definition at line 33 of file RandomSeedManager.h.
| typedef std::mt19937 marlinmt::RandomSeedManager::RandomGenerator |
Definition at line 32 of file RandomSeedManager.h.
| typedef std::map<HashResult, SeedType> marlinmt::RandomSeedManager::RandomSeedMap |
Definition at line 31 of file RandomSeedManager.h.
| typedef unsigned int marlinmt::RandomSeedManager::SeedType |
Definition at line 26 of file RandomSeedManager.h.
|
delete |
|
default |
| marlinmt::RandomSeedManager::RandomSeedManager | ( | SeedType | globalSeed = static_cast<unsigned int>(time(nullptr)) | ) |
Constructor with global seed.
| globalSeed | the global seed |
Definition at line 11 of file RandomSeedManager.cc.
| void marlinmt::RandomSeedManager::addEntry | ( | HashResult | entry | ) |
Add an entry to the random seed manager.
| entry | a hash ideintifying the entry |
Definition at line 19 of file RandomSeedManager.cc.
References _entryList.
Referenced by addEntry(), and marlinmt::ProcessorApi::registerForRandomSeeds().
| void marlinmt::RandomSeedManager::addEntry | ( | HashArgument | arg | ) |
Add an entry to the random seed manager.
| entry | a hash ideintifying the entry |
Definition at line 28 of file RandomSeedManager.cc.
References addEntry().
| std::unique_ptr< RandomSeedManager::RandomSeedMap > marlinmt::RandomSeedManager::generateRandomSeeds | ( | const EventStore *const | evt | ) |
Generate a random seed map.
Mainly used by the whiteboard to get random seeds which are local for a given event context
| evt | the event source |
Definition at line 36 of file RandomSeedManager.cc.
References _entryList, _generator, _globalSeed, getRandom(), jenkins_hash(), and marlinmt::EventStore::uid().
|
private |
Get a new random number from the internal generator.
Definition at line 60 of file RandomSeedManager.cc.
References _generator, and _rdmDistribution.
Referenced by generateRandomSeeds().
|
delete |
|
private |
The entry list.
Definition at line 79 of file RandomSeedManager.h.
Referenced by addEntry(), and generateRandomSeeds().
|
private |
The random generator engine.
Definition at line 81 of file RandomSeedManager.h.
Referenced by generateRandomSeeds(), and getRandom().
|
private |
The global random seed, if set.
Definition at line 77 of file RandomSeedManager.h.
Referenced by generateRandomSeeds().
|
private |
The random number distribution.
Definition at line 83 of file RandomSeedManager.h.
Referenced by getRandom().
Definition at line 36 of file RandomSeedManager.h.
|
static |
Definition at line 35 of file RandomSeedManager.h.