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