![]() |
ATLAS Offline Software
|
The default ATLAS random number engine manager, based on Ranlux64. More...
#include <AtRanluxGenSvc.h>
Public Types | |
CLHEP engines typedefs: | |
typedef std::map< std::string, CLHEP::Ranlux64Engine * > | engineMap |
typedef engineMap::iterator | engineIter |
typedef engineMap::const_iterator | engineConstIter |
typedef engineMap::value_type | engineValType |
Public Member Functions | |
Interface to the CLHEP engine | |
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) |
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 |
void | createStream (uint32_t seed1, uint32_t seed2, const std::string &streamName, short luxLevel) |
allows to specify luxLevel More... | |
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 |
CLHEP::HepRandomEngine * | oldSetOnDefinedSeeds (uint32_t theSeed, const std::string &streamName) |
broken, temporarily keep for backward compatibility More... | |
CLHEP::HepRandomEngine * | oldSetOnDefinedSeeds (uint32_t eventNumber, uint32_t runNumber, const std::string &streamName) |
broken, temporarily keep for backward compatibility More... | |
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... | |
Gaudi::Property< bool > | m_useOldBrokenSeeding {this,"UseOldBrokenSeeding",false} |
backward compatibility only, broken 32/64 bits 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... | |
short | m_defaultLuxLevel |
Ranlux luxury level to be used by default. More... | |
Default seed values | |
uint32_t | m_default_seed1 |
uint32_t | m_default_seed2 |
uint32_t | m_PYTHIA_default_seed1 |
uint32_t | m_PYTHIA_default_seed2 |
uint32_t | m_HERWIG_default_seed1 |
uint32_t | m_HERWIG_default_seed2 |
AtRanluxGenSvc (const std::string &name, ISvcLocator *svc) | |
Standard Gaudi Constructor. More... | |
virtual | ~AtRanluxGenSvc () |
Standard Destructor. More... | |
void | SetStreamSeeds (const std::string &streamName) |
The default ATLAS random number engine manager, based on Ranlux64.
this service mantains a number of named, independent random number sequences. Each sequence is initialized by an entry of the form "SequenceName [LUXURY luxLevel (range 0:2 default 1) ] Seed1 Seed2" in the Seeds property. For example
At the end of the job in AtRanluxGenSvc::finalize(), the status of the engine is dumped as an array of uint32_t to the ASCII file "AtRanluxGenSvc.out":
This file can be used to restore the status of the engine in another job by setting the properties
Definition at line 54 of file AtRanluxGenSvc.h.
typedef engineMap::const_iterator AtRanluxGenSvc::engineConstIter |
Definition at line 70 of file AtRanluxGenSvc.h.
typedef engineMap::iterator AtRanluxGenSvc::engineIter |
Definition at line 69 of file AtRanluxGenSvc.h.
typedef std::map<std::string, CLHEP::Ranlux64Engine*> AtRanluxGenSvc::engineMap |
Definition at line 68 of file AtRanluxGenSvc.h.
typedef engineMap::value_type AtRanluxGenSvc::engineValType |
Definition at line 71 of file AtRanluxGenSvc.h.
AtRanluxGenSvc::AtRanluxGenSvc | ( | const std::string & | name, |
ISvcLocator * | svc | ||
) |
|
virtual |
|
inline |
Definition at line 173 of file AtRanluxGenSvc.h.
bool AtRanluxGenSvc::CreateStream | ( | const std::vector< uint32_t > & | seeds, |
const std::string & | streamName | ||
) |
Definition at line 322 of file AtRanluxGenSvc.cxx.
|
overridevirtual |
void AtRanluxGenSvc::createStream | ( | uint32_t | seed1, |
uint32_t | seed2, | ||
const std::string & | streamName, | ||
short | luxLevel | ||
) |
|
inline |
Definition at line 177 of file AtRanluxGenSvc.h.
|
overridevirtual |
Definition at line 261 of file AtRanluxGenSvc.cxx.
|
overridevirtual |
Definition at line 288 of file AtRanluxGenSvc.cxx.
|
overridevirtual |
IIncidentListener implementation. Handles EndEvent incident.
Definition at line 170 of file AtRanluxGenSvc.cxx.
|
overridevirtual |
|
inline |
Definition at line 181 of file AtRanluxGenSvc.h.
CLHEP::HepRandomEngine * AtRanluxGenSvc::oldSetOnDefinedSeeds | ( | uint32_t | eventNumber, |
uint32_t | runNumber, | ||
const std::string & | streamName | ||
) |
broken, temporarily keep for backward compatibility
Definition at line 440 of file AtRanluxGenSvc.cxx.
CLHEP::HepRandomEngine * AtRanluxGenSvc::oldSetOnDefinedSeeds | ( | uint32_t | theSeed, |
const std::string & | streamName | ||
) |
broken, temporarily keep for backward compatibility
Definition at line 458 of file AtRanluxGenSvc.cxx.
|
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 336 of file AtRanluxGenSvc.cxx.
|
private |
Definition at line 153 of file AtRanluxGenSvc.h.
|
private |
Definition at line 154 of file AtRanluxGenSvc.h.
|
private |
Ranlux luxury level to be used by default.
Definition at line 148 of file AtRanluxGenSvc.h.
|
private |
Definition at line 145 of file AtRanluxGenSvc.h.
|
private |
Random engine copy (for output to a file)
Definition at line 147 of file AtRanluxGenSvc.h.
|
private |
reseed for every event
Definition at line 134 of file AtRanluxGenSvc.h.
|
private |
name of the file to read the engine status from
Definition at line 126 of file AtRanluxGenSvc.h.
|
private |
name of the file to save the engine status to.
Definition at line 131 of file AtRanluxGenSvc.h.
|
private |
Definition at line 157 of file AtRanluxGenSvc.h.
|
private |
Definition at line 158 of file AtRanluxGenSvc.h.
|
private |
Definition at line 155 of file AtRanluxGenSvc.h.
|
private |
Definition at line 156 of file AtRanluxGenSvc.h.
|
private |
read engine status from file
Definition at line 125 of file AtRanluxGenSvc.h.
|
private |
optional offsets to combine to run/evt no when reseeding.
Set using OFFSET keyword of the Seeds property
Definition at line 143 of file AtRanluxGenSvc.h.
|
private |
streams to be reseeded for every event
Definition at line 135 of file AtRanluxGenSvc.h.
|
private |
should current engine status be saved to file ?
Definition at line 130 of file AtRanluxGenSvc.h.
|
private |
seeds for the engines, this is a vector of strings of the form "EnginName Seed1 Seed2"
Definition at line 117 of file AtRanluxGenSvc.h.
|
private |
backward compatibility only, broken 32/64 bits
Definition at line 138 of file AtRanluxGenSvc.h.