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 GKXYZ(EPSILO)
14 C. ******************************************************************
16 C. * Prints the kinematics of the track picked (using the *
17 C. * graphics cursor) in case that the space points of the *
18 C. * track had been stored in the bank JXYZ. *
19 C. * The picking is repeated until the character typed is *
21 C. * EPSILO is the delta angle used for pick, in the sense *
22 C. * that tracks to be considered as possible candidates *
23 C. * must start with a direction in the angular range *
24 C. * between ANG0-EPSILO and ANG0+EPSILO (where ANG0 is the *
25 C. * angle relative to the cursor position). *
26 C. * If EPSILO is zero there is no delta angle concept and *
27 C. * over all the track points the one nearest to the pick *
28 C. * point is taken. *
30 C. * ==>Called by : <USER>, <GXINT> *
31 C. * Author : P.Zanarini ********* *
33 C. ******************************************************************
35 #include "geant321/gcbank.inc"
36 #include "geant321/gcdraw.inc"
37 #include "geant321/gconsp.inc"
38 #include "geant321/gcunit.inc"
47 C. ------------------------------------------------------------------
49 CALL UCTOH('OFF ',IOFF,4,4)
56 CALL GDCURS(U0,V0,KCHAR)
57 IF (KCHAR.EQ.0) GO TO 130
59 IF(JXYZ.LE.0)GO TO 130
64 CALL GDFR3D(XZERO,1,UOR,VOR)
67 IF (VATAN.EQ.0..AND.UATAN.EQ.0.) THEN
72 ANG0=ATAN2(VATAN,UATAN)
74 IF (EPSILO.EQ.0) MAXWS=MAXWS*2
81 EPS=MAX(PLTRNX,PLTRNY)*EPSIL/20.
88 C Track is not (yet) a canditate
96 40 IF(IPOINT.GT.JX+IQ(JX-1))GO TO 90
98 IF(NPOINT.LE.0)GO TO 90
101 IF(IPL.GT.NPOINT)IPL=NPOINT
105 C Is THRZ option set on (R-Z projection)
106 C and the cut lateral (vertical or horizontal) ?
108 IF (ITHRZ.NE.IOFF) THEN
109 IF (ICUT.EQ.1.OR.ICUT.EQ.2) ITR3D=-I
114 IF (EPSILO.EQ.0) GO TO 60
119 CALL GDFR3D(Q(IPOINT+3*IPF-1),2,U,V)
120 CALL GDFR3D(Q(IPOINT+3*NPOINT-1),1,ULAST,VLAST)
122 IF (U0.GE.UOR-EPS.AND.U0.LE.UOR+EPS.AND. V0.GE.VOR-EPS.AND.
123 + V0.LE.VOR+EPS) THEN
125 C Pick point too near the origin
129 ELSE IF (U(1).LT.UOR-EPS.OR.U(1).GT.UOR+EPS.OR. V(1).LT.VOR-
130 + EPS.OR.V(1).GT.VOR+EPS) THEN
132 C First track point does not start near the origin
139 IF (VATAN.EQ.0..AND.UATAN.EQ.0.) THEN
143 ANG=ATAN2(VATAN,UATAN)
146 IF (VATAN.EQ.0..AND.UATAN.EQ.0.) THEN
150 ANGLST=ATAN2(VATAN,UATAN)
151 IF (ANG.GT.(PI-ANGEPS).OR.ANG.LT.(-PI+ANGEPS)) THEN
153 C First track point near the +PI/-PI edge
157 ELSE IF (ANG.GT.ANG0-ANGEPS.AND.ANG.LT.ANG0+ANGEPS) THEN
159 C Pick point inside the pick angle
163 ELSE IF (ANGLST.LT.ANG-ANGEPS.OR.ANGLST.GT.ANG+ANGEPS)
166 C Track is too curved
175 C Skip completely the track ?
177 IF (IFL.NE.1) GO TO 90
181 IF (IBIAS+3*NP.GE.MAXWS) THEN
186 CALL GDFR3D(Q(IPOINT+3*IPF-1),NP,U,V)
197 IF(IPF.LT.NPOINT)GO TO 50
198 80 IPOINT=IPOINT+3.*Q(IPOINT)+2.
216 DIST=(UPK-U0)*(UPK-U0)+(VPK-V0)*(VPK-V0)
217 IF (DIST.LT.DISTPK) THEN
223 IF (DISTPK.GT.DISMIN) THEN
238 C Draw the picked track point
240 UDELTA=0.05*PLTRNX/20.
241 VDELTA=0.05*PLTRNY/20.
254 C Print kinematics of the picked track
260 C Restart for another pick operation
266 C Reset ITR3D to 'standard projection'
271 1900 FORMAT (' GKXYZ: Work space doubled - Now is',I6)
272 2000 FORMAT (' GKXYZ: No track picked')
273 2100 FORMAT (' GKXYZ: Pick angle doubled - Now is',F5.2)
274 2200 FORMAT (' GKXYZ: Primary vertex: no track picked')