This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / fluka / bekeka.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:03  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 BEKEKA.FOR
13 *COPY BEKEKA
14 *                                                                      *
15 *=== bekeka ===========================================================*
16 *                                                                      *
17       FUNCTION BEKEKA(IX,TO,AMSS,SQAMSS)
18  
19 #include "geant321/dblprc.inc"
20 #include "geant321/dimpar.inc"
21 #include "geant321/iounit.inc"
22 C*** CALCULATION OF AVERAGE CASCADE AND EXCITATION ENERGY
23 C*****IX=1 EEV    2EPK    3 ENK     4 EEX=EPK+EEV    5 EEXT=EEX+ENK
24       GO TO (1,2,3,1,1),IX
25     1 CONTINUE
26       IF(TO-0.1D0) 11,11,12
27    11 CONTINUE
28       AA=0.001D0*SQAMSS
29       GO TO 19
30    12 CONTINUE
31       APAR=0.035D0
32       BPAR=3.D0
33       CPAR=0.1D0
34       AA=CPAR*SQAMSS*(0.01D0+APAR*(BPAR+LOG10(TO))**2)
35    19 CONTINUE
36       IF(IX.GT.3) GO TO 2
37 C    ENERGYADJUST
38       ENADJ=1.D0
39       AA=AA*ENADJ
40       BEKEKA=AA
41       RETURN
42     2 CONTINUE
43       AN=BNKEKA(1,TO,AMSS,SQAMSS)
44       A =BKEKA (1,TO,AMSS)
45       EXTOA=0.D0
46       IF(TO.LT.5.D0*A) EXTOA=EXP(-TO/A)
47       TPKAV=A*(1.D0-(TO/A+1.D0)*EXTOA)/(1.D0-EXTOA)
48       BB=TPKAV*AN
49       IF(IX.EQ.4) GO TO 4
50       IF(IX.EQ.5) GO TO 3
51       BEKEKA=BB
52       RETURN
53     4 CONTINUE
54       BEKEKA=AA+BB
55       RETURN
56     3 CONTINUE
57       AN=BNKEKA(2,TO,AMSS,SQAMSS)
58       A =BKEKA (2,TO,AMSS)
59       EXTOA=0.D0
60       IF(TO.LT.5.D0*A) EXTOA=EXP(-TO/A)
61       TNKAV=A*(1.D0-(TO/A+1.D0)*EXTOA)/(1.D0-EXTOA)
62       CC=TNKAV*AN
63       IF(IX.EQ.5) GO TO 5
64       BEKEKA=CC
65       RETURN
66     5 CONTINUE
67       BEKEKA=AA+BB+CC
68       RETURN
69       END