5 * Revision 1.1.1.1 1995/10/24 10:21:12 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.20 by S.Giani
12 SUBROUTINE GSDETH(IUSET,IUDET,NH,NAMESH,NBITSH,ORIG,FACT)
14 C. ******************************************************************
16 C. * Handling sensitive DETector Hit parameters *
17 C. * ------------------------------------------ *
19 C. * Defines hit parameters for detector IUDET of set IUSET. *
20 C. * IUSET user set identifier *
21 C. * IUDET user detector identifier *
22 C. * NH number of elements per hit *
23 C. * NAMESH the NH variable names for the hit elements *
24 C. * NBITSH the NH bit numbers for packing the variable values *
25 C. * ORIG The quantity packed in the structure JHITS for the *
26 C. * Ith variable is a positive integer with NBITSH(I) *
27 C. * bits and such that *
28 C. * FACT IVAR(I) = (VAR(I)+ORIG(I))*FACT(I) *
29 C. * The routine is used at initialisation time once the *
30 C. * geometrical volumes have been defined to describe the hit *
31 C. * elements and the way to do packing in memory and on tape. *
33 C. * Assume an electromagnetic calorimeter ECAL divided into 40 *
34 C. * PHI sections called EPHI. Each EPHI division is again *
35 C. * divided along the Z axis in 60 objects called EZRI. Each *
36 C. * EZRI is finally divided into 4 lead glass blocks called *
38 C. * The geometrical information to describe one hit will then *
40 C. * - The EPHI section number (between 1 and 40) *
41 C. * - The EZRI division number (between 1 and 60) *
42 C. * - The BLOC number (1 to 4) *
43 C. * The variables we want to store for each hit are for example: *
44 C. * - X x position of the hit in the lead glass block *
47 C. * - E energy of the particle at this point *
48 C. * - ELOS the energy deposited into this block *
49 C. * Example of one hit in that scheme: *
58 C. * The FORTRAN coding to define the set/det/hits information *
60 C. * DIMENSION NAMESV(3),NBITSV(3) *
61 C. * DIMENSION NAMESH(5),NBITSH(5),ORIG(5),FACT(5) *
62 C. * DATA NAMESV/'EPHI','EZRI','BLOC'/ *
63 C. * DATA NBITSV/6,6,3/ *
64 C. * DATA NAMESH/'X ','Y ','Z ','E ','ELOS'/ *
65 C. * DATA NBITSH/5*16/ *
66 C. * DATA ORIG/3*1000.,0.,0./ *
67 C. * DATA FACT/3*10.,2*100./ *
68 C. * CALL GSDET ('ECAL','BLOC',3,NAMESV,NBITSV,2,100,100, *
70 C. * CALL GSDETH('ECAL','BLOC',5,NAMESH,NBITSH,ORIG,FACT) *
71 C. * Returns the hit parameters for detector IUDET of set *
72 C. * IUSET. All arguments are explained above. *
75 C. * JS = LQ(JSET-ISET) *
76 C. * JD = LQ(JS-IDET) *
78 C. * IQ(JDH+4*I-3)= NAMESH(I) *
79 C. * IQ(JDH+4*I-2)= NBITSH(I) *
80 C. * Q(JDH+4*I-1)= ORIG(I) *
81 C. * Q(JDH+4*I) = FACT(I) *
83 C. * ==>Called by : <USER>, UGEOM *
84 C. * Author R.Brun ********* *
86 C. ******************************************************************
88 #include "geant321/gcbank.inc"
89 #include "geant321/gcunit.inc"
90 #include "geant321/gcmzfo.inc"
92 DIMENSION NBITSH(1),ORIG(1),FACT(1),NAMH(NHEMX)
93 CHARACTER*4 NAMESH(1),IUSET,IUDET
94 EQUIVALENCE (WS(1),NAMH(1))
96 C. ------------------------------------------------------------------
100 IF(NSET.LE.0)GO TO 90
101 CALL GLOOK(IUSET,IQ(JSET+1),NSET,ISET)
102 IF(ISET.LE.0)GO TO 90
105 IF(NDET.LE.0)GO TO 90
106 CALL GLOOK(IUDET,IQ(JS+1),NDET,IDET)
107 IF(IDET.LE.0)GO TO 90
110 CALL MZBOOK(IXCONS,JDH,JD,-1,'SJDH',0,0,4*NH,IOSJDH,0)
114 CALL UCTOH(NAMESH,NAMH,4,4*NH)
120 IQ(JDH+4*I-3)=NAMH(I)
124 IF(FACT(I).LE.0.)Q(JDH+4*I)=1.
143 90 WRITE(CHMAIL,1000)IUSET,IUDET
145 1000 FORMAT(' ***** GSDETH ERROR FOR SET ',A4,' OR DETECTOR ',A4)