This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gkine / glund.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:18  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.21  by  S.Giani
11 *-- Author :
12       SUBROUTINE GLUND
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *        GEANT INTERFACE TO THE LUND MONTE-CARLO                 *
17 C.    *                                                                *
18 C.    *  FOR TECHNICAL DETAILS OF THE LUND MONTE CARLO,SEE             *
19 C.    *  1. THE LUND MONTE CARLO FOR JET FRAGMENTATION - T.SJOSTRAND   *
20 C.    *     LU TP 82-3  and COMPUTER PHYSICS COMMUNICATION 27(1982)243 *
21 C.    *  2. THE LUND MONTE CARLO FOR E+E- JET PHYSICS  - T.SJOSTRAND   *
22 C.    *     LU TP 82-7 and COMPUTER PHYSICS COMMUNICATION 28(1983)229  *
23 C.    *                                                                *
24 C.    *    The parameters to use the LUND interface are set in GLUNDI  *
25 C.    *    They can be changed by data cards (see GLUNDI)              *
26 C.    *                                                                *
27 C.    *    ==>Called by : <USER>, GUKINE                               *
28 C.    *       Author    R.Hemingway  *********                         *
29 C.    *       modified by R.Brun  18/11/85 **                          *
30 C.    *                                                                *
31 C.    ******************************************************************
32 C.
33       DIMENSION VERT(3)
34 #include "geant321/gcbank.inc"
35 #include "geant321/gcflag.inc"
36 #include "geant321/gcpush.inc"
37 #include "geant321/lujets.inc"
38 #include "geant321/gclund.inc"
39       PARAMETER (NSEL=44)
40       DIMENSION IPLUND(NSEL)
41       REAL      PGEANT(3),BUF(1)
42       EQUIVALENCE (BUF,K)
43       DATA IPLUND/
44      +    22,   -11,    11,    12,   -13,    13,   111,   211,
45      +  -211,   130,   321,  -321,  2112,  2212, -2212,   310,
46      +   221,  3122,  3222,  3212,  3112,  3322,  3312,  3334,
47      + -2112, -3122, -3112, -3212, -3222, -3322, -3312, -3334,
48      +   -15,    15,   411,  -411,   421,  -421,   431,  -431,
49      +  4122,    24,   -24,    23/
50 *.
51 *.    ------------------------------------------------------------------
52 *.
53       IF (IFINIT(3).EQ.0)  CALL GLUNDI
54 *
55       CALL LUEEVT(IFLUND,ECLUND)
56 *
57       NCVERT = 10
58       NCKINE = N+10
59       NCJXYZ = NCKINE
60       NPVERT =  5
61       NPKINE = 10
62       NPJXYZ = 10
63 *
64       VERT(1)   = 0.
65       VERT(2)   = 0.
66       VERT(3)   = 0.
67       NWBUF=2+10*N
68       CALL GSVERT(V,0,0,BUF,NWBUF,NVTX)
69       IF (NVTX.GT.0) THEN
70          DO 20 I = 1,N
71             IF(K(I,1).GE.1.AND.K(I,1).LE.10) THEN
72                DO 10 IGE=1, NSEL
73                   IF(IPLUND(IGE).EQ.K(I,2)) THEN
74                      PGEANT(1)=P(I,1)
75                      PGEANT(2)=P(I,2)
76                      PGEANT(3)=P(I,3)
77                      CALL GSKINE(PGEANT,IGE,NVTX,BUF,0,NT)
78                      GOTO 20
79                   ENDIF
80    10          CONTINUE
81             ENDIF
82    20    CONTINUE
83 *
84          JV = LQ(JVERTX-1)
85          JUV = LQ(JV-1)
86          Q(JUV+1)= 527.0
87          Q(JUV+2)= N
88 *
89 *     Copy the LUND record into a bank of real variables.
90 *
91          DO 30 NP=1, N
92             Q(JUV+2    +NP) = K(NP,1)
93             Q(JUV+2+  N+NP) = K(NP,2)
94             Q(JUV+2+2*N+NP) = K(NP,3)
95             Q(JUV+2+3*N+NP) = K(NP,4)
96             Q(JUV+2+4*N+NP) = K(NP,5)
97             Q(JUV+2+5*N+NP) = P(NP,1)
98             Q(JUV+2+6*N+NP) = P(NP,2)
99             Q(JUV+2+7*N+NP) = P(NP,3)
100             Q(JUV+2+8*N+NP) = P(NP,4)
101             Q(JUV+2+9*N+NP) = P(NP,5)
102    30    CONTINUE
103 *
104       ENDIF
105       END