7#ifndef FIRE_RANDOMNUMBERSEEDSERVICE_H_
8#define FIRE_RANDOMNUMBERSEEDSERVICE_H_
10#include "fire/ConditionsObject.h"
11#include "fire/ConditionsProvider.h"
Base class for all conditions objects, very simple.
Definition: ConditionsObject.h:11
Base class for all providers of conditions objects.
Definition: ConditionsProvider.h:83
System for consistent seeding of random number generators.
Definition: RandomNumberSeedService.h:33
uint64_t getSeed(const std::string &name) const
Access a given seed by name.
Definition: RandomNumberSeedService.cxx:59
uint64_t root_
what the root seed actually is
Definition: RandomNumberSeedService.h:140
bool initialized_
whether the root seed has been initialized
Definition: RandomNumberSeedService.h:134
friend std::ostream & operator<<(std::ostream &s, const RandomNumberSeedService &o)
Output streaming operator.
Definition: RandomNumberSeedService.h:126
std::map< std::string, uint64_t > seeds_
cache of seeds by name
Definition: RandomNumberSeedService.h:143
virtual void release(const ConditionsObject *co) final override
This object is both the provider of the seed service and the conditions object itself,...
Definition: RandomNumberSeedService.h:109
RandomNumberSeedService(const fire::config::Parameters ¶meters)
Create the random number seed service conditions object.
Definition: RandomNumberSeedService.cxx:27
virtual void onNewRun(RunHeader &header) final override
Configure the seed service when a new run starts.
Definition: RandomNumberSeedService.cxx:51
virtual std::pair< const ConditionsObject *, ConditionsIntervalOfValidity > getCondition(const EventHeader &context) final override
Get the seed service as a conditions object.
Definition: RandomNumberSeedService.cxx:83
int mode_
what mode of root seed are we using
Definition: RandomNumberSeedService.h:137
void stream(std::ostream &s) const
Stream the configuration of this object to the input ostream.
Definition: RandomNumberSeedService.cxx:16
uint64_t getRootSeed() const
Access the root seed.
Definition: RandomNumberSeedService.h:88
std::vector< std::string > getSeedNames() const
Get a list of all the known seeds.
Definition: RandomNumberSeedService.cxx:74
static const std::string CONDITIONS_OBJECT_NAME
Conditions object name.
Definition: RandomNumberSeedService.h:36
Class encapsulating parameters for configuring a processor.
Definition: Parameters.h:28