This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gtrak / gsxyz.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:43  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.24  by  S.Giani
11 *-- Author :
12       SUBROUTINE GSXYZ
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Store space point VECT in banks JXYZ                     *
17 C.    *                                                                *
18 C.    *    ==>Called by : <USER>                                       *
19 C.    *       Authors    R.Brun, F.Carena  *********                   *
20 C.    *                                                                *
21 C.    ******************************************************************
22 C.
23 #include "geant321/gcbank.inc"
24 #include "geant321/gcnum.inc"
25 #include "geant321/gctrak.inc"
26 #include "geant321/gcpush.inc"
27 #include "geant321/gckine.inc"
28 C.
29 C.    ------------------------------------------------------------------
30 C.
31       IF(JXYZ.EQ.0)THEN
32 C
33 C               Create mother bank JXYZ
34 C
35          CALL MZBOOK(IXDIV,JXYZ,JXYZ,1,'JXYZ',NCKINE,NCKINE,0,3,0)
36          IQ(JXYZ-5)=0
37       ENDIF
38 C
39       NXYZ=IQ(JXYZ-2)
40       IF(ITRA.GT.NXYZ)THEN
41          NPUSH=MAX(10,ITRA-NXYZ)
42          CALL MZPUSH(IXDIV,JXYZ,NPUSH,0,'I')
43       ENDIF
44 C
45 C              Create bank to store points for primary track ITRA
46 C
47       JX=LQ(JXYZ-ITRA)
48       IF(JX.EQ.0)THEN
49          CALL MZBOOK(IXDIV,JX,JXYZ,-ITRA,'JXYZ',0,0,NCJXYZ,3,0)
50          Q(JX+1)=NCJXYZ-2.
51          Q(JX+2)=3.
52          IQ(JX)=NTMULT
53 C
54 C              Check if there is enough space to store current point
55 C
56       ELSE
57          NFREE=Q(JX+1)
58          IF(NFREE.LE.6)THEN
59             CALL MZPUSH(IXDIV,JX,0,NPJXYZ,'I')
60             JX=LQ(JXYZ-ITRA)
61             Q(JX+1)=Q(JX+1)+NPJXYZ
62          ENDIF
63 C
64          IF(NTMULT.NE.IQ(JX))THEN
65             IQ(JX)=NTMULT
66             IPOINT=JX+Q(JX+2)
67             IF(Q(IPOINT).NE.0.) THEN
68                Q(JX+2)=Q(JX+2)+3.*Q(IPOINT)+2.
69                Q(JX+1)=Q(JX+1)-2.
70             ENDIF
71          ENDIF
72       ENDIF
73 C
74       IPOINT=JX+Q(JX+2)
75       JP=IPOINT+3.*Q(IPOINT)+1.
76       Q(IPOINT)=Q(IPOINT)+1.
77       Q(IPOINT+1)=IPART
78       DO 10 I=1,3
79   10  Q(JP+I)=VECT(I)
80       Q(JX+1)=Q(JX+1)-3.
81 C
82       END