GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » R3BRoot » Simulation Issues » Geant4 seeds in R3BRoot (How to change the Geant4 seeds in R3BRoot)
Geant4 seeds in R3BRoot [message #19909] Fri, 18 November 2016 13:03 Go to next message
C. A. Douma is currently offline  C. A. Douma
Messages: 88
Registered: September 2015
Location: Groningen
continuous participant
From: *
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 Go to previous message
Dmytro Kresan is currently offline  Dmytro Kresan
Messages: 166
Registered: June 2004
first-grade participant
From: *
If you update your R3BRoot/dev, you will find the following at line 375 of macros/r3b/r3ball.C

  // -----   Initialize simulation run   ------------------------------------
  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.
Previous Topic: Definiton of Glad center of Glad magnetic field map center
Next Topic: Data Structure of GeoTracks/MCTracks
Goto Forum:

Current Time: Mon May 27 20:35:09 CEST 2024

Total time taken to generate the page: 0.00850 seconds