1 |
* |
* |
2 |
* $Id$ |
* $Id: gpdcal.F,v 3.2 2003/12/17 11:32:48 pamela Exp $ |
3 |
|
* |
4 |
|
* $Log: gpdcal.F,v $ |
5 |
|
* Revision 3.2 2003/12/17 11:32:48 pamela |
6 |
|
* CALO SIMULATION COMPLETED: geometry and special tracking parameters updated and simulation checked by a comparison with the Trieste's standalone Monte Carlo simulation |
7 |
|
* |
8 |
|
* Revision 3.1.1.1 2002/07/11 16:02:14 cafagna |
9 |
|
* First GPAMELA release on CVS |
10 |
* |
* |
|
* $Log$ |
|
11 |
* |
* |
12 |
*CMZ : 2.03/00 31/10/2000 11.18.51 by Francesco Cafagna |
*CMZ : 2.03/00 31/10/2000 11.18.51 by Francesco Cafagna |
13 |
*CMZ : 2.02/00 10/10/2000 14.09.00 by Francesco Cafagna |
*CMZ : 2.02/00 10/10/2000 14.09.00 by Francesco Cafagna |
34 |
#include "gpsed.inc" |
#include "gpsed.inc" |
35 |
#include "gpkey.inc" |
#include "gpkey.inc" |
36 |
#include "gpgeo.inc" |
#include "gpgeo.inc" |
37 |
|
*ml:21/02/02 |
38 |
|
#include "gpencal.inc" |
39 |
|
*end ml. |
40 |
* |
* |
41 |
INTEGER IS,ID,NV,NVM,NNHM |
INTEGER IS,ID,NV,NVM,NNHM |
42 |
CHARACTER*4 CSET |
CHARACTER*4 CSET |
54 |
CALL VZERO(ERCASI,NHMCAL) |
CALL VZERO(ERCASI,NHMCAL) |
55 |
CALL VZERO(NUMD ,NVOL) |
CALL VZERO(NUMD ,NVOL) |
56 |
CALL VZERO(NUMD1 ,NVOL1) |
CALL VZERO(NUMD1 ,NVOL1) |
57 |
|
c ml:16/4/2003 |
58 |
|
CALL VZERO(ICASTRIP,NHMCAL) |
59 |
|
CALL VZERO(ICAPLANE,NHMCAL) |
60 |
|
CALL VZERO(ICAMOD,NHMCAL) |
61 |
|
CALL VZERO(ENESTRIP,NHMCAL) |
62 |
|
c end 16/4/2003 |
63 |
* |
* |
64 |
NV = NVOL |
NV = NVOL |
65 |
NVM= NVMAX |
NVM= NVMAX |
|
NTHCAL = 0 |
|
66 |
* |
* |
67 |
* The tungsten plane case |
* The tungsten plane case |
68 |
* |
* |
69 |
IS = ISCAL |
IS = ISCAL |
70 |
ID = IDCASI |
ID = IDCAST |
71 |
IT = -1 |
IT = -1 |
72 |
CSET = 'CAL ' |
CSET = 'CAL ' |
73 |
* |
* |
110 |
* |
* |
111 |
* Fill the CWN common |
* Fill the CWN common |
112 |
* |
* |
113 |
|
NTHCAL=0 |
114 |
DO I=1,NHITS |
DO I=1,NHITS |
115 |
NTHCAL = NTHCAL + 1 |
NTHCAL = NTHCAL + 1 |
116 |
ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) |
ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) |
123 |
c IPARCAL(NTHCAL) = VHITS(5,I) |
c IPARCAL(NTHCAL) = VHITS(5,I) |
124 |
c P0CAL(NTHCAL) = VHITS(6,I) |
c P0CAL(NTHCAL) = VHITS(6,I) |
125 |
ENDDO |
ENDDO |
126 |
10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,', |
C |
127 |
+ NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
C The energy released per strip |
128 |
10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4, |
C |
129 |
+ ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5, |
NV = NVOL1 |
130 |
+ ', RUN=',I5,', EVT=',I8) |
NVM= NVMAX |
131 |
10200 FORMAT(' GPDCAL: Error in GPRHIT: SET=',A4, |
* |
132 |
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
* The tungsten plane case |
133 |
+ ', RUN=',I5,', EVT=',I8) |
* |
134 |
10 RETURN |
IS = ISCAL |
135 |
|
ID = IDCASI |
136 |
|
IT = -1 |
137 |
|
CSET = 'CAL ' |
138 |
|
* |
139 |
|
* Check on the volume level |
140 |
|
* |
141 |
|
IF (NV.GT.NVM) THEN |
142 |
|
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, |
143 |
|
+ IDRUN,IDEVT |
144 |
|
CALL GMAIL(1,0) |
145 |
|
GO TO 10 |
146 |
|
ENDIF |
147 |
|
CALL VZERO(VHITS,NH*NHM) |
148 |
|
CALL VZERO(ITRA ,NHM) |
149 |
|
NHITS = -1 |
150 |
|
* |
151 |
|
* Update the max number of hits to be retrived |
152 |
|
* |
153 |
|
NNHM = NHM |
154 |
|
IF(NNHM.LE.0) THEN |
155 |
|
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCALI,NHM, |
156 |
|
+ IDRUN,IDEVT |
157 |
|
CALL GMAIL(1,0) |
158 |
|
GO TO 10 |
159 |
|
ENDIF |
160 |
|
CALL VZERO(NUMBV,NVOL*NHM) |
161 |
|
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, |
162 |
|
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
163 |
|
* |
164 |
|
* If there was a problem in GPRHIT then exit |
165 |
|
* |
166 |
|
IF(NHITS.LT.0) THEN |
167 |
|
WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM, |
168 |
|
+ IDRUN,IDEVT |
169 |
|
CALL GMAIL(1,0) |
170 |
|
GO TO 10 |
171 |
|
ENDIF |
172 |
|
* |
173 |
|
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
174 |
|
* |
175 |
|
* |
176 |
|
* Fill the CWN common |
177 |
|
* |
178 |
|
c |
179 |
|
DO I=1,NHITS |
180 |
|
NTHCALI=NTHCALI+1 |
181 |
|
ICASTRIP(NTHCALI)=NUMBV(NVCALI,I) |
182 |
|
ICAPLANE(NTHCALI)=NUMBV((NVCALI-1),I) |
183 |
|
ICAMOD(NTHCALI)=VHITS(1,I) |
184 |
|
ENESTRIP(NTHCALI)=VHITS(2,I) |
185 |
|
ENDDO |
186 |
|
c |
187 |
|
10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,', |
188 |
|
+ NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
189 |
|
10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4, |
190 |
|
+ ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5, |
191 |
|
+ ', RUN=',I5,', EVT=',I8) |
192 |
|
10200 FORMAT(' GPDCAL: Error in GPRHIT: SET=',A4, |
193 |
|
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
194 |
|
+ ', RUN=',I5,', EVT=',I8) |
195 |
|
10 RETURN |
196 |
END |
END |