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