1 |
* |
2 |
* $Id$ |
3 |
* |
4 |
* $Log$ |
5 |
* |
6 |
*CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola |
7 |
*CMZ : 2.00/00 03/03/2000 15.39.06 by Francesco Cafagna |
8 |
*CMZ : 1.02/00 22/10/99 16.17.58 by Francesco Cafagna |
9 |
*CMZ : 1.01/00 21/05/96 17.33.38 by Francesco Cafagna |
10 |
*CMZ : 1.00/02 04/04/96 16.08.24 by Francesco Cafagna |
11 |
*-- Author : Francesco Cafagna 23/02/96 |
12 |
SUBROUTINE GPDCAT |
13 |
************************************************************************ |
14 |
* * |
15 |
* To perform CAT digitization * |
16 |
* * |
17 |
* Called by: GUDIGI * |
18 |
* Author: Francesco Cafagna, 23/02/96 12.50.38 * |
19 |
* * |
20 |
************************************************************************ |
21 |
#include "gcunit.inc" |
22 |
#include "gpphit.inc" |
23 |
PARAMETER (NH=NHCAT,NHM=NHMCAT,NVOL=3) |
24 |
#include "gprhit.inc" |
25 |
#include "gpcat.inc" |
26 |
#include "gpsed.inc" |
27 |
* |
28 |
INTEGER IS,ID,NV,NVM,NNHM |
29 |
CHARACTER*4 CSET |
30 |
* |
31 |
* |
32 |
* Vector zeroed |
33 |
* |
34 |
CALL VZERO(ICAT ,NHM) |
35 |
CALL VZERO(XCAT ,NHM) |
36 |
CALL VZERO(YCAT ,NHM) |
37 |
CALL VZERO(ZCAT ,NHM) |
38 |
CALL VZERO(XOCAT,NHM) |
39 |
CALL VZERO(YOCAT,NHM) |
40 |
CALL VZERO(ZOCAT,NHM) |
41 |
CALL VZERO(ERCAT,NHM) |
42 |
CALL VZERO(TIMECAT,NHM) |
43 |
CALL VZERO(PACAT,NHM) |
44 |
CALL VZERO(ICATPAR,NHM) |
45 |
CALL VZERO(P0CAT,NHM) |
46 |
CALL VZERO(NUMD ,NVOL) |
47 |
* |
48 |
* Start with tof top |
49 |
* |
50 |
NV = NVOL |
51 |
NVM= NVMAX |
52 |
IS = ISCAT |
53 |
ID = IDCATL |
54 |
CSET = 'CAT ' |
55 |
IT = -1 |
56 |
* |
57 |
* Check on the volume level |
58 |
* |
59 |
IF (NV.GT.NVM) THEN |
60 |
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, |
61 |
+ IDRUN,IDEVT |
62 |
CALL GMAIL(1,0) |
63 |
GO TO 10 |
64 |
ENDIF |
65 |
CALL VZERO(VHITS,NH*NHM) |
66 |
CALL VZERO(ITRA ,NHM) |
67 |
CALL VZERO(NUMBV,NVOL*NHM) |
68 |
NHITS = -1 |
69 |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1, |
70 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
71 |
* |
72 |
* If there was a problem in GPRHIT then exit |
73 |
* |
74 |
IF(NHITS.LT.0) THEN |
75 |
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NHITS,NHM, |
76 |
+ IDRUN,IDEVT |
77 |
CALL GMAIL(1,0) |
78 |
GO TO 10 |
79 |
ENDIF |
80 |
* |
81 |
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
82 |
* |
83 |
* |
84 |
* Fill the CWN common |
85 |
* |
86 |
NTHCAT = NHITS |
87 |
DO I=1,NHITS |
88 |
ICAT(I) = NUMBV(NVCAT,I) |
89 |
#if defined(GPAMELA_INTER) |
90 |
XINCAT(I) = 2*VHITS(1,I)-VHITS(4,I) |
91 |
YINCAT(I) = 2*VHITS(2,I)-VHITS(5,I) |
92 |
ZINCAT(I) = 2*VHITS(3,I)-VHITS(6,I) |
93 |
#endif |
94 |
#if !defined(GPAMELA_INTER) |
95 |
XINCAT(I) = VHITS(1,I) |
96 |
YINCAT(I) = VHITS(2,I) |
97 |
ZINCAT(I) = VHITS(3,I) |
98 |
#endif |
99 |
XOUTCAT(I) = VHITS(4,I) |
100 |
YOUTCAT(I) = VHITS(5,I) |
101 |
ZOUTCAT(I) = VHITS(6,I) |
102 |
ERELCAT(I) = VHITS(7,I) |
103 |
TIMECAT(I)= VHITS(8,I) |
104 |
PATHCAT(I) = VHITS(9,I) |
105 |
IPARCAT(I) = VHITS(10,I) |
106 |
P0CAT(I) = VHITS(11,I) |
107 |
ENDDO |
108 |
* |
109 |
* Next detector |
110 |
* |
111 |
ID = IDCATT |
112 |
CALL VZERO(VHITS,NH*NHM) |
113 |
CALL VZERO(ITRA ,NHM) |
114 |
CALL VZERO(NUMBV,NVOL*NHM) |
115 |
NHITS = -1 |
116 |
* |
117 |
* Update the max number of hits to be retrived |
118 |
* |
119 |
NNHM = NHM - NTHCAT |
120 |
IF(NNHM.LE.0) THEN |
121 |
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAT,NHM, |
122 |
+ IDRUN,IDEVT |
123 |
CALL GMAIL(1,0) |
124 |
GO TO 10 |
125 |
ENDIF |
126 |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, |
127 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
128 |
* |
129 |
* If there was a problem in GPRHIT then exit |
130 |
* |
131 |
IF(NHITS.LT.0) THEN |
132 |
WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM, |
133 |
+ IDRUN,IDEVT |
134 |
CALL GMAIL(1,0) |
135 |
GO TO 10 |
136 |
ENDIF |
137 |
* |
138 |
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
139 |
* |
140 |
* |
141 |
DO I=1,NHITS |
142 |
NTHCAT = NTHCAT + 1 |
143 |
ICAT(NTHCAT) = 2 + NUMBV(NVCAT,I) |
144 |
#if defined(GPAMELA_INTER) |
145 |
XINCAT(NTHCAT) = 2*VHITS(1,I)-VHITS(4,I) |
146 |
YINCAT(NTHCAT) = 2*VHITS(2,I)-VHITS(5,I) |
147 |
ZINCAT(NTHCAT) = 2*VHITS(3,I)-VHITS(6,I) |
148 |
#endif |
149 |
#if !defined(GPAMELA_INTER) |
150 |
XINCAT(NTHCAT) = VHITS(1,I) |
151 |
YINCAT(NTHCAT) = VHITS(2,I) |
152 |
ZINCAT(NTHCAT) = VHITS(3,I) |
153 |
#endif |
154 |
XOUTCAT(NTHCAT) = VHITS(4,I) |
155 |
YOUTCAT(NTHCAT) = VHITS(5,I) |
156 |
ZOUTCAT(NTHCAT) = VHITS(6,I) |
157 |
ERELCAT(NTHCAT) = VHITS(7,I) |
158 |
TIMECAT(NTHCAT)= VHITS(8,I) |
159 |
PATHCAT(NTHCAT) = VHITS(9,I) |
160 |
IPARCAT(NTHCAT) = VHITS(10,I) |
161 |
P0CAT(NTHCAT) = VHITS(11,I) |
162 |
ENDDO |
163 |
10000 FORMAT(' GPDCAT: VOLUME level too big: SET=',A4,', DET=',A4,', |
164 |
+ NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
165 |
10100 FORMAT(' GPDCAT: MAX number of hits retrived: SET=',A4, |
166 |
+ ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5, |
167 |
+ ', RUN=',I5,', EVT=',I8) |
168 |
10200 FORMAT(' GPDCAT: Error in GPRHIT: SET=',A4, |
169 |
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
170 |
+ ', RUN=',I5,', EVT=',I8) |
171 |
10 RETURN |
172 |
END |