]>
Commit | Line | Data |
---|---|---|
fe4da5cc | 1 | * |
2 | * $Id$ | |
3 | * | |
4 | * $Log$ | |
5 | * Revision 1.1.1.1 1995/10/24 10:21:11 cernlib | |
6 | * Geant | |
7 | * | |
8 | * | |
9 | #include "geant321/pilot.h" | |
10 | *CMZ : 3.21/02 29/03/94 15.41.20 by S.Giani | |
11 | *-- Author : | |
12 | SUBROUTINE GSDETD(IUSET,IUDET,ND,NAMESD,NBITSD) | |
13 | C. | |
14 | C. ****************************************************************** | |
15 | C. * * | |
16 | C. * Handling sensitive DETector Digitisation parameters * | |
17 | C. * --------------------------------------------------- * | |
18 | C. * * | |
19 | C. * Defines digitisation parameters for detector IUDET of set * | |
20 | C. * IUSET. * | |
21 | C. * IUSET user set identifier * | |
22 | C. * IUDET user detector identifier * | |
23 | C. * ND number of elements per digitisation * | |
24 | C. * NAMESD the ND variable names for the digitisation * | |
25 | C. * elements * | |
26 | C. * NBITSD the ND bit numbers for packing the variable * | |
27 | C. * values. * | |
28 | C. * The routine is used at initialisation time once the * | |
29 | C. * geometrical volumes have been defined to describe the * | |
30 | C. * digitisation elements and the way to do packing in memory * | |
31 | C. * and on tape. Let us use the same example as in GSDETH. The * | |
32 | C. * non geometrical information we want to store for each * | |
33 | C. * digitisation is for example: * | |
34 | C. * - ADC pulse height in a lead glass block. * | |
35 | C. * Example of one digitisation in that scheme: * | |
36 | C. * EPHI 12 * | |
37 | C. * EZRI 41 * | |
38 | C. * BLOC 3 * | |
39 | C. * ADC 789 * | |
40 | C. * The FORTRAN coding to define the digitisation information * | |
41 | C. * could be: * | |
42 | C. * DATA NAMESD/'ADC '/ * | |
43 | C. * DATA NBITSD/16/ * | |
44 | C. * CALL GSDETD('ECAL','BLOC',1,NAMESD,NBITSD) * | |
45 | C. * Returns the digitisation parameters for detector IUDET of * | |
46 | C. * set IUSET. All arguments as explained in GSDETD. * | |
47 | C.. * * | |
48 | C. * JS = LQ(JSET-ISET) * | |
49 | C. * JD = LQ(JS-IDET) * | |
50 | C. * JDD= LQ(JD-2) * | |
51 | C. * IQ(JDD+2*I-1)=NAMESD(I) * | |
52 | C. * IQ(JDD+2*I) =NBITSD(I) * | |
53 | C. * * | |
54 | C. * ==>Called by : <USER>, UGEOM * | |
55 | C. * Author R.Brun ********* * | |
56 | C. * * | |
57 | C. ****************************************************************** | |
58 | C. | |
59 | #include "geant321/gcbank.inc" | |
60 | #include "geant321/gcunit.inc" | |
61 | #include "geant321/gcmzfo.inc" | |
62 | PARAMETER (NDEMX=100) | |
63 | DIMENSION NBITSD(1),NAMD(NDEMX) | |
64 | CHARACTER*4 NAMESD(1),IUSET,IUDET | |
65 | EQUIVALENCE (WS(1),NAMD(1)) | |
66 | C. | |
67 | C. ------------------------------------------------------------------ | |
68 | C. | |
69 | IF(JSET.LE.0)GO TO 90 | |
70 | NSET=IQ(JSET-1) | |
71 | IF(NSET.LE.0)GO TO 90 | |
72 | CALL GLOOK(IUSET,IQ(JSET+1),NSET,ISET) | |
73 | IF(ISET.LE.0)GO TO 90 | |
74 | JS=LQ(JSET-ISET) | |
75 | NDET=IQ(JS-1) | |
76 | IF(NDET.LE.0)GO TO 90 | |
77 | CALL GLOOK(IUDET,IQ(JS+1),NDET,IDET) | |
78 | IF(IDET.LE.0)GO TO 90 | |
79 | JD=LQ(JS-IDET) | |
80 | C | |
81 | CALL MZBOOK(IXCONS,JDD,JD,-2,'SJDD',0,0,2*ND,IOSJDD,0) | |
82 | C | |
83 | NW=0 | |
84 | IF(ND.GT.0)THEN | |
85 | CALL UCTOH(NAMESD,NAMD,4,4*ND) | |
86 | K=32 | |
87 | DO 30 I=1,ND | |
88 | NB=NBITSD(I) | |
89 | IF(NB.LT.0)NB=0 | |
90 | IF(NB.GE.32)NB=0 | |
91 | IQ(JDD+2*I-1)=NAMD(I) | |
92 | IQ(JDD+2*I )=NB | |
93 | IF(NB.LE.0)THEN | |
94 | NW=NW+1 | |
95 | K=32 | |
96 | ELSE | |
97 | K=K+NB | |
98 | IF(K.GT.32)THEN | |
99 | K=NB | |
100 | NW=NW+1 | |
101 | ENDIF | |
102 | ENDIF | |
103 | 30 CONTINUE | |
104 | ENDIF | |
105 | IQ(JD+5)=NW | |
106 | IQ(JD+6)=ND | |
107 | GO TO 99 | |
108 | C | |
109 | C Error | |
110 | C | |
111 | 90 WRITE(CHMAIL,1000)IUSET,IUDET | |
112 | CALL GMAIL(0,0) | |
113 | 1000 FORMAT(' ***** GSDETD ERROR FOR SET ',A4,' OR DETECTOR ',A4) | |
114 | C | |
115 | 99 RETURN | |
116 | END |