Project

General

Profile

RNDM-Geant4104 » History » Version 15

Julia Yarba, 01/05/2018 01:06 PM

1 1 Julia Yarba
h1. Geant4.10.4 and CLHEP Random Number Generators
2 1 Julia Yarba
3 11 Julia Yarba
*WORK IN PROGRESS !!!*
4 11 Julia Yarba
5 11 Julia Yarba
6 1 Julia Yarba
Released in December 2017, Geant4.10.4 assumes the use of CLHEP v2.4.0.0.
7 1 Julia Yarba
8 6 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":https://mixmax.hepforge.org as the default engine (CLHEP::MixMaxRng).
9 14 Julia Yarba
The MIXMAX generator is a modern, presumably faster 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.
10 1 Julia Yarba
11 1 Julia Yarba
However, the (default) random engine can be easily replaced by any other engine of user's choice. 
12 4 Julia Yarba
If a user wishes to initialize it with a particular seed, this is also easy to do.
13 1 Julia Yarba
Example usage:
14 1 Julia Yarba
<pre>
15 1 Julia Yarba
16 1 Julia Yarba
#include "Randomize.hh"
17 1 Julia Yarba
18 1 Julia Yarba
CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
19 8 Julia Yarba
long seed = 123456789; // but no larger than 900000000 !!!
20 1 Julia Yarba
CLHEP::HepRandom::setTheSeed( seed  );
21 1 Julia Yarba
22 1 Julia Yarba
</pre>
23 1 Julia Yarba
24 10 Julia Yarba
NOTE: the setTheEngine(...) function does NOT delete the default engine; it just makes the generator use the alternative one.
25 10 Julia Yarba
26 1 Julia Yarba
Obviously, the CLHEP::RanecuEngine is just one example; there are other engine available in CLHEP/Random.
27 1 Julia Yarba
28 13 Julia Yarba
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
29 2 Julia Yarba
30 9 Julia Yarba
In other words, if for any reasons one is not comfortable with transitioning 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.
31 2 Julia Yarba
32 2 Julia Yarba
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).
33 15 Julia Yarba
Several preliminary results are included to illustrate the case.
34 15 Julia Yarba
{{collapse(Click to Show Plots, Click to Hide Plots)
35 15 Julia Yarba
!https://cdcvs.fnal.gov/redmine/attachments/download/44921/cnv.gif!
36 15 Julia Yarba
}}
37 15 Julia Yarba
 
38 2 Julia Yarba
39 2 Julia Yarba
Last but not least.
40 3 Julia Yarba
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.
41 3 Julia Yarba
We will try to explore some more about backward compatibility of Geant4.10.4 with CLHEP v2.3.4.x-series.  
42 2 Julia Yarba
43 2 Julia Yarba
44 1 Julia Yarba
45 1 Julia Yarba
46 1 Julia Yarba
 
47 1 Julia Yarba