5 * Revision 1.1.1.1 1995/10/24 10:20:21 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.26 by S.Giani
12 SUBROUTINE GDCHIT (IUSET,IUDET,ITRS,ISYMB,SIZMAX,KDHIT,
15 C. ******************************************************************
17 C. * Draw Calorimetry Hits of track ITRS 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. *
22 C. * The following characters may be chosen : *
23 C. * ISYMB = -1 hardware character (fast), *
24 C. * = 0 crosses X by TVDRAW (default), *
25 C. * (size = SSYMB in cm, default = 0.1), *
26 C. * = 840 characters by HPLSOF *
27 C. * . according to the table p. 25 *
28 C. * . of the HPLOT manual *
29 C. * 853 (size = SSYMB in cm) *
30 C. * (844,854 white, black asterisk * in addition). *
32 C. * SIZMAX is the maximum character size *
34 C. * KDHIT is the hit number selected : the character size *
35 C. * is a function of HITS(KDHIT) and HITMIN and HITMAX are *
39 C. * JH =LQ(JHITS-ISET) *
40 C. * JHD=LQ(JH-IDET) *
41 C. * IQ(JH+IDET)=pointer to the LAST USED word in JHD *
42 C. * Each hit was packed into JHD in the following format: *
43 C. * --Track number ITRA not packed; *
44 C. * --Volume numbers packed; *
45 C. * --Hits transformed and packed. *
47 C. * ==>Called by : <USER>, <GXINT> *
48 C. * Authors : R.Brun, P.Zanarini ********* *
50 C. ******************************************************************
52 #include "geant321/gcbank.inc"
53 #include "geant321/gcdraw.inc"
54 DIMENSION HITS(3,10),ASIZE(10)
55 CHARACTER*4 IUSET,IUDET
57 C. ------------------------------------------------------------------
59 CALL UCTOH('OFF ',IOFF,4,4)
65 IF (JHITS.LE.0) GOTO 140
69 IF (IUSET(1:1).EQ.'*') GOTO 10
70 CALL GLOOK(IUSET,IQ(JSET+1),NSET,ISET)
71 IF (ISET .LE.0) GOTO 140
76 C loop on all selected sets
86 IF (IUDET(1:1).EQ.'*') GOTO 20
87 CALL GLOOK(IUDET,IQ(JS+1),NDET,IDET)
88 IF (IDET .EQ.0) GOTO 130
93 C loop on selected detectors for this set
98 IF (JHD .LE.0) GOTO 120
101 IF (ILAST.EQ.0) GOTO 120
104 NW = IQ(JD+1) + IQ(JD+3) + 1
106 C Now loop on all hits to get their space coordinates
112 C Is this the right track ?
114 IF (ITRS.NE.0 .AND. ITRS.NE.ITRA) GOTO 110
116 C Is THRZ option set on (R-Z projection)
117 C and the cut lateral (vertical or horizontal) ?
119 IF (ITHRZ.NE.IOFF) THEN
120 IF (ICUT.EQ.1.OR.ICUT.EQ.2) ITR3D=-ITRA
125 C Skip words with volume numbers
140 C Get unpacked (first three !) HITS.
141 C Hits origin is shifted. Division by scale factor.
144 IF (NH.LE.2) GOTO 110
147 IF (KDHIT.GT.3.AND.KDHIT.LE.10) THEN
165 50 IF (K+NB.LE.33) GOTO 60
168 60 KHIT = IBITS(IQ(JHD+I+NK),K-1,NB)
172 HITS(IH,MH)= FLOAT(KHIT)/Q(JDH+4*IH) - Q(JDH+4*IH-1)
174 HITKH=FLOAT(KHIT)/Q(JDH+4*IH) - Q(JDH+4*IH-1)
178 C Compute symbol size
180 IF (HITMAX.LE.0) THEN
183 SSYMB=SIZMAX*(HITKH-HITMIN)/HITMAX
184 IF (SSYMB.GT.SIZMAX) SSYMB=SIZMAX
186 C HPLSOF accepts a minimum SIZE of 0.001,
187 C otherwise set SIZE=0.25 : protect here this case
189 IF (SSYMB.LT.0.0011) SSYMB=0.0011
193 C Draw the hits (usually 10 at a time);
194 C flush HITS vector if
195 C --loop on this detector volume is to finish,
196 C --loop on current track is to finish,
197 C --HITS vector is full.
199 IF ((ILAST-I).LT.NW) GOTO 90
201 IF (ITRA.NE.ITRN) GOTO 90
202 IF (MH .NE. 10) GOTO 110
207 CALL GDAHIT(HITS(1,II),HITS(2,II),HITS(3,II),ISYMB,ASIZE(II))
216 C Reset ITR3D to 'standard projection'