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