[Halld-offline] go for launch [Re: inject random seeds into HDGeant?]

Mark Ito marki at jlab.org
Thu Mar 20 16:07:59 EDT 2014


Folks,

Just created tags/sim-recon-dc-2.7. It has Paul reproducibility-inducing 
change from yesterday. This is the tag for data challenge 2, assuming no 
mistakes or serious bugs are found. I have updated the "conditions" page.

Note that the control.in_900? files that Richard prepared in the 
conditions directory already have the random number seeding scheme that 
he recommends below. Also as he says, no change to bggen has been made.

I think we are good to go.

Since this is new tag, there is always the possibility that there is 
something wrong. So if we need to stop, fix, and re-launch, that is just 
part of life in big data city. We will discuss monitoring ideas tomorrow.

   -- Mark

On 03/20/2014 03:26 PM, Richard Jones wrote:
> Hello all,
>
> I implemented the code in bggen() to create a tuple of integers 
> representing the seed of the random number generator at the start of 
> each event, and store these in the output hddm record for each event. 
>  The stated policy was that these were to be used to initialize the 
> state of the random number generator at the start of each event, for 
> all subsequent stages of the simulation workflow (hdgeant, mcsmear). 
>  However, at this late stage I am very wary of injecting unchecked 
> code into the dc-2 stack.
>
> So...  I ran a bunch of events, and some evidence of skewed 
> distributions showed up in the distribution of background (out of 
> time) beam photons coming from the internal generator in hdgeant. 
>  Hence, I suspected that the initialization of the G3 random number 
> generator using random seeds that come from the outside might be 
> problematic.  Here are some words from deep in the G4 documentation.
>
> "Two integer seeds are used to initialise a sequence. *Not all pairs 
> of integers define a good random sequence* or one which is independent 
> from others. Sections of the same random sequence can be defined as 
> independent sequences. The period of the generator is 2^60 ?10^18  . A 
> generation has been performed in order to provide the seeds to start 
> any of the generated sections. There are 215 possible seed pairs and 
> they are all 10^9  numbers apart. Thus a sequence started from one of 
> the seed pairs, after 10^9 numbers will start generating the next one."
>
> There are 2 ways to set the seeds in G3: use one of the 213 (no, 
> really) predefined sequences (what we are doing now), or come up with 
> your own pair of random ints and hope that the sequence is reasonably 
> well behaved.  Apparently if you try enough different random seeds, 
> the chances that you hit the bad spots is pretty high.  Hence our 
> observed skew.  From a code snippet imbedded deep in the G3 simulation 
> for the Minos experiement:
>
> c Feeding seeds back to the GEANT random number generator is dangerous
> c because those seed settings are generally made assuming that RANECQ
> c is independent of GRNDMQ and can be hardcoded to reset when some
> c random bit of code gets called for the first time. Only GEANT
> c should ever initialize the seed.
> c CALL GRNDMQ(JSEED,KSEED,1,'S')
>
> So my recommendation: what we are doing now is correct. Let's keep it 
> like it is, and review the issue again when hdgeant4 is up and running.
>
> -Richard Jones
>
>
> _______________________________________________
> Halld-offline mailing list
> Halld-offline at jlab.org
> https://mailman.jlab.org/mailman/listinfo/halld-offline

-- 
Mark M. Ito, Jefferson Lab, marki at jlab.org, (757)269-5295

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.jlab.org/pipermail/halld-offline/attachments/20140320/9474336e/attachment.html 


More information about the Halld-offline mailing list