1 -- 
    2 --      Patricia Fasel
    3 --      Los Alamos National Laboratory
    4 --      1990 August
    5 --
    6 -- Copyright, 1990, The Regents of the University of California.
    7 -- This software was produced under a U.S. Government contract (W-7405-ENG-36)
    8 -- by the Los Alamos National Laboratory, which is operated by the University
    9 -- of California for the U.S. Department of Energy.  The U.S. Government is
   10 -- licensed to use, reproduce, and distribute this software.  Permission is
   11 -- granted to the public to copy and use this software without charge, provided
   12 -- that this notice and any statement of authorship are reproduced on all
   13 -- copies.  Neither the Government nor the University makes any warranty,
   14 -- express or implied, or assumes any liability for the use of this software.
   15 
   16 module GamtebMain (gamteb) where
   17 
   18 import GamtebType
   19 import Consts 
   20 import Utils
   21 import TransPort
   22 import Output
   23 
   24 -- create a particle and transport it
   25 
   26 sources :: Random -> Int -> Energy -> ([Result], [Stat])
   27 sources seed nPart e | (nPart <= 1) =
   28         transPort p prob
   29         where
   30             (eIndx, prob) = xsectInterp e
   31             (seed', _) = genRand seed
   32             p = (Part (0,0,0) (0,1,0) 1 e eIndx 1 seed')
   33 sources seed nPart e =
   34         (res1++res2, s1++s2)
   35         where
   36             nPart1 = nPart `div` 2
   37             nPart2 = nPart - nPart1
   38             (r1, r2) = genRand seed
   39             (res1, s1) = sources r1 nPart1 e
   40             (res2, s2) = sources r2 nPart2 e
   41 
   42 
   43 -- scalar monte carlo code to transport .001 to 20.0 mev
   44 -- gamma rays in a carbon cylinder of length cylLen, radius cylRad
   45 
   46 gamteb :: Int -> [Char]
   47 gamteb scale =  
   48         outGamteb nPart stats result
   49         where
   50             seed = 0.5
   51             nPart = 1*scale
   52             energy = 6
   53             (result, stats) = sources seed nPart energy