This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / fluka / amga.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:19:59  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.44  by  S.Giani
11 *-- Author :
12 *$ CREATE AMGA.FOR
13 *COPY AMGA
14 *
15 *=== amga =============================================================*
16 *
17       FUNCTION AMGA(IT)
18  
19 #include "geant321/dblprc.inc"
20 #include "geant321/dimpar.inc"
21 #include "geant321/iounit.inc"
22 C*** RANDOM SELECTION OF MASSES OF DECAYING PARTICLES
23       COMMON/FKABLT/AMM(110),GA(110),TAU(110),ICH(110)
24      *,IBAR(110),K1(110),K2(110)
25       COMMON /FKGAMR/ REDU,AMO,AM (15 )
26       DIMENSION GASUNI(14)
27       REAL RNDM(1)
28       SAVE GASUNI, GAUNO, GAUNON, IO, NSTAB
29       DATA GASUNI/
30      *-1.D0,-.98D0,-.95D0,-.87D0,-.72D0,-.48D0,-.17D0,.17D0,.48D0,
31      *.72D0,.87D0,.95D0,.98D0,1.D0/
32       DATA GAUNO/2.352D0/
33       DATA GAUNON/2.4D0/
34       DATA IO/14/
35       DATA NSTAB/23/
36       I=1
37       IF (IT.LE.0) GO TO 3
38       IF (IT.LE.NSTAB) GO TO 2
39       DGAUNI=GAUNO*GAUNON/(IO-1.D0)
40       CALL GRNDM(RNDM,1)
41       VV = RNDM(1)
42       VV = VV*2.D0-1.D0+1.D-16
43     1 CONTINUE
44       VO=GASUNI(I)
45       I=I+1
46       V1=GASUNI(I)
47       IF (VV.GT.V1) GO TO 1
48       UNIGA=DGAUNI*(I-2.D0+(VV-VO+1.D-16)/(V1-VO)-(IO-1.D0)*.5D0)
49       DAM=GA(IT)*UNIGA/GAUNO
50       AAM=AMM(IT)+DAM
51       AMGA=AAM
52       RETURN
53     2 CONTINUE
54       AMGA=AMM(IT)
55       RETURN
56     3 CONTINUE
57       AMGA=0.D0
58       RETURN
59       END