Message: Re: Identical track data from different simulations Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Identical track data from different simulations 

Forum: Event and Track Management
Re: None Identical track data from different simulations (GaŽlle Angellier)
Date: 28 May, 2009
From: Tom Roberts <Tom Roberts>

Managing a pseudo-random number generator (PRNG) can be subtle. In particular, in Geant4 each event uses a different number of calls to the PRNG. So once some event in your second run just happens to start in the same place of the PRNG sequence as some event in the first run, from then on the sequences of events will be identical. Apparently for your case this is not as unlikely as it seems.

The default PRNG of CLHEP is very good, and guarantees no repeats within 900M calls for seeds between 0 and 900M. So what I do is seed the PRNG with the event number at the start of each event (it happens in GeneratePrimaries() before doing anything else except determine the event number).

I have never seen duplicate events, and I did look for them when I first wrote this code.

This has the side effect of being able to re-run a given event. So I can run a lot of events, generate histograms, and find some outlier events. I then re-run those specific events with visualization and can see just what happened.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Question: Re: Identical track data from different simulations   (GaŽlle Angellier - 29 May, 2009)
(_ None: Re: Identical track data from different simulations   (Paul Nicholas Colin Gloster - 31 May, 2009)
(_ Ok: Re: Identical track data from different simulations   (GaŽlle Angellier - 26 Oct, 2009)
 Add Message Add Message
to: "Re: Identical track data from different simulations"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]