RNDM-Geant4104 » History » Version 1

Version 1/24 - Next » - Current version
Julia Yarba, 01/04/2018 03:23 PM

Geant4.10.4 and CLHEP Random Number Generators

Released in December 2017, Geant4.10.4 assumes the use of CLHEP v2.4.0.0.

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).
The MIXMAX generator is a better, faster alternative to HepJamesRandom (RANMAR) that was the default engine in the CLHEP v2.3.x-series.

However, the (default) random engine can be easily replaced by any other engine of user's choice.
If a user wishes to seed it with a particular seed, this is also easy to do.
Example usage:

#include "Randomize.hh" 

CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
long seed = 12345679; // but no larger than 900000000 !!!
CLHEP::HepRandom::setTheSeed( seed  );

Obviously, the CLHEP::RanecuEngine is just one example; there are other engine available in CLHEP/Random.

A good description of the available engines is available at the following URL: