*FILE MEMBER=brem_angle LIBRARY=SNOMAN LANGUAGE=FORTRAN77 DATE=25:Oct:1995
 <<<      function brem_angle(total_e, particle_mass, e_fraction, element_z)
     
    *
    *     SNOMAN: Given an energy transfer to a brem photon, find the angle
    *             emmision.
    *
    *     Contact:  J. Formaggio (UW)
    *     Verified:
    *     Refereed:
    *
    *     Parameters:-
    *     ==========
    *     total_e:                       
    *            The total energy of the particle
    *
    *     particle_mass:                          
    *            The mass of the particle
    *
    *     e_fraction:                    
    *            from 0 ->1, the fraction of energy that the photon got
    *
    *     element_z:                    
    *            The nuclear charge on the element.
    *
    *
    *     Common Block Access:-
    *     ===================
    *     None
    *
    *     Specification:-
    *     =============
    *      Return the angle theta in radians
    *
    *     Program Notes:-
    *     =============
    *     Obrained from Geant Manual/ source code
    *
    *
    *     Revision History:-
    *     ================
    *
    *     2.08  T. Andersen    First version.
    *     2.09  N. West     Tighten up SNORAN call args.
    *
    *     Argument Declarations:-
    *     =====================
          implicit none
          real total_e
          real particle_mass
          real e_fraction
          real element_z
          real brem_angle
     
    *      REAL FUNCTION GBTETH(ENER,PARTM,EFRAC, element_z)
    C.
    C.    ******************************************************************
    C.    *                                                                *
    C.    *   Universal distribution function for the Bremsstrahlung       *
    C.    *   and pair production angles. This function approximates       *
    C.    *   the real distribution function which can be found in         *
    C.    *   Yung-Su Tsai: Rev. Mod. Phys. 46,815(1974)                   *
    C.    *     +erratum  : Rev. Mod. Phys. 49,421(1977)                   *
    C.    *                                                                *
    C.    *   Called by : GBREME, GBREMM, GPAIRG                           *
    C.    *   Authors   : L.Urban                                          *
    C.    *                                                                *
    C.    ******************************************************************
    C.
          real snoran ! function
     
          real ALFA
          PARAMETER (ALFA=0.625)
     
          real W1
          real UMAX
          real D
          real BETA
          real U
          integer    i_snoran
     
          real PI
          PARAMETER (PI=3.14159265359E00)
     
     
          i_snoran = 0
     
    *----------------------------------------------------------
    * GEANT 3.15
    *     GBTETH=1.
    *     GOTO 999
    * Angular distribution with d=const
    *     D=27.
    * Angular distribution with d=d(Z,E,y)
          D=0.13*(0.8+1.3/element_z)*(100.+1./total_e)*(1.+e_fraction)
    *-------------------------------------------------------------
     
          W1=9./(9.+D)
          UMAX=total_e*PI/particle_mass
     
    10    continue
     
          i_snoran = i_snoran + 100
          IF(snoran(i_snoran).LE.W1) THEN
             BETA=ALFA
          ELSE
             BETA=3.0*ALFA
          ENDIF
     
          i_snoran = i_snoran + 100
          U=-(LOG(snoran(i_snoran)*snoran(i_snoran+1)))/BETA
     
    * cut : theta should be .LE. PI  !!
    *this condition depend on E in the case of d=const too!!!!!
     
          IF(U.GE.UMAX) GOTO 10
     
          brem_angle = U
          END
    *ENDFILE MEMBER=brem_angle