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