Different results with different seeds

Dear all,

I have some misunderstanding of how random number generators works with events in one run.
May I be sure that I have independent results for two runs if the conditions below are performed:

  1. in the main.cpp I have G4Random::setTheEngine(new CLHEP::RanecuEngine); (or another engine);
  2. in the .mac file there is /random/setSeeds WWW XXX for first run while for the second /random/setSeeds YYY ZZZ (of course WWW isn't equals to YYY and XXX isn't equals to ZZZ)?

Should I set the values of WWW, XXX, YYY and ZZZ taking into account the number of initial events?

I await any replies with interest,

i dont think you need to explicitly reseed the random engine for the second run, as the period of the RNG should be so much larger than the number of events times the number of required random numbers per event.
you could however seed the individual runs, to have better reproducibility…

1 Like

I mean two individual runs in my whole message

this is how I understood your post.


you only need to re-seed the RNG if you want to have specific reproducible individual runs, e.g.,

/random/setSeeds WWW XXX
/run/beamOn N1
/random/setSeeds YYY ZZZ
/run/beamOn N2

in this case, you could perform the run with N2 again somewhen later with identical outcome without prior running the one with N1

or if you restart the application between runs, and do not seed the RNG to e.g., the current time in the code.

/random/setSeeds WWW XXX
/run/beamOn N1
/run/beamOn N2

already gives you independent results for the two runs.

1 Like

this may be helpfull for me, but instead I am actually interested in non-identical outcome from one run to onether (and I restart an app between them) in order to improve statistics.

Anyway, I got the point about this problem. Thank you for clarifying this.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.