This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / fluka / fkvert.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:06  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.45  by  S.Giani
11 *-- Author :
12 *=== vertex ===========================================================*
13 *
14       SUBROUTINE FKVERT(IT,LT,LL,KFA,E0,IV,RE,KFR1,KFR2,AME,IOPT)
15  
16 #include "geant321/dblprc.inc"
17 #include "geant321/dimpar.inc"
18 #include "geant321/iounit.inc"
19       REAL RNDM(2)
20 C     CHOICE OF THE VERTEX
21       DIMENSION RE(*),KFR1(*),KFR2(*),IV(*)
22 C     WAEHLT PASSENDEN VERTEX IV AUS
23        IF(LT.EQ.1) WRITE(LUNOUT,288)IT,LT,LL,KFA,E0,AME,IOPT
24   288 FORMAT (4I5,2E12.4,I5,' VERTEX IT,LT,LL,KFA,E0,AME')
25       PDB=0.8D0
26       IVA=1
27       I=IT
28       J=IT-1
29       IVX=IVA
30       IF(IOPT.EQ.2) IVX=2
31       IF(IOPT.EQ.4.AND.KFA.GT.6.AND.LL.EQ.0) IVX=2
32       IF(IOPT.EQ.4.AND.KFA.LE.6.AND.LL.EQ.1) IVX=2
33       IF(IOPT.EQ.5) IVX=2
34       IF(I.GT.1)IVX=IV(J)
35       IF(LL.EQ.1.AND.I.GT.1)IVX=IV(J)-5
36       CALL GRNDM(RNDM,2)
37       Z=RNDM(1)
38       Y=RNDM(2)
39       GO TO (1,2,1,2,2),IVX
40     1 IVX=1
41       IF(Z.GE.AME) IVX=2
42       GO TO 20
43     2 IVX=3
44       IF(Z.GT.PDB) IVX=4
45       IF(Z.GT.PDB.AND.Y.LE.0.5D0)  IVX=5
46       GO TO 20
47    20 CONTINUE
48       IF(LL.EQ.1)IVX=IVX+5
49       IV(I)=IVX
50       IF(LT.EQ.0)GO TO 60
51 C     AUSDRUCKEN
52       IF(I.EQ.1)GO TO 30
53       WRITE(LUNOUT,50)IV(J),IV(I),LL
54       GO TO 40
55    30 WRITE(LUNOUT,50)IVA,IV(I),LL
56    40 CONTINUE
57    50 FORMAT(1H0,15HIV(J),IV(I),LL=,3I5)
58    60 CONTINUE
59       RETURN
60       END