|
ATLAS Offline Software
|
Go to the documentation of this file.
21 #include "GaudiKernel/IIncidentListener.h"
24 #include "CLHEP/Random/RandomEngine.h"
25 #include "CLHEP/Random/RanecuEngine.h"
56 class AtRndmGenSvc :
public extends<AthService, IAtRndmGenSvc, IIncidentListener>
67 typedef std::map<std::string, CLHEP::RanecuEngine*>
engineMap;
78 virtual void print (
void )
override;
104 virtual void handle(
const Incident&)
override;
113 "seeds for the engines, this is a vector of strings of the form ['SequenceName [OFFSET num] Seed1 Seed2', ...] "\
114 "where OFFSET is an optional integer that allows to change the sequence of randoms for a given run/event no " \
115 "and SequenceName combination. Notice that Seed1/Seed2 are dummy when EventReseeding is used",
116 "OrderedSet<std::string>"};
119 Gaudi::Property<bool>
m_read_from_file{
this,
"ReadFromFile",
false,
"set/restore the status of the engine from file"};
121 "name of a ASCII file, usually produced by AtRndmGenSvc itself at the end of a job, "\
122 "containing the information to fully set/restore the status of Ranecu",
124 Gaudi::Property<bool>
m_save_to_file{
this,
"SaveToFile",
true,
"save the status of the engine to file"};
126 "name of an ASCII file which will be produced on finalize, containing the information to fully set/restore the status"};
128 Gaudi::Property<bool>
m_eventReseed{
this,
"EventReseeding",
true,
"reseed every event using a hash of run and event numbers"};
129 StringArrayProperty
m_reseedStreamNames{
this,
"ReseedStreamNames",{},
"the streams we are going to set the seeds of (default: all streams)"};
176 #endif // ATRNDMGENSVC_H
JetConstituentVector::iterator iterator
virtual StatusCode finalize() override
virtual CLHEP::HepRandomEngine * GetEngine(const std::string &streamName) override
AtRndmGenSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
StringArrayProperty m_reseedStreamNames
streams to be reseeded for every event
Gaudi::Property< bool > m_read_from_file
read engine status from file
unsigned int number_of_streams(void) const
std::map< std::string, std::vector< long int > > m_engines_copy
Random engine copy (for output to a file)
long m_HERWIG_default_seed1
virtual CLHEP::HepRandomEngine * setOnDefinedSeeds(uint32_t theSeed, const std::string &streamName) override
engineConstIter begin(void) const
void SetStreamSeeds(const std::string &streamName)
Gaudi::Property< std::string > m_file_to_read
name of the file to read the engine status from
virtual ~AtRndmGenSvc()
Standard Destructor.
long m_PYTHIA_default_seed1
std::map< std::string, uint32_t > m_reseedingOffsets
optional offsets to combine to run/evt no when reseeding.
long m_HERWIG_default_seed2
virtual bool setAllOnDefinedSeeds(uint32_t theSeed) override
seed all streams we manage, combining theSeed and the stream names
StringArrayProperty m_streams_seeds
std::map< std::string, CLHEP::RanecuEngine * > engineMap
CLHEP engines typedefs:
virtual bool setAllOnDefinedSeeds(uint32_t eventNumber, uint32_t runNumber) override
seed all streams, combining eventNumber, runNumber and the stream names
::StatusCode StatusCode
StatusCode definition for legacy code.
engineMap::iterator engineIter
Gaudi::Property< bool > m_save_to_file
should current engine status be saved to file ?
virtual CLHEP::HepRandomEngine * setOnDefinedSeeds(uint32_t eventNumber, uint32_t runNumber, const std::string &streamName) override
Gaudi::Property< bool > m_useOldBrokenSeeding
backward compatibility only, broken 32/64 bits
AthROOTErrorHandlerSvc * svc
A random number engine manager, based on Ranecu. Its usage is deprecated, at least when high quality ...
virtual void print(const std::string &streamName) override
CLHEP::HepRandomEngine * oldSetOnDefinedSeeds(uint32_t theSeed, const std::string &streamName)
broken, temporarily keep for backward compatibility
Gaudi::Property< bool > m_eventReseed
reseed for every event
virtual void CreateStream(uint32_t seed1, uint32_t seed2, const std::string &streamName) override
virtual void print(void) override
Gaudi::Property< std::string > m_file_to_write
name of the file to save the engine status to.
virtual void handle(const Incident &) override
IIncidentListener implementation. Handles EndEvent incident.
engineMap::const_iterator engineConstIter
long m_PYTHIA_default_seed2
engineMap::value_type engineValType
virtual StatusCode initialize() override
engineConstIter end(void) const