5 * Revision 1.2 1999/07/01 14:45:34 fca
6 * Modifications to allow Cherenkov transport
8 * Revision 1.1 1999/06/03 16:38:16 fca
9 * First version of gtreve_root, special version of gtreve for AliRoot to be
12 * Revision 1.1.1.1 1999/05/18 15:55:21 fca
15 * Revision 1.1.1.1 1995/10/24 10:21:45 cernlib
19 #include "geant321/pilot.h"
20 *CMZ : 3.21/03 07/10/94 18.07.13 by S.Giani
24 C. ******************************************************************
28 C. * Controls tracking of all particles belonging to the current *
31 C. * Called by : GUTREV, called by GTRIG *
32 C. * Authors : R.Brun, F.Bruyant *
34 C. ******************************************************************
36 #include "geant321/gcbank.inc"
37 #include "geant321/gcflag.inc"
38 #include "geant321/gckine.inc"
39 #include "geant321/gcking.inc"
40 #include "geant321/gcnum.inc"
41 #include "geant321/gcstak.inc"
42 #include "geant321/gctmed.inc"
43 #include "geant321/gctrak.inc"
44 #include "geant321/gcunit.inc"
45 #include "geant321/sckine.inc"
47 EQUIVALENCE (UBUF(1),WS(1))
49 DIMENSION PMOM(3),VPOS(3),VPOLA(3)
51 C. ------------------------------------------------------------------
55 * Kick start the creation of the vertex
63 CALL GSVERT(VPOS,0,0,UBUF,0,NVTX)
64 CALL GSKINE(PMOM,IPART,NVTX,UBUF,0,NT)
68 CALL RXGTRAK(MTRACK,IPART,PMOM,E,VPOS,VPOLA,TTOF)
72 IF(MTRACK.LE.MPRIMA) THEN
73 IF(ISWIT(4).GT.0.AND.MTRACK.GT.0) THEN
74 IF(ISWIT(4).EQ.1.OR.MOD(MTRACK,ISWIT(4)).EQ.0) THEN
75 WRITE(CHMAIL,10200) MTRACK
80 C --- Output root hits tree only for each primary MTRACK
84 IF(MTRACK.LE.0) GOTO 999
85 ITRTYP = NINT(Q(LQ(JPART-IPART)+6))
87 * This is a cherenkov photon, more complicated...
89 XPHOT(7,1) = SQRT(VPOLA(1)**2+VPOLA(2)**2+VPOLA(3)**2)
91 XPHOT(KK ,1) = VPOS(KK)
92 XPHOT(KK+3,1) = PMOM(KK)/XPHOT(7,1)
93 XPHOT(KK+7,1) = VPOLA(KK)
97 * Just make sure that the track, whatever that is, is NOT transported
98 IQ(LQ(JKINE-1)) = IBSET(IQ(LQ(JKINE-1)),0)
116 * Make sure the track IS transported
117 IQ(LQ(JKINE-1)) = IBCLR(IQ(LQ(JKINE-1)),0)
122 * Normal Gtreve_root code
125 * *** For each vertex in turn ..
128 IF (NT.LE.0) GO TO 40
131 IF (NJTMAX.GT.0) THEN
132 CALL GMEDIA (Q(JV+1), NUMED)
134 WRITE (CHMAIL, 10000) (Q(JV+I), I=1,3)
140 * ** Loop over tracks attached to current vertex
144 IF (BTEST(IQ(LQ(JKINE-ITRA)),0)) GO TO 20
145 CALL GFKINE (ITRA, VERT, PVERT, IPART, IVERT, UBUF, NWBUF)
146 IF (IVERT.NE.IV) THEN
147 WRITE (CHMAIL, 10100) IV, IVERT
151 * * Store current track parameters in stack JSTAK
154 * ** Start tracking phase
155 30 IF (NALIVE.NE.0) THEN
157 * * Pick-up next track in stack JSTAK, if any
158 * * Initialize tracking parameters
160 IF (NUMED.EQ.0) GO TO 30
163 IF (IEOTRI.NE.0) GO TO 999
170 10000 FORMAT (' GTREVE_ROOT : Vertex outside setup, XYZ=',3G12.4)
171 10100 FORMAT (' GTREVE_ROOT : Abnormal track/vertex connection',2I8)
172 10200 FORMAT (' GTREVE_ROOT : Transporting primary track No ',I10)