ATLAS Offline Software
List of all members
AtDSFMTGenSvc Class Reference

A random number engine manager, based on dSFMT. More...

#include <AtDSFMTGenSvc.h>

Inheritance diagram for AtDSFMTGenSvc:
Collaboration diagram for AtDSFMTGenSvc:

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)
 

Detailed Description

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

Seeds = [ "PYTHIA 4789899 989240512", "PYTHIA_INIT 820021 2347532",
"JIMMY 390020611 821000366", "JIMMY_INIT 820021 2347532",
"HERWIG 390020611 821000366", "HERWIG_INIT 820021 2347532" ]

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

ReadFromFile = true
FileToRead = path_to_ascii_file

Definition at line 51 of file AtDSFMTGenSvc.h.

Member Typedef Documentation

◆ engineConstIter

typedef engineMap::const_iterator AtDSFMTGenSvc::engineConstIter

Definition at line 64 of file AtDSFMTGenSvc.h.

◆ engineIter

typedef engineMap::iterator AtDSFMTGenSvc::engineIter

Definition at line 63 of file AtDSFMTGenSvc.h.

◆ engineMap

typedef std::map<std::string, CLHEP::HepRandomEngine*> AtDSFMTGenSvc::engineMap

CLHEP engines typedefs:

Definition at line 62 of file AtDSFMTGenSvc.h.

◆ engineValType

typedef engineMap::value_type AtDSFMTGenSvc::engineValType

Definition at line 65 of file AtDSFMTGenSvc.h.

Constructor & Destructor Documentation

◆ AtDSFMTGenSvc()

AtDSFMTGenSvc::AtDSFMTGenSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Standard Constructor.

Definition at line 27 of file AtDSFMTGenSvc.cxx.

28  : base_class(name,svc),
31  // Set Default values
32  m_default_seed1 = 3591;
33  m_default_seed2 = 2309736;
34  m_PYTHIA_default_seed1 = 93453591;
35  m_PYTHIA_default_seed2 = 73436;
36  m_HERWIG_default_seed1 = 355391;
37  m_HERWIG_default_seed2 = 97336;
38 }

◆ ~AtDSFMTGenSvc()

AtDSFMTGenSvc::~AtDSFMTGenSvc ( )
virtual

Standard Destructor.

Definition at line 42 of file AtDSFMTGenSvc.cxx.

43 {
44  engineIter i(m_engines.begin()), e(m_engines.end());
45  while (i != e) delete (i++)->second;
46 }

Member Function Documentation

◆ begin()

AtDSFMTGenSvc::engineConstIter AtDSFMTGenSvc::begin ( void  ) const
inline

Definition at line 149 of file AtDSFMTGenSvc.h.

150 { return m_engines.begin(); }

◆ CreateStream() [1/2]

bool AtDSFMTGenSvc::CreateStream ( const std::vector< uint32_t > &  seeds,
const std::string &  streamName 
)

Definition at line 293 of file AtDSFMTGenSvc.cxx.

294 {
295  engineConstIter citer = m_engines.find(streamName);
296  if ( citer == m_engines.end() ) m_engines.insert(engineValType(streamName, new CLHEP::dSFMTEngine() ) );
297  engineIter iter = m_engines.find(streamName);
298  std::vector<unsigned long> longSeeds(seeds.size());
299  for (size_t i=0; i<seeds.size(); ++i) longSeeds[i]=seeds[i];
300  return (((*iter).second)->getState( longSeeds ));
301 }

◆ CreateStream() [2/2]

void AtDSFMTGenSvc::CreateStream ( uint32_t  seed1,
uint32_t  seed2,
const std::string &  streamName 
)
overridevirtual

Definition at line 282 of file AtDSFMTGenSvc.cxx.

283 {
284  long seeds[3] = { (long)seed1, (long)seed2, 0 };
285  const long* s = seeds;
286  engineConstIter citer = m_engines.find(streamName);
287  if ( citer == m_engines.end() )
289  engineIter iter = m_engines.find(streamName);
290  ((*iter).second)->setSeeds(s, 0);
291 }

◆ end()

AtDSFMTGenSvc::engineConstIter AtDSFMTGenSvc::end ( void  ) const
inline

Definition at line 153 of file AtDSFMTGenSvc.h.

154 { return m_engines.end(); }

◆ finalize()

StatusCode AtDSFMTGenSvc::finalize ( )
overridevirtual

Definition at line 244 of file AtDSFMTGenSvc.cxx.

245 {
246  ATH_MSG_INFO (" FINALISING ");
247 
248  if (m_save_to_file) {
249  // Write the status of the Service to file
250  std::ofstream outfile( m_file_to_write.value().c_str() );
251  if ( !outfile ) {
252  ATH_MSG_ERROR ("error: unable to open: " << m_file_to_write.value());
253  } else {
254  for (std::map<std::string, std::vector<uint32_t> >::const_iterator i = m_engines_copy.begin();
255  i != m_engines_copy.end();
256  ++i) {
257  outfile << (*i).first << " ";
258  for (std::vector<uint32_t>::const_iterator j = (*i).second.begin(); j !=(*i).second.end(); ++j){
259  outfile << (*j) << " ";
260  }
261  outfile << endl;
262  }
263  ATH_MSG_DEBUG (" wrote seeds to " << m_file_to_write.value() );
264  }
265  }
266  return StatusCode::SUCCESS;
267 }

◆ GetEngine()

CLHEP::HepRandomEngine * AtDSFMTGenSvc::GetEngine ( const std::string &  streamName)
overridevirtual

Definition at line 269 of file AtDSFMTGenSvc.cxx.

270 {
271  engineConstIter citer = m_engines.find(streamName);
272  if ( citer == m_engines.end() )
273  {
276  }
277 
278  engineIter iter = m_engines.find(streamName);
279  return (CLHEP::HepRandomEngine*)(*iter).second;
280 }

◆ handle()

void AtDSFMTGenSvc::handle ( const Incident &  inc)
overridevirtual

IIncidentListener implementation. Handles EndEvent incident.

Definition at line 155 of file AtDSFMTGenSvc.cxx.

155  {
156  ATH_MSG_DEBUG (" Handle EndEvent ");
157 
158  if ( inc.type() == "EndEvent" ||
159  inc.type() == "AfterReseedIncident" )
160  {
161  m_engines_copy.clear();
162  engineConstIter iE(begin()), eE(end());
163  while(iE != eE) {
164  CLHEP::HepRandomEngine* engine = GetEngine(iE->first);
165  std::vector<unsigned long> v = engine->put();
166  std::vector<uint32_t> tseeds(v.size());
167  for (size_t i=0; i<v.size(); ++i) {
168  // The state returned is a set of 32-bit numbers.
169  // On 64-bit platforms, though, the vector holds 64-bit ints.
170  // For the first word, one gets garbage in the high 32 bits.
171  // (This is because the crc32 routine used in clhep
172  // to hash the engine names doesn't mask down to 32 bits.)
173  // Mask off the garbage to get consistent results
174  // across platforms.
175  tseeds[i] = (v[i] & 0xffffffffu);
176  }
177  m_engines_copy.insert(std::make_pair(iE->first, tseeds));
178  ++iE;
179  }
180 
181  print();
182  } else if (inc.type() == "BeginEvent") {
183  ATH_MSG_DEBUG (" Handle BeginEvent ");
184  EventContext context = inc.context();
185  const EventIDBase& ei = context.eventID();
186  //clear static RandGauss cache (generates two numbers per call to shoot()
188  //loop over generator streams, combining the stream name to the hash
189  vector<string>::const_iterator i(m_reseedStreamNames.begin());
190  vector<string>::const_iterator e(m_reseedStreamNames.end());
191  //by default (when no streams are specified in streamNames, seed all
192  //streams
193  if (i == e) {
194  if (!(this->setAllOnDefinedSeeds(ei.event_number(),
195  ei.run_number())))
196  throw GaudiException("can not reseed all streams ", name(), StatusCode::FAILURE);
197  } else {
198  while (i != e) {
199  const string& strName(*i++);
200  if (0 == this->setOnDefinedSeeds(ei.event_number(),
201  ei.run_number(),
202  strName)) {
203  throw GaudiException(string("can not reseed stream ") + strName,
204  name(), StatusCode::FAILURE);
205  } else {
206  msg() << MSG::VERBOSE << "Reseeded stream " << strName
207  << " for random service " << endmsg;
208  }
209  }
210  }
211  }
212  else if (inc.type() == "ReseedIncident") {
213  typedef ContextIncident<std::pair<unsigned,unsigned> > Ctxt;
214  const Ctxt* incident = dynamic_cast<const Ctxt*>(&inc);
215  const std::pair<unsigned,unsigned>& data = incident->tag();
216  //clear static RandGauss cache (generates two numbers per call to shoot()
218  //loop over generator streams, combining the stream name to the hash
219  vector<string>::const_iterator i(m_reseedStreamNames.begin());
220  vector<string>::const_iterator e(m_reseedStreamNames.end());
221  //by default (when no streams are specified in streamNames, seed all
222  //streams
223  if (i == e) {
224  if (!(this->setAllOnDefinedSeeds(data.first,
225  data.second)))
226  throw GaudiException("can not reseed all streams ", name(), StatusCode::FAILURE);
227  } else {
228  while (i != e) {
229  const string& strName(*i++);
230  if (0 == this->setOnDefinedSeeds(data.first,
231  data.second,
232  strName)) {
233  throw GaudiException(string("can not reseed stream ") + strName,
234  name(), StatusCode::FAILURE);
235  } else {
236  msg() << MSG::VERBOSE << "Reseeded stream " << strName
237  << " for random service " << endmsg;
238  }
239  }
240  }
241  }
242 }

◆ initialize()

StatusCode AtDSFMTGenSvc::initialize ( )
overridevirtual

Incident Service

Definition at line 48 of file AtDSFMTGenSvc.cxx.

49 {
51  ("Initializing " << name() << "\n INITIALISING RANDOM NUMBER STREAMS. ");
52 
54  ServiceHandle<IIncidentSvc> pIncSvc("IncidentSvc", name());
55 
56  // set up the incident service:
57  ATH_CHECK( pIncSvc.retrieve() );
58 
59  //start listening to "EndEvent"
60  static const int PRIORITY = 100;
61  pIncSvc->addListener(this, "EndEvent", PRIORITY);
62  pIncSvc->addListener(this, "AfterReseedIncident", PRIORITY);
63 
64  //and to BeginEvent if we are reseeding
65  if (m_eventReseed) {
66  ATH_MSG_INFO ("will be reseeded for every event");
67  pIncSvc->addListener(this, "BeginEvent", PRIORITY);
68  pIncSvc->addListener(this, "ReseedIncident", PRIORITY);
69  }
70  pIncSvc.release().ignore();
71 
72  if (m_read_from_file) {
73  // Read from a file
74  ifstream infile( m_file_to_read.value().c_str() );
75  if ( !infile ) {
76  ATH_MSG_ERROR (" Unable to open: " << m_file_to_read.value());
77  return StatusCode::FAILURE;
78  } else {
79  std::string buffer;
80  while (std::getline(infile, buffer)) {
81  string stream;
82  std::vector<uint32_t> seeds;
83  //split the space-separated string in 3 words:
84  if (interpretSeeds(buffer, stream, seeds)) {
85  msg (MSG::DEBUG)
86  << " INITIALISING " << stream << " stream with seeds ";
87  for (std::vector<uint32_t>::const_iterator i = seeds.begin(); i != seeds.end(); ++i){
88  // The state returned is a set of 32-bit numbers.
89  // On 64-bit platforms, though, the vector holds 64-bit ints.
90  // For the first word, one gets garbage in the high 32 bits.
91  // (This is because the crc32 routine used in clhep
92  // to hash the engine names doesn't mask down to 32 bits.)
93  // So mask off the garbage so that we get consistent results
94  // across platforms.
95  msg() << ((*i) & 0xffffffffu) << " ";
96  }
97  msg() << " read from file " << m_file_to_read.value() << endmsg;
98  if (CreateStream(seeds, stream)) {
100  << stream << " stream initialized succesfully" <<endmsg;
101  } else {
102  msg(MSG::ERROR)
103  << stream << " stream FAILED to initialize" <<endmsg;
104  return StatusCode::FAILURE;
105  }
106  } else {
107  msg(MSG::ERROR)
108  << "bad line\n" << buffer
109  << "\n in input file " << m_file_to_read.value() << endmsg;
110  return StatusCode::FAILURE;
111  }
112  }
113 
114  }
115  }
116  // Create the various streams according to user's request
117  for (const auto& i : m_streams_seeds.value()) {
118  string stream;
119  uint32_t seed1, seed2, offset(0);
120  //parse the stream property string
122  ATH_MSG_VERBOSE("Seeds property: stream " << stream
123  << " seeds " << seed1 << ' ' << seed2
124  << ", reseeding offset " << offset);
125  } else {
126  ATH_MSG_ERROR("bad Seeds property\n" << i);
127  return StatusCode::FAILURE;
128  }
129 
130  // Check if stream already generated (e.g. from reading a file)
131  bool not_found(true);
132  if ( number_of_streams() != 0 ) {
134  while (sf != end() && (not_found=((*sf).first != stream))) ++sf;
135  }
136 
137  if (not_found) {
139  (" INITIALISING " << stream << " stream with seeds "
140  << seed1 << " " << seed2);
142  if (m_eventReseed) {
143  m_reseedingOffsets.insert(std::make_pair(stream, offset));
144  // apply the offset we just inserted
145  ATH_MSG_DEBUG("Applying reseeding offset " << offset <<
146  " to stream " << stream);
147  this->setOnDefinedSeeds(seed1, seed2, stream);
148  }
149  }
150 
151  }
152  return StatusCode::SUCCESS;
153 }

◆ number_of_streams()

unsigned int AtDSFMTGenSvc::number_of_streams ( void  ) const
inline

Definition at line 157 of file AtDSFMTGenSvc.h.

158 { return m_engines.size(); }

◆ print() [1/2]

void AtDSFMTGenSvc::print ( const std::string &  streamName)
overridevirtual

Definition at line 332 of file AtDSFMTGenSvc.cxx.

333 {
334  engineConstIter citer = m_engines.find(StreamName);
335  if ( citer == m_engines.end() ) {
336  ATH_MSG_WARNING (" Stream = " << StreamName << " NOT FOUND");
337  } else {
338  std::vector<unsigned long> v = ((*citer).second)->put();
339  msg(MSG::DEBUG) << " Stream = " << StreamName << " ";
340  for (std::vector<unsigned long>::const_iterator i = v.begin(); i != v.end(); ++i){
341  // The state returned is a set of 32-bit numbers.
342  // On 64-bit platforms, though, the vector holds 64-bit ints.
343  // For the first word, one gets garbage in the high 32 bits.
344  // (This is because the crc32 routine used in clhep
345  // to hash the engine names doesn't mask down to 32 bits.)
346  // So mask off the garbage so that we get consistent results
347  // across platforms.
348  msg() << ((*i) & 0xffffffffu) << " ";
349  }
350  msg() << endmsg;
351  }
352 }

◆ print() [2/2]

void AtDSFMTGenSvc::print ( void  )
overridevirtual

Definition at line 354 of file AtDSFMTGenSvc.cxx.

355 {
356  for (engineConstIter i = m_engines.begin(); i != m_engines.end(); ++i)
357  print( (*i).first );
358 }

◆ setAllOnDefinedSeeds() [1/2]

bool AtDSFMTGenSvc::setAllOnDefinedSeeds ( uint32_t  eventNumber,
uint32_t  runNumber 
)
overridevirtual

seed all streams, combining eventNumber, runNumber and the stream names

Definition at line 392 of file AtDSFMTGenSvc.cxx.

393 {
394  bool allOK(true);
395  engineIter i(m_engines.begin()), e(m_engines.end());
396  while (i!=e &&
397  (allOK=(0 != this->setOnDefinedSeeds(eventNumber,
398  runNumber,
399  (*i++).first)))) {
400  /*empty*/
401  }
402 
403  return allOK;
404 }

◆ setAllOnDefinedSeeds() [2/2]

bool AtDSFMTGenSvc::setAllOnDefinedSeeds ( uint32_t  theSeed)
overridevirtual

seed all streams we manage, combining theSeed and the stream names

Definition at line 407 of file AtDSFMTGenSvc.cxx.

407  {
408  bool allOK(true);
409  engineIter i(m_engines.begin()), e(m_engines.end());
410  while (i!=e &&
411  (allOK=(0 != this->setOnDefinedSeeds(theSeed, (*i++).first)))) {
412  /*empty*/
413  }
414  return allOK;
415 }

◆ setOnDefinedSeeds() [1/2]

CLHEP::HepRandomEngine * AtDSFMTGenSvc::setOnDefinedSeeds ( uint32_t  eventNumber,
uint32_t  runNumber,
const std::string &  streamName 
)
overridevirtual

Definition at line 360 of file AtDSFMTGenSvc.cxx.

362 {
363  uint32_t theHash(eventNumber);
364  map<string, uint32_t>::const_iterator citer(m_reseedingOffsets.find(streamName));
365  bool hasOffset(citer != m_reseedingOffsets.end() && 0 != citer->second);
366  if (hasOffset) theHash=crc_combine(theHash, citer->second);
367 
368  theHash=crc_combine(theHash, runNumber);
369  ATH_MSG_VERBOSE( "Reseeding stream " << streamName
370  << " with eventNumber " << eventNumber
371  << " runNumber " << runNumber);
372  if (hasOffset) ATH_MSG_VERBOSE("Applied offset " << citer->second);
373  return this->setOnDefinedSeeds(theHash, streamName);
374 }

◆ setOnDefinedSeeds() [2/2]

CLHEP::HepRandomEngine * AtDSFMTGenSvc::setOnDefinedSeeds ( uint32_t  theSeed,
const std::string &  streamName 
)
overridevirtual

create engine if not found. FIXME this may not be a good idea

Definition at line 376 of file AtDSFMTGenSvc.cxx.

377  {
378  engineConstIter citer = m_engines.find(streamName);
380  if ( citer == m_engines.end() )
382 
383  engineIter iter = m_engines.find(streamName);
384  theSeed=crc_combine(theSeed, streamName);
385  ATH_MSG_DEBUG("Reseeding stream " << streamName << " with " << theSeed);
386  CLHEP::HepRandomEngine* eng = (*iter).second;
387  eng->setSeed( theSeed, 0 );
388  return (CLHEP::HepRandomEngine*)eng;
389 }

◆ SetStreamSeeds()

void AtDSFMTGenSvc::SetStreamSeeds ( const std::string &  StreamName)
private

Definition at line 303 of file AtDSFMTGenSvc.cxx.

304 {
305  uint32_t seed1;
306  uint32_t seed2;
307  if (StreamName == "PYTHIA")
308  {
311  }
312  else if (StreamName == "HERWIG")
313  {
316  }
317  else
318  {
321  }
323  (" INITIALISING " << StreamName << " stream with DEFAULT seeds "
324  << seed1 << " " << seed2);
325 
326  long seeds[3] = { (long)seed1, (long)seed2, 0 };
327  const long* s = seeds;
328  engineIter iter = m_engines.find(StreamName);
329  ((*iter).second)->setSeeds(s,0);
330 }

Member Data Documentation

◆ m_default_seed1

long AtDSFMTGenSvc::m_default_seed1
private

Definition at line 128 of file AtDSFMTGenSvc.h.

◆ m_default_seed2

long AtDSFMTGenSvc::m_default_seed2
private

Definition at line 129 of file AtDSFMTGenSvc.h.

◆ m_engines

engineMap AtDSFMTGenSvc::m_engines
private

Definition at line 121 of file AtDSFMTGenSvc.h.

◆ m_engines_copy

std::map<std::string, std::vector<uint32_t> > AtDSFMTGenSvc::m_engines_copy
private

Random engine copy (for output to a file)

Definition at line 123 of file AtDSFMTGenSvc.h.

◆ m_eventReseed

Gaudi::Property<bool> AtDSFMTGenSvc::m_eventReseed {this,"EventReseeding",true,"reseed every event using a hash of run and event numbers"}
private

reseed for every event

Definition at line 112 of file AtDSFMTGenSvc.h.

◆ m_file_to_read

Gaudi::Property<std::string> AtDSFMTGenSvc::m_file_to_read
private
Initial value:
{this,"FileToRead",this->name()+".out",
"name of a ASCII file, usually produced by AtDSFMTGenSvc itself at the end of a job, containing the information to fully set/restore the status"
}

name of the file to read the engine status from

Definition at line 105 of file AtDSFMTGenSvc.h.

◆ m_file_to_write

Gaudi::Property<std::string> AtDSFMTGenSvc::m_file_to_write
private
Initial value:
{this,"FileToWrite",this->name()+".out",
"name of an ASCII file which will be produced on finalize, containing the information to fully set/restore the status"}

name of the file to save the engine status to.

Definition at line 109 of file AtDSFMTGenSvc.h.

◆ m_HERWIG_default_seed1

long AtDSFMTGenSvc::m_HERWIG_default_seed1
private

Definition at line 132 of file AtDSFMTGenSvc.h.

◆ m_HERWIG_default_seed2

long AtDSFMTGenSvc::m_HERWIG_default_seed2
private

Definition at line 133 of file AtDSFMTGenSvc.h.

◆ m_PYTHIA_default_seed1

long AtDSFMTGenSvc::m_PYTHIA_default_seed1
private

Definition at line 130 of file AtDSFMTGenSvc.h.

◆ m_PYTHIA_default_seed2

long AtDSFMTGenSvc::m_PYTHIA_default_seed2
private

Definition at line 131 of file AtDSFMTGenSvc.h.

◆ m_read_from_file

Gaudi::Property<bool> AtDSFMTGenSvc::m_read_from_file {this,"ReadFromFile",false,"set/restore the status of the engine from file"}
private

read engine status from file

Definition at line 104 of file AtDSFMTGenSvc.h.

◆ m_reseedingOffsets

std::map<std::string, uint32_t> AtDSFMTGenSvc::m_reseedingOffsets
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.

◆ m_reseedStreamNames

StringArrayProperty AtDSFMTGenSvc::m_reseedStreamNames {this,"ReseedStreamNames",{}, "the streams we are going to set the seeds of (default: all streams)"}
private

streams to be reseeded for every event

Definition at line 113 of file AtDSFMTGenSvc.h.

◆ m_save_to_file

Gaudi::Property<bool> AtDSFMTGenSvc::m_save_to_file {this,"SaveToFile", true,"save the status of the engine to file"}
private

should current engine status be saved to file ?

Definition at line 108 of file AtDSFMTGenSvc.h.

◆ m_streams_seeds

StringArrayProperty AtDSFMTGenSvc::m_streams_seeds
private
Initial value:
{this,"Seeds",{},
"seeds for the engines, this is a vector of strings of the form "
"['SequenceName [OFFSET num] Seed1 Seed2', ...] where OFFSET is an "
"optional integer that allows to change the sequence of randoms for a "
"given run/event no and SequenceName combination. Notice that "
"Seed1/Seed2 are dummy when EventReseeding is used",
"OrderedSet<std::string>"}

seeds for the engines, this is a vector of strings of the form "EnginName Seed1 Seed2"

Definition at line 95 of file AtDSFMTGenSvc.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CLHEP::dSFMTEngine
Definition: dSFMTEngine.h:31
AtDSFMTGenSvc::engineIter
engineMap::iterator engineIter
Definition: AtDSFMTGenSvc.h:63
AtDSFMTGenSvc::m_PYTHIA_default_seed2
long m_PYTHIA_default_seed2
Definition: AtDSFMTGenSvc.h:131
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
run.infile
string infile
Definition: run.py:13
AtDSFMTGenSvc::m_engines_copy
std::map< std::string, std::vector< uint32_t > > m_engines_copy
Random engine copy (for output to a file)
Definition: AtDSFMTGenSvc.h:123
AtDSFMTGenSvc::engineConstIter
engineMap::const_iterator engineConstIter
Definition: AtDSFMTGenSvc.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
AtDSFMTGenSvc::m_default_seed1
long m_default_seed1
Definition: AtDSFMTGenSvc.h:128
AtDSFMTGenSvc::m_save_to_file
Gaudi::Property< bool > m_save_to_file
should current engine status be saved to file ?
Definition: AtDSFMTGenSvc.h:108
AtDSFMTGenSvc::setAllOnDefinedSeeds
virtual bool setAllOnDefinedSeeds(uint32_t theSeed) override
seed all streams we manage, combining theSeed and the stream names
Definition: AtDSFMTGenSvc.cxx:407
AtDSFMTGenSvc::CreateStream
virtual void CreateStream(uint32_t seed1, uint32_t seed2, const std::string &streamName) override
Definition: AtDSFMTGenSvc.cxx:282
AtDSFMTGenSvc::print
virtual void print(void) override
Definition: AtDSFMTGenSvc.cxx:354
AtDSFMTGenSvc::m_read_from_file
Gaudi::Property< bool > m_read_from_file
read engine status from file
Definition: AtDSFMTGenSvc.h:104
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
AtDSFMTGenSvc::GetEngine
virtual CLHEP::HepRandomEngine * GetEngine(const std::string &streamName) override
Definition: AtDSFMTGenSvc.cxx:269
AtDSFMTGenSvc::number_of_streams
unsigned int number_of_streams(void) const
Definition: AtDSFMTGenSvc.h:157
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
AtDSFMTGenSvc::m_eventReseed
Gaudi::Property< bool > m_eventReseed
reseed for every event
Definition: AtDSFMTGenSvc.h:112
AtDSFMTGenSvc::SetStreamSeeds
void SetStreamSeeds(const std::string &StreamName)
Definition: AtDSFMTGenSvc.cxx:303
genPbPbJobOpt.seed2
seed2
Definition: genPbPbJobOpt.py:57
AtDSFMTGenSvc::m_PYTHIA_default_seed1
long m_PYTHIA_default_seed1
Definition: AtDSFMTGenSvc.h:130
crc_combine
uint32_t crc_combine(uint32_t seed, uint32_t v)
using crc32 for architecture independence in combining the seeds
Definition: AthenaKernel/src/crc_combine.h:11
AtDSFMTGenSvc::end
engineConstIter end(void) const
Definition: AtDSFMTGenSvc.h:153
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AtDSFMTGenSvc::m_file_to_read
Gaudi::Property< std::string > m_file_to_read
name of the file to read the engine status from
Definition: AtDSFMTGenSvc.h:105
EventInfoWrite.StreamName
string StreamName
Definition: EventInfoWrite.py:28
AtDSFMTGenSvc::m_engines
engineMap m_engines
Definition: AtDSFMTGenSvc.h:121
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AtDSFMTGenSvc::m_reseedStreamNames
StringArrayProperty m_reseedStreamNames
streams to be reseeded for every event
Definition: AtDSFMTGenSvc.h:113
AtDSFMTGenSvc::m_reseedingOffsets
std::map< std::string, uint32_t > m_reseedingOffsets
optional offsets to combine to run/evt no when reseeding.
Definition: AtDSFMTGenSvc.h:119
AtDSFMTGenSvc::m_HERWIG_default_seed1
long m_HERWIG_default_seed1
Definition: AtDSFMTGenSvc.h:132
AtDSFMTGenSvc::setOnDefinedSeeds
virtual CLHEP::HepRandomEngine * setOnDefinedSeeds(uint32_t theSeed, const std::string &streamName) override
Definition: AtDSFMTGenSvc.cxx:376
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
interpretSeeds
bool interpretSeeds(const std::string &buffer, std::string &stream, uint32_t &seed1, uint32_t &seed2, short &luxury, uint32_t &offset)
Definition: interpretSeeds.cxx:28
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
HLT::setFlag
void setFlag(TrigPassFlags *flags, const T *obj, const CONTAINER *container, const std::vector< bool > &flag)
Set the flag at index position.
Definition: TrigPassFlags.h:121
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.PyAthena.v
v
Definition: PyAthena.py:154
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
AtDSFMTGenSvc::begin
engineConstIter begin(void) const
Definition: AtDSFMTGenSvc.h:149
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DeMoScan.first
bool first
Definition: DeMoScan.py:536
DEBUG
#define DEBUG
Definition: page_access.h:11
genPbPbJobOpt.seed1
seed1
Definition: genPbPbJobOpt.py:56
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
AtDSFMTGenSvc::m_default_seed2
long m_default_seed2
Definition: AtDSFMTGenSvc.h:129
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
PrepareReferenceFile.outfile
outfile
Definition: PrepareReferenceFile.py:42
AtDSFMTGenSvc::engineValType
engineMap::value_type engineValType
Definition: AtDSFMTGenSvc.h:65
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
AtDSFMTGenSvc::m_streams_seeds
StringArrayProperty m_streams_seeds
seeds for the engines, this is a vector of strings of the form "EnginName Seed1 Seed2"
Definition: AtDSFMTGenSvc.h:95
AtDSFMTGenSvc::m_HERWIG_default_seed2
long m_HERWIG_default_seed2
Definition: AtDSFMTGenSvc.h:133
Generate_randomseeds.Seeds
Seeds
Definition: Generate_randomseeds.py:64
AtDSFMTGenSvc::m_file_to_write
Gaudi::Property< std::string > m_file_to_write
name of the file to save the engine status to.
Definition: AtDSFMTGenSvc.h:109
ServiceHandle< IIncidentSvc >