5 * Revision 1.1.1.1 1995/10/24 10:20:30 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.27 by S.Giani
12 SUBROUTINE GKHITS (IUSET,IUDET,EPSILO)
14 C. ******************************************************************
16 C. * Prints the hit picked (using the graphics cursor) *
17 C. * from all the hits of all tracks in detector IUDET *
18 C. * of set IUSET, in case that the spatial coordinates *
19 C. * of the hits had been stored as the first three words *
20 C. * in the argument vector of GSAHIT. *
21 C. * If the character typed to pick is 'K' or 'k' then the *
22 C. * kinematics of the corresponding track is also printed. *
23 C. * The picking is repeated until the character typed is *
25 C. * EPSILO is the pick aperture, i.e. the first hit that *
26 C. * falls into the square centered at U0,V0 (the pick point) *
27 C. * with half length EPSILO is kept. *
28 C. * If EPSILO is negative then its absolute value is taken *
29 C. * and in addition the pick square is drawn. *
30 C. * If EPSILO is zero there is no pick aperture and over all *
31 C. * the hits the one nearest to the pick point is taken. *
33 C. * ==>Called by : <USER>, <GXINT> *
34 C. * Authors : R.Brun, W.Gebel, P.Zanarini ********* *
36 C. ******************************************************************
38 #include "geant321/gcbank.inc"
39 #include "geant321/gcdraw.inc"
40 #include "geant321/gcunit.inc"
44 CHARACTER*4 IUSET,IUDET,KIUSET,KIUDET
46 C. ------------------------------------------------------------------
48 CALL UCTOH('OFF ',IOFF,4,4)
56 CALL GDCURS(U0,V0,KCHAR)
57 IF (KCHAR.EQ.0) GO TO 160
59 IF (JHITS.LE.0) GOTO 160
63 IF (IUSET(1:1).EQ.'*') GOTO 20
64 CALL GLOOK(IUSET,IQ(JSET+1),NSET,ISET)
65 IF (ISET .LE.0) GOTO 160
93 C loop on all selected sets
104 IF (IUDET(1:1).EQ.'*') GOTO 30
105 CALL GLOOK(IUDET,IQ(JS+1),NDET,IDET)
106 IF (IDET .EQ.0) GOTO 140
111 C loop on selected detectors for this set
117 IF (JHD .LE.0) GOTO 130
120 IF (ILAST.EQ.0) GOTO 130
123 NW = IQ(JD+1) + IQ(JD+3) + 1
125 C Now loop on all hits to get their space coordinates
133 C Is THRZ option set on (R-Z projection)
134 C and the cut lateral (vertical or horizontal) ?
136 IF (ITHRZ.NE.IOFF) THEN
137 IF (ICUT.EQ.1.OR.ICUT.EQ.2) ITR3D=-ITRA
142 C Skip words with volume numbers
157 C Get unpacked (first three !) HITS.
158 C Hits origin is shifted. Division by scale factor.
161 IF (NH.LE.2) GOTO 120
174 60 IF (K+NB.LE.33) GOTO 70
177 70 KHIT = IBITS(IQ(JHD+I+NK),K-1,NB)
180 HITS(IH,MH)= FLOAT(KHIT)/Q(JDH+4*IH) - Q(JDH+4*IH-1)
183 C Scan the hits (usually 10 at a time);
184 C flush HITS vector if
185 C --loop on this detector volume is to finish,
186 C --loop on current track is to finish,
187 C --HITS vector is full.
189 IF ((ILAST-I).LT.NW) GOTO 100
191 IF (ITRA.NE.ITRN) GOTO 100
192 IF (MH .NE. 10) GOTO 120
196 CALL GDFR3D(HITS(1,1),MH,U,V)
200 IF (EPSILO.NE.0) THEN
201 IF (U(IP).LT.U0-EPSU) GO TO 110
202 IF (U(IP).GT.U0+EPSU) GO TO 110
203 IF (V(IP).LT.V0-EPSV) GO TO 110
204 IF (V(IP).GT.V0+EPSV) GO TO 110
208 CALL UHTOC(IQ(JSET+ISET),4,KIUSET,4)
209 CALL UHTOC(IQ(JS+IDET) ,4,KIUDET,4)
213 DIST=(U(IP)-U0)*(U(IP)-U0)+(V(IP)-V0)*(V(IP)-V0)
214 IF (DIST.LT.DISTPK) THEN
219 CALL UHTOC(IQ(JSET+ISET),4,KIUSET,4)
220 CALL UHTOC(IQ(JS+IDET) ,4,KIUDET,4)
235 IF (EPSILO.EQ.0) GO TO 150
242 C Restart for another pick operation
250 C Highlight the picked hit
252 UDELTA=0.05*PLTRNX/20.
253 VDELTA=0.05*PLTRNY/20.
266 C Print parameters of the picked hit
269 IF (IPKHIT.GT.0) CALL GPHITS(KIUSET,KIUDET)
273 C Restart for another pick operation
279 C Reset ITR3D to 'standard projection'
284 1000 FORMAT (' GKHITS: No hit picked')