1 |
* |
* |
2 |
* $Id$ |
* $Id: gpdcal.F,v 3.4 2005/07/25 11:53:20 cafagna Exp $ |
3 |
|
* |
4 |
|
* $Log: gpdcal.F,v $ |
5 |
|
* Revision 3.4 2005/07/25 11:53:20 cafagna |
6 |
|
* Several updates. See history for details |
7 |
|
* |
8 |
|
* Revision 3.3 2005/06/21 02:42:03 cafagna |
9 |
|
* Major modification to the geometry and to the random number chain |
10 |
|
* |
11 |
|
* Revision 3.2 2003/12/17 11:32:48 pamela |
12 |
|
* CALO SIMULATION COMPLETED: geometry and special tracking parameters updated and simulation checked by a comparison with the Trieste's standalone Monte Carlo simulation |
13 |
|
* |
14 |
|
* Revision 3.1.1.1 2002/07/11 16:02:14 cafagna |
15 |
|
* First GPAMELA release on CVS |
16 |
* |
* |
|
* $Log$ |
|
17 |
* |
* |
18 |
*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 |
19 |
*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 |
33 |
* * |
* * |
34 |
************************************************************************ |
************************************************************************ |
35 |
#include "gcunit.inc" |
#include "gcunit.inc" |
36 |
|
#include "gcflag.inc" |
37 |
#include "gpphit.inc" |
#include "gpphit.inc" |
38 |
PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3,NVOL1=2) |
PARAMETER (NH1=NHCALI,NHM1=NHMCALI,NVOL1=2) |
39 |
|
PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3) |
40 |
#include "gprhit.inc" |
#include "gprhit.inc" |
41 |
#include "gpcal.inc" |
#include "gpcal.inc" |
42 |
#include "gpsed.inc" |
#include "gpsed.inc" |
43 |
#include "gpkey.inc" |
#include "gpkey.inc" |
44 |
#include "gpgeo.inc" |
#include "gpgeo.inc" |
45 |
|
*ml:21/02/02 |
46 |
|
#include "gpencal.inc" |
47 |
|
*end ml. |
48 |
* |
* |
49 |
INTEGER IS,ID,NV,NVM,NNHM |
INTEGER IS,ID,NV,NVM,NNHM |
50 |
CHARACTER*4 CSET |
CHARACTER*4 CSET |
51 |
INTEGER NUMD1(NVOL1),NUMBV1(NVOL1,NHM) |
INTEGER ITRA1(NHM1),NUMD1(NVOL1),NUMBV1(NVOL1,NHM1) |
52 |
|
REAL VHITS1(NH1,NHM1) |
53 |
* |
* |
54 |
* Vector zeroed |
* Vector zeroed |
55 |
* |
* |
63 |
CALL VZERO(ERCASI,NHMCAL) |
CALL VZERO(ERCASI,NHMCAL) |
64 |
CALL VZERO(NUMD ,NVOL) |
CALL VZERO(NUMD ,NVOL) |
65 |
CALL VZERO(NUMD1 ,NVOL1) |
CALL VZERO(NUMD1 ,NVOL1) |
66 |
|
c ml:16/4/2003 |
67 |
|
CALL VZERO(ICASTRIP,NHMCALI) |
68 |
|
CALL VZERO(ICAPLANE,NHMCALI) |
69 |
|
CALL VZERO(ICAMOD,NHMCALI) |
70 |
|
CALL VZERO(ENESTRIP,NHMCALI) |
71 |
|
c end 16/4/2003 |
72 |
* |
* |
|
NV = NVOL |
|
|
NVM= NVMAX |
|
|
NTHCAL = 0 |
|
73 |
* |
* |
74 |
* The tungsten plane case |
* The tungsten plane case |
75 |
* |
* |
76 |
|
NV = NVOL |
77 |
|
NVM= NVMAX |
78 |
IS = ISCAL |
IS = ISCAL |
79 |
ID = IDCASI |
ID = IDCAST |
80 |
IT = -1 |
IT = -1 |
81 |
CSET = 'CAL ' |
CSET = 'CAL ' |
82 |
* |
* |
95 |
* Update the max number of hits to be retrived |
* Update the max number of hits to be retrived |
96 |
* |
* |
97 |
NNHM = NHM |
NNHM = NHM |
98 |
IF(NNHM.LE.0) THEN |
c$$$ IF(NNHM.LE.0) THEN |
99 |
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM, |
c$$$ WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM, |
100 |
+ IDRUN,IDEVT |
c$$$ + IDRUN,IDEVT |
101 |
CALL GMAIL(1,0) |
c$$$ CALL GMAIL(1,0) |
102 |
GO TO 10 |
c$$$ GO TO 10 |
103 |
ENDIF |
c$$$ ENDIF |
104 |
CALL VZERO(NUMBV,NVOL*NHM) |
CALL VZERO(NUMBV,NVOL*NHM) |
105 |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, |
106 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
119 |
* |
* |
120 |
* Fill the CWN common |
* Fill the CWN common |
121 |
* |
* |
122 |
|
NTHCAL=0 |
123 |
DO I=1,NHITS |
DO I=1,NHITS |
124 |
NTHCAL = NTHCAL + 1 |
NTHCAL = NTHCAL + 1 |
125 |
ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) |
ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) |
132 |
c IPARCAL(NTHCAL) = VHITS(5,I) |
c IPARCAL(NTHCAL) = VHITS(5,I) |
133 |
c P0CAL(NTHCAL) = VHITS(6,I) |
c P0CAL(NTHCAL) = VHITS(6,I) |
134 |
ENDDO |
ENDDO |
135 |
10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,', |
C |
136 |
+ NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
C The energy released per strip |
137 |
10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4, |
C |
138 |
+ ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5, |
NV = NVOL1 |
139 |
+ ', RUN=',I5,', EVT=',I8) |
NVM= NVMAX |
140 |
10200 FORMAT(' GPDCAL: Error in GPRHIT: SET=',A4, |
* |
141 |
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
* The tungsten plane case |
142 |
+ ', RUN=',I5,', EVT=',I8) |
* |
143 |
10 RETURN |
IS = ISCAL |
144 |
|
ID = IDCASI |
145 |
|
IT = -1 |
146 |
|
CSET = 'CAL ' |
147 |
|
* |
148 |
|
* Check on the volume level |
149 |
|
* |
150 |
|
IF (NV.GT.NVM) THEN |
151 |
|
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, |
152 |
|
+ IDRUN,IDEVT |
153 |
|
CALL GMAIL(1,0) |
154 |
|
GO TO 10 |
155 |
|
ENDIF |
156 |
|
CALL VZERO(VHITS1,NH1*NHM1) |
157 |
|
CALL VZERO(ITRA1 ,NHM1) |
158 |
|
NHITS = -1 |
159 |
|
* |
160 |
|
* Update the max number of hits to be retrived |
161 |
|
* |
162 |
|
NNHM = NHM1 |
163 |
|
IF(NNHM.LE.0) THEN |
164 |
|
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCALI,NHM, |
165 |
|
+ IDRUN,IDEVT |
166 |
|
CALL GMAIL(1,0) |
167 |
|
GO TO 10 |
168 |
|
ENDIF |
169 |
|
CALL VZERO(NUMBV1,NVOL1*NHM1) |
170 |
|
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL1,NH1,NNHM,1, |
171 |
|
+ IT,NUMD1,ITRA1,NUMBV1,VHITS1,NHITS) |
172 |
|
* |
173 |
|
* If there was a problem in GPRHIT then exit |
174 |
|
* |
175 |
|
IF(NHITS.LT.0) THEN |
176 |
|
WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM, |
177 |
|
+ IDRUN,IDEVT |
178 |
|
CALL GMAIL(1,0) |
179 |
|
GO TO 10 |
180 |
|
ENDIF |
181 |
|
* |
182 |
|
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
183 |
|
* |
184 |
|
* |
185 |
|
* Fill the CWN common |
186 |
|
* |
187 |
|
c |
188 |
|
NTHCALI=0 |
189 |
|
DO I=1,NHITS |
190 |
|
NTHCALI=NTHCALI+1 |
191 |
|
ICASTRIP(NTHCALI)=NUMBV1(NVCALI,I) |
192 |
|
ICAPLANE(NTHCALI)=NUMBV1((NVCALI-1),I) |
193 |
|
ICAMOD(NTHCALI)=VHITS1(1,I) |
194 |
|
ENESTRIP(NTHCALI)=VHITS1(2,I) |
195 |
|
ENDDO |
196 |
|
c |
197 |
|
10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,', |
198 |
|
+ NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
199 |
|
10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4, |
200 |
|
+ ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5, |
201 |
|
+ ', RUN=',I5,', EVT=',I8) |
202 |
|
10200 FORMAT(' GPDCAL: Error in GPRHIT: SET=',A4, |
203 |
|
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
204 |
|
+ ', RUN=',I5,', EVT=',I8) |
205 |
|
10 RETURN |
206 |
END |
END |