Geant4 seeds in R3BRoot [message #19909] |
Fri, 18 November 2016 13:03 |
C. A. Douma
Messages: 88 Registered: September 2015 Location: Groningen
|
continuous participant |
From: *kvi-cart.rug.nl
|
|
Dear Mr. Kresan,
If I run exactly the same R3BRoot simulation twice, I get exactly the same output. I know that this is to be expected, because the first event from Geant4 is given a fixed seed for the random number generators. Then every new event is given an outcome of the previous one as the new seed, producing randomly distributed events.
I know that this is very useful for debugging, but not if I want to run multiple simulations separately and than add the results in the end to obtain better statistics.
In pure Geant4 it is possible to use the native Linux random number generator to generate the seed of the first event from keyboard noise. This will then produce 'truly random events'. Do you know how this can be implemented in R3BRoot?
Yours Sincerely,
Christiaan Douma.
|
|
|
Re: Geant4 seeds in R3BRoot [message #19912 is a reply to message #19909] |
Fri, 18 November 2016 13:18 |
Dmytro Kresan
Messages: 166 Registered: June 2004
|
first-grade participant |
From: *gsi.de
|
|
If you update your R3BRoot/dev, you will find the following at line 375 of macros/r3b/r3ball.C
// ----- Initialize simulation run ------------------------------------
run->Init();
gMC->SetRandom(new TRandom3(randomSeed));
in case you use 0 as the randomSeed parameter - seed will be automatically generated every time you start your simulation - depending on machine, date and time.
|
|
|