1 |
* |
2 |
* $Id: gpdcas.F,v 3.1.1.1 2002/07/11 16:02:14 cafagna Exp $ |
3 |
* |
4 |
* $Log: gpdcas.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.35.11 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 GPDCAS |
17 |
************************************************************************ |
18 |
* * |
19 |
* To perform CAS 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=NHCAS,NHM=NHMCAS,NVOL=2) |
28 |
#include "gprhit.inc" |
29 |
#include "gpcas.inc" |
30 |
#include "gpsed.inc" |
31 |
* |
32 |
INTEGER IS,ID,NV,NVM |
33 |
CHARACTER*4 CSET |
34 |
* |
35 |
* |
36 |
* Vector zeroed |
37 |
* |
38 |
CALL VZERO(ICAS,NHM) |
39 |
CALL VZERO(XCAS,NHM) |
40 |
CALL VZERO(YCAS,NHM) |
41 |
CALL VZERO(ZCAS,NHM) |
42 |
CALL VZERO(XOCAS,NHM) |
43 |
CALL VZERO(YOCAS,NHM) |
44 |
CALL VZERO(ZOCAS,NHM) |
45 |
CALL VZERO(ERCAS,NHM) |
46 |
CALL VZERO(TIMECAS,NHM) |
47 |
CALL VZERO(PACAS,NHM) |
48 |
CALL VZERO(P0CAS,NHM) |
49 |
CALL VZERO(ICASPAR,NHM) |
50 |
CALL VZERO(NUMD ,NVOL) |
51 |
* |
52 |
NV = NVOL |
53 |
NVM= NVMAX |
54 |
IS = ISCAS |
55 |
ID = IDCASX |
56 |
CSET = 'CAS ' |
57 |
IT = -1 |
58 |
* |
59 |
* Check on the volume level |
60 |
* |
61 |
IF (NV.GT.NVM) THEN |
62 |
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, |
63 |
+ IDRUN,IDEVT |
64 |
CALL GMAIL(1,0) |
65 |
GO TO 10 |
66 |
ENDIF |
67 |
CALL VZERO(VHITS,NH*NHM) |
68 |
CALL VZERO(ITRA ,NHM) |
69 |
CALL VZERO(NUMBV,NVOL*NHM) |
70 |
NHITS = -1 |
71 |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1, |
72 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
73 |
* |
74 |
* If there was a problem in GPRHIT then exit |
75 |
* |
76 |
IF(NHITS.LT.0) THEN |
77 |
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NHITS,NHM, |
78 |
+ IDRUN,IDEVT |
79 |
CALL GMAIL(1,0) |
80 |
GO TO 10 |
81 |
ENDIF |
82 |
* |
83 |
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
84 |
* |
85 |
* |
86 |
* Fill the CWN common |
87 |
* |
88 |
NTHCAS = NHITS |
89 |
DO I=1,NHITS |
90 |
ICAS(I) = NUMBV(NVCAS,I) |
91 |
#if defined(GPAMELA_INTER) |
92 |
XINCAS(I) = 2*VHITS(1,I)-VHITS(4,I) |
93 |
YINCAS(I) = 2*VHITS(2,I)-VHITS(5,I) |
94 |
ZINCAS(I) = 2*VHITS(3,I)-VHITS(6,I) |
95 |
#endif |
96 |
#if !defined(GPAMELA_INTER) |
97 |
XINCAS(I) = VHITS(1,I) |
98 |
YINCAS(I) = VHITS(2,I) |
99 |
ZINCAS(I) = VHITS(3,I) |
100 |
#endif |
101 |
XOUTCAS(I) = VHITS(4,I) |
102 |
YOUTCAS(I) = VHITS(5,I) |
103 |
ZOUTCAS(I) = VHITS(6,I) |
104 |
ERELCAS(I) = VHITS(7,I) |
105 |
TIMECAS(I)= VHITS(8,I) |
106 |
PATHCAS(I) = VHITS(9,I) |
107 |
IPARCAS(I) = VHITS(10,I) |
108 |
P0CAS(I) = VHITS(11,I) |
109 |
ENDDO |
110 |
*JeL: |
111 |
* |
112 |
* Next detector |
113 |
* |
114 |
C ID = IDCASY |
115 |
C CALL VZERO(VHITS,NH*NHM) |
116 |
C CALL VZERO(ITRA ,NHM) |
117 |
C CALL VZERO(NUMBV,NVOL*NHM) |
118 |
C NHITS = -1 |
119 |
* |
120 |
* Update the max number of hits to be retrived |
121 |
* |
122 |
C NNHM = NHM - NTHCAS |
123 |
C IF(NNHM.LE.0) THEN |
124 |
C WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAS,NHM, |
125 |
C + IDRUN,IDEVT |
126 |
C CALL GMAIL(1,0) |
127 |
C GO TO 10 |
128 |
C ENDIF |
129 |
C CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, |
130 |
C + IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
131 |
* |
132 |
* If there was a problem in GPRHIT then exit |
133 |
* |
134 |
C IF(NHITS.LT.0) THEN |
135 |
C WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM, |
136 |
C + IDRUN,IDEVT |
137 |
C CALL GMAIL(1,0) |
138 |
C GO TO 10 |
139 |
C ENDIF |
140 |
* |
141 |
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
142 |
* |
143 |
* |
144 |
* Fill the CWN common |
145 |
* |
146 |
C DO I=1,NHITS |
147 |
C NTHCAS = NTHCAS + 1 |
148 |
C ICAS(NTHCAS) = 2 + NUMBV(NVCAS,I) |
149 |
C#if defined(GPAMELA_INTER) |
150 |
C XINCAS(NTHCAS) = 2*VHITS(1,I)-VHITS(4,I) |
151 |
C YINCAS(NTHCAS) = 2*VHITS(2,I)-VHITS(5,I) |
152 |
C ZINCAS(NTHCAS) = 2*VHITS(3,I)-VHITS(6,I) |
153 |
C#endif |
154 |
C#if !defined(GPAMELA_INTER) |
155 |
C XINCAS(NTHCAS) = VHITS(1,I) |
156 |
C YINCAS(NTHCAS) = VHITS(2,I) |
157 |
C ZINCAS(NTHCAS) = VHITS(3,I) |
158 |
C#endif |
159 |
C XOUTCAS(NTHCAS) = VHITS(4,I) |
160 |
C YOUTCAS(NTHCAS) = VHITS(5,I) |
161 |
C ZOUTCAS(NTHCAS) = VHITS(6,I) |
162 |
C ERELCAS(NTHCAS) = VHITS(7,I) |
163 |
C TIMECAS(NTHCAS)= VHITS(8,I) |
164 |
C PATHCAS(NTHCAS) = VHITS(9,I) |
165 |
C IPARCAS(NTHCAS) = VHITS(10,I) |
166 |
C P0CAS(NTHCAS) = VHITS(11,I) |
167 |
C ENDDO |
168 |
*END: JeL. |
169 |
* |
170 |
10000 FORMAT(' GPDCAS: VOLUME level too big: SET=',A4,', DET=',A4,', |
171 |
+ NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
172 |
10100 FORMAT(' GPDCAS: Error in GPRHIT: SET=',A4, |
173 |
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
174 |
+ ', RUN=',I5,', EVT=',I8) |
175 |
10200 FORMAT(' GPDCAS: Error in GPRHIT: SET=',A4, |
176 |
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
177 |
+ ', RUN=',I5,', EVT=',I8) |
178 |
10 RETURN |
179 |
END |