brag-1-1-8

From: Peter H. L. Christiansen (pchristi@nbi.dk)
Date: Tue May 14 2002 - 09:38:21 EDT

  • Next message: Christian Holm Christensen: "New BRAT"

    Hi
    
    I found out that the random numbers used in guxint.F (used to generate
    input distributions) was not initialised differently when brag was run.
    This means that the physics part would have different random numbers, but
    the tracks would be the same. The random numbers used by the GEANT part
    could already be initialised with a call to initrandom(number) in gbr2c.f
    (0 < number < 215) and so I added a call to initialise the random numbers
    used by guxint.F there. At the same time I changed the random generator to
    a more modern one :
    
    *     Uses the ranlux generator :
    *     http://wwwinfo.cern.ch/asdoc/shortwrupsdir/v115/top.html
    
    so no more RNDM calls there and I changed RANNO (the gaus generator) to a 
    simple gaus generator build on ranlux :
    
          SUBROUTINE GETRANDOMGAUS(random1, random2)
    *
    *     Returns a random gaus distributed number from a qaus with sigma = 1.
    *     uses the GETRANDOM routine and a wellknown algorithm (see fx) :
    *     http://www.eskimo.com/~scs/C-faq/q13.20.html
          IMPLICIT NONE
    
          REAL random, random1, random2, help1, help2, r2
    
          r2 = 2.0
    
          DO WHILE (r2 > 1.0)
    
             CALL GETRANDOM(help1)
             CALL GETRANDOM(help2)
             help1 = 2*help1 - 1.0
             help2 = 2*help2 - 1.0
             r2 = help1*help1 + help2*help2
    
          END DO
    
          random  = sqrt(-2.0 * log(r2) / r2);
          random1 = help1 * random
          random2 = help2 * random
    
          END
    
    The changes have been tested and I found no problems, but it does not mean 
    that there couldn't be any..... I just think it is really importnat to get 
    this into brat since it affects the quality of acceptence maps very much.
    
    Cheers
       Peter
    
    Changelog :
    2002-05-14  Peter H Christiansen  <pchristi@rcas0012.rcf.bnl.gov>
    
            * configure.in: Tagged new version.
    
            * src/user/guxint.F:
            Changed the random generator so it uses a modern one instead of 
    RNDM. Made
            a subroutine for generating gauss random numbers as well instead 
    of RANNO.
            The SEED can be initialised with initrandom(SEED) located in 
    gbr2c.f.
    
            * run/gbr2c.f:
            Added init call for the luxus random generator in subroutine 
    initrandom.
            This random generator is used in src/user/guxint.F
    
            * src/mids/bd_tpm1.F: Added width coresponding to padpitch of 0.39
    
    2002-04-17  Ouerdane Djamel  <ouerdane@rcas0012.rcf.bnl.gov>
    
            * run/gbr2c.f: added initrandom (from Peter C.)
    
    
    
    -- 
    :-) --------------------------- )-:
     Peter H L Christiansen @ NBI
     EMAIL  : pchristi@nbi.dk
     OFFICE : Tb1@NBI  (353 25269)
     HOME   : Hjertensfrydsgade 3, st
     PHONE  : 33330493(New)/ 40840492(mob.) 
    :-D --------------------------- \-:
    



    This archive was generated by hypermail 2b30 : Tue May 14 2002 - 09:38:54 EDT