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