5 * Revision 1.1 2000/07/11 18:24:56 fca
6 * Coding convention corrections + few minor bug fixes
8 * Revision 1.2 1999/07/01 14:45:34 fca
9 * Modifications to allow Cherenkov transport
11 * Revision 1.1 1999/06/03 16:38:16 fca
12 * First version of gtreve_root, special version of gtreve for AliRoot to be
15 * Revision 1.1.1.1 1999/05/18 15:55:21 fca
18 * Revision 1.1.1.1 1995/10/24 10:21:45 cernlib
22 #include "geant321/pilot.h"
23 *CMZ : 3.21/03 07/10/94 18.07.13 by S.Giani
27 C. ******************************************************************
31 C. * Controls tracking of all particles belonging to the current *
34 C. * Called by : GUTREV, called by GTRIG *
35 C. * Authors : R.Brun, F.Bruyant *
37 C. ******************************************************************
39 #include "geant321/gcbank.inc"
40 #include "geant321/gcflag.inc"
41 #include "geant321/gckine.inc"
42 #include "geant321/gcking.inc"
43 #include "geant321/gcnum.inc"
44 #include "geant321/gcstak.inc"
45 #include "geant321/gctmed.inc"
46 #include "geant321/gctrak.inc"
47 #include "geant321/gcunit.inc"
48 #include "geant321/sckine.inc"
50 EQUIVALENCE (UBUF(1),WS(1))
52 DIMENSION PMOM(3),VPOS(3),VPOLA(3)
54 C. ------------------------------------------------------------------
58 * Kick start the creation of the vertex
66 CALL GSVERT(VPOS,0,0,UBUF,0,NVTX)
67 CALL GSKINE(PMOM,IPART,NVTX,UBUF,0,NT)
71 CALL RXGTRAK(MTRACK,IPART,PMOM,E,VPOS,VPOLA,TTOF)
75 IF(MTRACK.LE.MPRIMA) THEN
77 C --- Output root hits tree only for each primary MTRACK
82 IF(ISWIT(4).GT.0) THEN
83 IF(ISWIT(4).EQ.1.OR.MOD(MTRACK,ISWIT(4)).EQ.0) THEN
84 WRITE(CHMAIL,10200) MTRACK
90 IF(MTRACK.LE.0) GOTO 999
91 ITRTYP = NINT(Q(LQ(JPART-IPART)+6))
93 * This is a cherenkov photon, more complicated...
95 XPHOT(7,1) = SQRT(VPOLA(1)**2+VPOLA(2)**2+VPOLA(3)**2)
97 XPHOT(KK ,1) = VPOS(KK)
98 XPHOT(KK+3,1) = PMOM(KK)/XPHOT(7,1)
99 XPHOT(KK+7,1) = VPOLA(KK)
103 * Just make sure that the track, whatever that is, is NOT transported
104 IQ(LQ(JKINE-1)) = IBSET(IQ(LQ(JKINE-1)),0)
122 * Make sure the track IS transported
123 IQ(LQ(JKINE-1)) = IBCLR(IQ(LQ(JKINE-1)),0)
128 * Normal Gtreve_root code
131 * *** For each vertex in turn ..
134 IF (NT.LE.0) GO TO 40
137 IF (NJTMAX.GT.0) THEN
138 CALL GMEDIA (Q(JV+1), NUMED)
140 WRITE (CHMAIL, 10000) (Q(JV+I), I=1,3)
146 * ** Loop over tracks attached to current vertex
150 IF (BTEST(IQ(LQ(JKINE-ITRA)),0)) GO TO 20
151 CALL GFKINE (ITRA, VERT, PVERT, IPART, IVERT, UBUF, NWBUF)
152 IF (IVERT.NE.IV) THEN
153 WRITE (CHMAIL, 10100) IV, IVERT
157 * * Store current track parameters in stack JSTAK
160 * ** Start tracking phase
161 30 IF (NALIVE.NE.0) THEN
163 * * Pick-up next track in stack JSTAK, if any
164 * * Initialize tracking parameters
166 IF (NUMED.EQ.0) GO TO 30
169 IF (IEOTRI.NE.0) GO TO 999
176 10000 FORMAT (' GTREVE_ROOT : Vertex outside setup, XYZ=',3G12.4)
177 10100 FORMAT (' GTREVE_ROOT : Abnormal track/vertex connection',2I8)
178 10200 FORMAT (' GTREVE_ROOT : Transporting primary track No ',I10)