![]() |
ATLAS Offline Software
|
A random number engine manager, based on dSFMT. More...
#include <AtDSFMTGenSvc.h>
Public Member Functions | |
Stream access | |
engineConstIter | begin (void) const |
engineConstIter | end (void) const |
unsigned int | number_of_streams (void) const |
virtual void | print (const std::string &streamName) override |
virtual void | print (void) override |
virtual CLHEP::HepRandomEngine * | setOnDefinedSeeds (uint32_t theSeed, const std::string &streamName) override |
virtual CLHEP::HepRandomEngine * | setOnDefinedSeeds (uint32_t eventNumber, uint32_t runNumber, const std::string &streamName) override |
virtual bool | setAllOnDefinedSeeds (uint32_t theSeed) override |
seed all streams we manage, combining theSeed and the stream names More... | |
virtual bool | setAllOnDefinedSeeds (uint32_t eventNumber, uint32_t runNumber) override |
seed all streams, combining eventNumber, runNumber and the stream names More... | |
Gaudi Service Implementation | |
virtual StatusCode | initialize () override |
virtual StatusCode | finalize () override |
virtual void | handle (const Incident &) override |
IIncidentListener implementation. Handles EndEvent incident. More... | |
Private Attributes | |
Properties | |
StringArrayProperty | m_streams_seeds |
seeds for the engines, this is a vector of strings of the form "EnginName Seed1 Seed2" More... | |
Gaudi::Property< bool > | m_read_from_file {this,"ReadFromFile",false,"set/restore the status of the engine from file"} |
read engine status from file More... | |
Gaudi::Property< std::string > | m_file_to_read |
name of the file to read the engine status from More... | |
Gaudi::Property< bool > | m_save_to_file {this,"SaveToFile", true,"save the status of the engine to file"} |
should current engine status be saved to file ? More... | |
Gaudi::Property< std::string > | m_file_to_write |
name of the file to save the engine status to. More... | |
Gaudi::Property< bool > | m_eventReseed {this,"EventReseeding",true,"reseed every event using a hash of run and event numbers"} |
reseed for every event More... | |
StringArrayProperty | m_reseedStreamNames {this,"ReseedStreamNames",{}, "the streams we are going to set the seeds of (default: all streams)"} |
streams to be reseeded for every event More... | |
std::map< std::string, uint32_t > | m_reseedingOffsets |
optional offsets to combine to run/evt no when reseeding. More... | |
engineMap | m_engines |
std::map< std::string, std::vector< uint32_t > > | m_engines_copy |
Random engine copy (for output to a file) More... | |
Interface to the CLHEP engine | |
typedef std::map< std::string, CLHEP::HepRandomEngine * > | engineMap |
CLHEP engines typedefs: More... | |
typedef engineMap::iterator | engineIter |
typedef engineMap::const_iterator | engineConstIter |
typedef engineMap::value_type | engineValType |
virtual CLHEP::HepRandomEngine * | GetEngine (const std::string &streamName) override |
virtual void | CreateStream (uint32_t seed1, uint32_t seed2, const std::string &streamName) override |
bool | CreateStream (const std::vector< uint32_t > &seeds, const std::string &streamName) |
Default seed values | |
long | m_default_seed1 |
long | m_default_seed2 |
long | m_PYTHIA_default_seed1 |
long | m_PYTHIA_default_seed2 |
long | m_HERWIG_default_seed1 |
long | m_HERWIG_default_seed2 |
AtDSFMTGenSvc (const std::string &name, ISvcLocator *svc) | |
Standard Constructor. More... | |
virtual | ~AtDSFMTGenSvc () |
Standard Destructor. More... | |
void | SetStreamSeeds (const std::string &StreamName) |
A random number engine manager, based on dSFMT.
this service mantains a number of named, independent random number sequences. Each sequence is initialized by an entry of the form "SequenceName Seed1 Seed2" in the Seeds property. For example
At the end of the job in AtDSFMTGenSvc::finalize(), the status of the engine is dumped as an array of unsigned long to the ASCII file "AtDSFMTGenSvc.out". This file can be used to restore the status of the engine in another job by setting the properties
Definition at line 51 of file AtDSFMTGenSvc.h.
typedef engineMap::const_iterator AtDSFMTGenSvc::engineConstIter |
Definition at line 64 of file AtDSFMTGenSvc.h.
typedef engineMap::iterator AtDSFMTGenSvc::engineIter |
Definition at line 63 of file AtDSFMTGenSvc.h.
typedef std::map<std::string, CLHEP::HepRandomEngine*> AtDSFMTGenSvc::engineMap |
CLHEP engines typedefs:
Definition at line 62 of file AtDSFMTGenSvc.h.
typedef engineMap::value_type AtDSFMTGenSvc::engineValType |
Definition at line 65 of file AtDSFMTGenSvc.h.
AtDSFMTGenSvc::AtDSFMTGenSvc | ( | const std::string & | name, |
ISvcLocator * | svc | ||
) |
|
virtual |
|
inline |
Definition at line 149 of file AtDSFMTGenSvc.h.
bool AtDSFMTGenSvc::CreateStream | ( | const std::vector< uint32_t > & | seeds, |
const std::string & | streamName | ||
) |
Definition at line 293 of file AtDSFMTGenSvc.cxx.
|
overridevirtual |
|
inline |
Definition at line 153 of file AtDSFMTGenSvc.h.
|
overridevirtual |
Definition at line 244 of file AtDSFMTGenSvc.cxx.
|
overridevirtual |
Definition at line 269 of file AtDSFMTGenSvc.cxx.
|
overridevirtual |
IIncidentListener implementation. Handles EndEvent incident.
Definition at line 155 of file AtDSFMTGenSvc.cxx.
|
overridevirtual |
|
inline |
Definition at line 157 of file AtDSFMTGenSvc.h.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
seed all streams, combining eventNumber, runNumber and the stream names
|
overridevirtual |
seed all streams we manage, combining theSeed and the stream names
|
overridevirtual |
|
overridevirtual |
|
private |
Definition at line 303 of file AtDSFMTGenSvc.cxx.
|
private |
Definition at line 128 of file AtDSFMTGenSvc.h.
|
private |
Definition at line 129 of file AtDSFMTGenSvc.h.
|
private |
Definition at line 121 of file AtDSFMTGenSvc.h.
|
private |
Random engine copy (for output to a file)
Definition at line 123 of file AtDSFMTGenSvc.h.
|
private |
reseed for every event
Definition at line 112 of file AtDSFMTGenSvc.h.
|
private |
name of the file to read the engine status from
Definition at line 105 of file AtDSFMTGenSvc.h.
|
private |
name of the file to save the engine status to.
Definition at line 109 of file AtDSFMTGenSvc.h.
|
private |
Definition at line 132 of file AtDSFMTGenSvc.h.
|
private |
Definition at line 133 of file AtDSFMTGenSvc.h.
|
private |
Definition at line 130 of file AtDSFMTGenSvc.h.
|
private |
Definition at line 131 of file AtDSFMTGenSvc.h.
|
private |
read engine status from file
Definition at line 104 of file AtDSFMTGenSvc.h.
|
private |
optional offsets to combine to run/evt no when reseeding.
Set using OFFSET keyword of the Seeds property
Definition at line 119 of file AtDSFMTGenSvc.h.
|
private |
streams to be reseeded for every event
Definition at line 113 of file AtDSFMTGenSvc.h.
|
private |
should current engine status be saved to file ?
Definition at line 108 of file AtDSFMTGenSvc.h.
|
private |
seeds for the engines, this is a vector of strings of the form "EnginName Seed1 Seed2"
Definition at line 95 of file AtDSFMTGenSvc.h.