Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ATRANLUXGENSVC_H
6 #define ATRANLUXGENSVC_H
18 #include "GaudiKernel/IIncidentListener.h"
20 #include "Gaudi/Property.h"
22 #include "CLHEP/Random/Ranlux64Engine.h"
54 class AtRanluxGenSvc :
public extends<AthService, IAtRndmGenSvc, IIncidentListener>
68 typedef std::map<std::string, CLHEP::Ranlux64Engine*>
engineMap;
80 virtual void print (
void )
override;
83 const std::string&
streamName,
short luxLevel);
110 virtual void handle(
const Incident&)
override;
118 "seeds for the engines, a string of the form ['SequenceName [LUXURY luxLevel (range 0:2 default 1)()] " \
119 "[OFFSET num] Seed1 Seed2', ...] where OFFSET is an optional integer that allows to change the " \
120 "sequence of randoms for a given run/event no and SequenceName combination. Notice that " \
121 "Seed1/Seed2 are dummy when EventReseeding is used",
122 "OrderedSet<std::string>"};
125 Gaudi::Property<bool>
m_read_from_file{
this,
"ReadFromFile",
false,
"set/restore the status of the engine from file"};
127 "name of a ASCII file, usually produced by AtRanLuxGenSvc itself at the end of a job, " \
128 "containing the information to fully set/restore the status of Ranlux64"
130 Gaudi::Property<bool>
m_save_to_file{
this,
"SaveToFile",
true,
"save the status of the engine to file"};
132 "name of an ASCII file which will be produced on finalize, containing the information to fully set/restore the status"};
134 Gaudi::Property<bool>
m_eventReseed{
this,
"EventReseeding",
true,
"reseed every event using a hash of run and event numbers"};
135 StringArrayProperty
m_reseedStreamNames{
this,
"ReseedStreamNames",{},
"the streams we are going to set the seeds of (default: all streams)"};
184 #endif // ATRANLUXGENSVC_H
JetConstituentVector::iterator iterator
virtual StatusCode finalize() override
uint32_t m_HERWIG_default_seed1
AtRanluxGenSvc(const std::string &name, ISvcLocator *svc)
Standard Gaudi Constructor.
virtual StatusCode initialize() override
virtual CLHEP::HepRandomEngine * setOnDefinedSeeds(uint32_t eventNumber, uint32_t runNumber, const std::string &streamName) override
void SetStreamSeeds(const std::string &streamName)
Gaudi::Property< std::string > m_file_to_write
name of the file to save the engine status to.
virtual ~AtRanluxGenSvc()
Standard Destructor.
void createStream(uint32_t seed1, uint32_t seed2, const std::string &streamName, short luxLevel)
allows to specify luxLevel
virtual void print(void) override
engineMap::const_iterator engineConstIter
engineConstIter end(void) const
virtual void CreateStream(uint32_t seed1, uint32_t seed2, const std::string &streamName) override
unsigned int number_of_streams(void) const
uint32_t m_PYTHIA_default_seed2
uint32_t m_HERWIG_default_seed2
::StatusCode StatusCode
StatusCode definition for legacy code.
std::map< std::string, uint32_t > m_reseedingOffsets
optional offsets to combine to run/evt no when reseeding.
AthROOTErrorHandlerSvc * svc
The default ATLAS random number engine manager, based on Ranlux64.
virtual CLHEP::HepRandomEngine * setOnDefinedSeeds(uint32_t theSeed, const std::string &streamName) override
CLHEP::HepRandomEngine * oldSetOnDefinedSeeds(uint32_t theSeed, const std::string &streamName)
broken, temporarily keep for backward compatibility
short m_defaultLuxLevel
Ranlux luxury level to be used by default.
uint32_t m_PYTHIA_default_seed1
StringArrayProperty m_reseedStreamNames
streams to be reseeded for every event
Gaudi::Property< bool > m_read_from_file
read engine status from file
virtual void handle(const Incident &) override
IIncidentListener implementation. Handles EndEvent incident.
Gaudi::Property< bool > m_save_to_file
should current engine status be saved to file ?
std::map< std::string, std::vector< uint32_t > > m_engines_copy
Random engine copy (for output to a file)
Gaudi::Property< bool > m_eventReseed
reseed for every event
virtual bool setAllOnDefinedSeeds(uint32_t theSeed) override
seed all streams we manage, combining theSeed and the stream names
std::map< std::string, CLHEP::Ranlux64Engine * > engineMap
engineMap::value_type engineValType
virtual bool setAllOnDefinedSeeds(uint32_t eventNumber, uint32_t runNumber) override
seed all streams, combining eventNumber, runNumber and the stream names
Gaudi::Property< bool > m_useOldBrokenSeeding
backward compatibility only, broken 32/64 bits
Gaudi::Property< std::string > m_file_to_read
name of the file to read the engine status from
StringArrayProperty m_streams_seeds
seeds for the engines, this is a vector of strings of the form "EnginName Seed1 Seed2"
engineMap::iterator engineIter
engineConstIter begin(void) const
virtual CLHEP::HepRandomEngine * GetEngine(const std::string &streamName) override
virtual void print(const std::string &streamName) override