Project

General

Profile

RNDM-Geant4104 » History » Version 1

Julia Yarba, 01/04/2018 03:23 PM

1 1 Julia Yarba
h1. Geant4.10.4 and CLHEP Random Number Generators
2 1 Julia Yarba
3 1 Julia Yarba
Released in December 2017, Geant4.10.4 assumes the use of CLHEP v2.4.0.0.
4 1 Julia Yarba
5 1 Julia Yarba
Along with several bug fixes, CLHEP v2.4.0.0 has an important change in the Random Number Generator that now uses the MIXMAX as the default engine (CLHEP::MixMaxRnd).
6 1 Julia Yarba
The MIXMAX generator is a better, faster alternative to HepJamesRandom (RANMAR) that was the default engine in the CLHEP v2.3.x-series.
7 1 Julia Yarba
8 1 Julia Yarba
However, the (default) random engine can be easily replaced by any other engine of user's choice. 
9 1 Julia Yarba
If a user wishes to seed it with a particular seed, this is also easy to do.
10 1 Julia Yarba
Example usage:
11 1 Julia Yarba
<pre>
12 1 Julia Yarba
13 1 Julia Yarba
#include "Randomize.hh"
14 1 Julia Yarba
15 1 Julia Yarba
CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
16 1 Julia Yarba
long seed = 12345679; // but no larger than 900000000 !!!
17 1 Julia Yarba
CLHEP::HepRandom::setTheSeed( seed  );
18 1 Julia Yarba
19 1 Julia Yarba
</pre>
20 1 Julia Yarba
21 1 Julia Yarba
Obviously, the CLHEP::RanecuEngine is just one example; there are other engine available in CLHEP/Random.
22 1 Julia Yarba
23 1 Julia Yarba
A good description of the available engines is available at the following URL:  https://indico.cern.ch/event/558996/contributions/2264756/attachments/1331446/2001101/mixmax-CLHEP.pdf
24 1 Julia Yarba
25 1 Julia Yarba
26 1 Julia Yarba
 
27 1 Julia Yarba