<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Folks,<br>
    <br>
    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.<br>
    <br>
    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.<br>
    <br>
    I think we are good to go.<br>
    <br>
    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.<br>
    <br>
      -- Mark<br>
    <br>
    <div class="moz-cite-prefix">On 03/20/2014 03:26 PM, Richard Jones
      wrote:<br>
    </div>
    <blockquote
cite="mid:CABfxa3RmBxJmjeSGfNoOvZSZmu0VRK057xfM_NgQTt6fQ2B5ow@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello all,
        <div><br>
        </div>
        <div>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.</div>
        <div><br>
        </div>
        <div>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.</div>
        <div><br>
        </div>
        <div>"Two integer seeds are used to initialise a sequence. <b>Not
            all pairs of integers define a good random sequence</b> 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<sup>60</sup>≈10<sup>18</sup> . 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<sup>9</sup> numbers apart. Thus
          a sequence started from one of the seed pairs, after 10<sup>9 </sup>numbers
          will start generating the next one."</div>
        <div><br>
        </div>
        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:
        <div>
          <br>
        </div>
        <div>c Feeding seeds back to the GEANT random number generator
          is dangerous</div>
        <div>c because those seed settings are generally made assuming
          that RANECQ</div>
        <div>c is independent of GRNDMQ and can be hardcoded to reset
          when some</div>
        <div>c random bit of code gets called for the first time. Only
          GEANT</div>
        <div>c should ever initialize the seed.</div>
        <div>c CALL GRNDMQ(JSEED,KSEED,1,'S')</div>
        <div>
          <br>
        </div>
        <div>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.</div>
        <div><br>
        </div>
        <div>-Richard Jones</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Halld-offline mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Halld-offline@jlab.org">Halld-offline@jlab.org</a>
<a class="moz-txt-link-freetext" href="https://mailman.jlab.org/mailman/listinfo/halld-offline">https://mailman.jlab.org/mailman/listinfo/halld-offline</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Mark M. Ito, Jefferson Lab, <a class="moz-txt-link-abbreviated" href="mailto:marki@jlab.org">marki@jlab.org</a>, (757)269-5295
</pre>
  </body>
</html>