5 * Revision 1.1 1999/06/03 16:38:16 fca
6 * First version of gtreve_root, special version of gtreve for AliRoot to be
9 * Revision 1.1.1.1 1999/05/18 15:55:21 fca
12 * Revision 1.1.1.1 1995/10/24 10:21:45 cernlib
16 #include "geant321/pilot.h"
17 *CMZ : 3.21/03 07/10/94 18.07.13 by S.Giani
19 SUBROUTINE GTREVE_ROOT
21 C. ******************************************************************
25 C. * Controls tracking of all particles belonging to the current *
28 C. * Called by : GUTREV, called by GTRIG *
29 C. * Authors : R.Brun, F.Bruyant *
31 C. ******************************************************************
33 #include "geant321/gcbank.inc"
34 #include "geant321/gcflag.inc"
35 #include "geant321/gckine.inc"
36 #include "geant321/gcking.inc"
37 #include "geant321/gcnum.inc"
38 #include "geant321/gcstak.inc"
39 #include "geant321/gctmed.inc"
40 #include "geant321/gctrak.inc"
41 #include "geant321/gcunit.inc"
42 #include "geant321/sckine.inc"
44 EQUIVALENCE (UBUF(1),WS(1))
46 DIMENSION PMOM(3),VPOS(3),VPOLA(3)
48 C. ------------------------------------------------------------------
52 * Kick start the creation of the vertex
60 CALL GSVERT(VPOS,0,0,UBUF,0,NVTX)
61 CALL GSKINE(PMOM,IPART,NVTX,UBUF,0,NT)
65 CALL RXGTRAK(MTRACK,IPART,PMOM,E,VPOS,VPOLA,TTOF)
69 IF(MTRACK.LE.MPRIMA) THEN
70 IF(ISWIT(4).GT.0.AND.MTRACK.GT.0) THEN
71 IF(ISWIT(4).EQ.1.OR.MOD(MTRACK,ISWIT(4)).EQ.0) THEN
72 WRITE(CHMAIL,10200) MTRACK
77 C --- Output root hits tree only for each primary MTRACK
81 IF(MTRACK.LE.0) GOTO 999
82 ITRTYP = NINT(Q(LQ(JPART-IPART)+6))
84 * This is a cherenkov photon, more complicated...
86 XPHOT(7,1) = SQRT(VPOLA(1)**2+VPOLA(2)**2+VPOLA(3)**2)
88 XPHOT(KK ,1) = VPOS(KK)
89 XPHOT(KK+3,1) = PMOM(KK)/XPHOT(7,1)
90 XPHOT(KK+7,1) = VPOLA(KK)
94 * Just make sure that the track, whatever that is, is NOT transported
95 IQ(LQ(JKINE-1)) = IBSET(IQ(LQ(JKINE-1)),0)
113 * Make sure the track IS transported
114 IQ(LQ(JKINE-1)) = IBCLR(IQ(LQ(JKINE-1)),0)
119 * Normal Gtreve_root code
122 * *** For each vertex in turn ..
125 IF (NT.LE.0) GO TO 40
128 IF (NJTMAX.GT.0) THEN
129 CALL GMEDIA (Q(JV+1), NUMED)
131 WRITE (CHMAIL, 10000) (Q(JV+I), I=1,3)
137 * ** Loop over tracks attached to current vertex
141 IF (BTEST(IQ(LQ(JKINE-ITRA)),0)) GO TO 20
142 CALL GFKINE (ITRA, VERT, PVERT, IPART, IVERT, UBUF, NWBUF)
143 IF (IVERT.NE.IV) THEN
144 WRITE (CHMAIL, 10100) IV, IVERT
148 * * Store current track parameters in stack JSTAK
151 * ** Start tracking phase
152 30 IF (NALIVE.NE.0) THEN
154 * * Pick-up next track in stack JSTAK, if any
155 * * Initialize tracking parameters
157 IF (NUMED.EQ.0) GO TO 30
160 IF (IEOTRI.NE.0) GO TO 999
167 10000 FORMAT (' GTREVE_ROOT : Vertex outside setup, XYZ=',3G12.4)
168 10100 FORMAT (' GTREVE_ROOT : Abnormal track/vertex connection',2I8)
169 10200 FORMAT (' GTREVE_ROOT : Transporting primary track No ',I10)