![]() |
ATLAS Offline Software
|
A random number engine manager, based on Ranecu. Its usage is deprecated, at least when high quality sequences of randoms are required (Ranecu period has been shown to be too short, and sensitive to the quality of initial seeds). More...
#include <AtRndmGenSvc.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 |
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 | |
Gaudi::Property< bool > | m_useOldBrokenSeeding {this,"UseOldBrokenSeeding",false} |
backward compatibility only, broken 32/64 bits More... | |
StringArrayProperty | m_streams_seeds |
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< long int > > | m_engines_copy |
Random engine copy (for output to a file) More... | |
Interface to the CLHEP engine | |
typedef std::map< std::string, CLHEP::RanecuEngine * > | 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 |
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 |
AtRndmGenSvc (const std::string &name, ISvcLocator *svc) | |
Standard Constructor. More... | |
virtual | ~AtRndmGenSvc () |
Standard Destructor. More... | |
void | SetStreamSeeds (const std::string &streamName) |
A random number engine manager, based on Ranecu. Its usage is deprecated, at least when high quality sequences of randoms are required (Ranecu period has been shown to be too short, and sensitive to the quality of initial seeds).
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 AtRndmGenSvc::finalize(), the status of the engine is dumped as an array of unsigned long to the ASCII file "AtRndmGenSvc.out". This file can be used to restore the status of the engine in another job by setting the properties
Definition at line 56 of file AtRndmGenSvc.h.
typedef engineMap::const_iterator AtRndmGenSvc::engineConstIter |
Definition at line 69 of file AtRndmGenSvc.h.
typedef engineMap::iterator AtRndmGenSvc::engineIter |
Definition at line 68 of file AtRndmGenSvc.h.
typedef std::map<std::string, CLHEP::RanecuEngine*> AtRndmGenSvc::engineMap |
CLHEP engines typedefs:
Definition at line 67 of file AtRndmGenSvc.h.
typedef engineMap::value_type AtRndmGenSvc::engineValType |
Definition at line 70 of file AtRndmGenSvc.h.
AtRndmGenSvc::AtRndmGenSvc | ( | const std::string & | name, |
ISvcLocator * | svc | ||
) |
|
virtual |
|
inline |
Definition at line 165 of file AtRndmGenSvc.h.
|
overridevirtual |
Definition at line 268 of file AtRndmGenSvc.cxx.
|
inline |
Definition at line 169 of file AtRndmGenSvc.h.
|
overridevirtual |
Definition at line 232 of file AtRndmGenSvc.cxx.
|
overridevirtual |
Definition at line 254 of file AtRndmGenSvc.cxx.
|
overridevirtual |
IIncidentListener implementation. Handles EndEvent incident.
Definition at line 150 of file AtRndmGenSvc.cxx.
|
overridevirtual |
|
inline |
Definition at line 173 of file AtRndmGenSvc.h.
CLHEP::HepRandomEngine * AtRndmGenSvc::oldSetOnDefinedSeeds | ( | uint32_t | eventNumber, |
uint32_t | runNumber, | ||
const std::string & | streamName | ||
) |
broken, temporarily keep for backward compatibility
Definition at line 374 of file AtRndmGenSvc.cxx.
CLHEP::HepRandomEngine * AtRndmGenSvc::oldSetOnDefinedSeeds | ( | uint32_t | theSeed, |
const std::string & | streamName | ||
) |
broken, temporarily keep for backward compatibility
Definition at line 392 of file AtRndmGenSvc.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 280 of file AtRndmGenSvc.cxx.
|
private |
Definition at line 144 of file AtRndmGenSvc.h.
|
private |
Definition at line 145 of file AtRndmGenSvc.h.
|
private |
Definition at line 137 of file AtRndmGenSvc.h.
|
private |
Random engine copy (for output to a file)
Definition at line 139 of file AtRndmGenSvc.h.
|
private |
reseed for every event
Definition at line 128 of file AtRndmGenSvc.h.
|
private |
name of the file to read the engine status from
Definition at line 120 of file AtRndmGenSvc.h.
|
private |
name of the file to save the engine status to.
Definition at line 125 of file AtRndmGenSvc.h.
|
private |
Definition at line 148 of file AtRndmGenSvc.h.
|
private |
Definition at line 149 of file AtRndmGenSvc.h.
|
private |
Definition at line 146 of file AtRndmGenSvc.h.
|
private |
Definition at line 147 of file AtRndmGenSvc.h.
|
private |
read engine status from file
Definition at line 119 of file AtRndmGenSvc.h.
|
private |
optional offsets to combine to run/evt no when reseeding.
Set using OFFSET keyword of the Seeds property
Definition at line 135 of file AtRndmGenSvc.h.
|
private |
streams to be reseeded for every event
Definition at line 129 of file AtRndmGenSvc.h.
|
private |
should current engine status be saved to file ?
Definition at line 124 of file AtRndmGenSvc.h.
|
private |
Definition at line 112 of file AtRndmGenSvc.h.
|
private |
backward compatibility only, broken 32/64 bits
Definition at line 111 of file AtRndmGenSvc.h.