Project

General

Profile

RNDM-Geant4104 » History » Version 5

« Previous - Version 5/24 (diff) - Next » - Current version
Julia Yarba, 01/04/2018 03:45 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 initialize 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, reasonably up-to-date description of available engines can be found at the following URL: https://indico.cern.ch/event/558996/contributions/2264756/attachments/1331446/2001101/mixmax-CLHEP.pdf

In other words, if for any reasons one is not comfortable to transition to the new MIXMAX engine of CLHEP v2.4.0.0, one can explicitly replace it with HepJamesRandom or any other engine available in CLHEP.

We are currently conducting a series of tests to check how (if at all) Geant4 simulated results maybe affected by the use of one or another engine (MixMax, HepJamesRandom, RanecuEngine).
Selected results will be attached to this document shortly.

Last but not least.
While CLHEP v2.4.0.0 is strongly recommended to be used with Geant4.10.4, it appears that the use of CLHEP v2.3.4.4 is also possible, at least at the "mechanical level". This means that Geant4.10.4 builds fine vs CLHEP v2.3.4.4, and results of several preliminary tests appear to make sense.
We will try to explore some more about backward compatibility of Geant4.10.4 with CLHEP v2.3.4.x-series.