Geant4.10.4 and CLHEP Random Number Generators¶
WORK IN PROGRESS !!!
Released in December 2017, Geant4.10.4 assumes the use of CLHEP v18.104.22.168.
Along with several bug fixes, CLHEP v22.214.171.124 has an important change in the Random Number Generator that now uses the MIXMAX as the default engine (CLHEP::MixMaxRng).
The MIXMAX generator is a modern alternative to HepJamesRandom (RANMAR; for details, see Comp. Phys. Comm. 60 (1990) 329) 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.
#include "Randomize.hh" CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine); long seed = 123456789; // but no larger than 900000000 !!! CLHEP::HepRandom::setTheSeed( seed );
NOTE: the setTheEngine(...) function does NOT delete the default engine; it just makes the generator use the alternative one.
Obviously, the CLHEP::RanecuEngine is just one example; there are other engine available in CLHEP/Random.
A 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 with transitioning to the new MIXMAX engine of CLHEP v126.96.36.199, 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).
Several preliminary results are included to illustrate the case:
- Forward (FW) production of pi+ by 5GeV/c pi+ incident on Carbon nucleus, as simulated by Bertini cascade model Click to Show Plots
- Forward (FW) production of pi+ by 5GeV/c pi+ incident on Carbon nucleus, as simulated by FTF model Click to Show Plots
- Large Angle (LA) production of pi+ by 5GeV/c pi+ incident on Carbon nucleus, as simulated by Bertini cascade model Click to Show Plots
- Large Angle (LA) production of pi+ by 5GeV/c pi+ incident on Carbon nucleus, as simulated by FTF model Click to Show Plots
Last but not least.
While CLHEP v188.8.131.52 is strongly recommended to be used with Geant4.10.4, it appears that the use of CLHEP v184.108.40.206 is also possible, at least at the "mechanical level". This means that Geant4.10.4 builds fine vs CLHEP v220.127.116.11, and results of several preliminary tests appear to make sense.