1 |
* |
* |
2 |
* $Id: gpdcal.F,v 3.1.1.1 2002/07/11 16:02:14 cafagna Exp $ |
* $Id: gpdcal.F,v 3.4 2005/07/25 11:53:20 cafagna Exp $ |
3 |
* |
* |
4 |
* $Log: gpdcal.F,v $ |
* $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 |
* Revision 3.1.1.1 2002/07/11 16:02:14 cafagna |
15 |
* First GPAMELA release on CVS |
* First GPAMELA release on CVS |
16 |
* |
* |
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" |
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 |
* |
* |
64 |
CALL VZERO(NUMD ,NVOL) |
CALL VZERO(NUMD ,NVOL) |
65 |
CALL VZERO(NUMD1 ,NVOL1) |
CALL VZERO(NUMD1 ,NVOL1) |
66 |
c ml:16/4/2003 |
c ml:16/4/2003 |
67 |
CALL VZERO(ICASTRIP,NHMCAL) |
CALL VZERO(ICASTRIP,NHMCALI) |
68 |
CALL VZERO(ICAPLANE,NHMCAL) |
CALL VZERO(ICAPLANE,NHMCALI) |
69 |
CALL VZERO(ICAMOD,NHMCAL) |
CALL VZERO(ICAMOD,NHMCALI) |
70 |
CALL VZERO(ENESTRIP,NHMCAL) |
CALL VZERO(ENESTRIP,NHMCALI) |
71 |
c end 16/4/2003 |
c end 16/4/2003 |
72 |
* |
* |
|
NV = NVOL |
|
|
NVM= NVMAX |
|
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) |
121 |
* |
* |
122 |
NTHCAL=0 |
NTHCAL=0 |
123 |
DO I=1,NHITS |
DO I=1,NHITS |
124 |
NTHCAL=NTHCAL+1 |
NTHCAL = NTHCAL + 1 |
125 |
ICASTRIP(NTHCAL)=VHITS(2,I) |
ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) |
126 |
ICAPLANE(NTHCAL)=VHITS(1,I) |
ICASI(NTHCAL) = NUMBV((NVCAL-1),I) |
127 |
ICAMOD(NTHCAL)=VHITS(3,I) |
ICAST(NTHCAL) = NUMBV((NVCAL),I) |
128 |
ENESTRIP(NTHCAL)=VHITS(4,I) |
XINCAL(NTHCAL) = VHITS(1,I) |
129 |
ENDDO |
YINCAL(NTHCAL) = VHITS(2,I) |
130 |
cl DO I=1,NHITS |
ZINCAL(NTHCAL) = VHITS(3,I) |
131 |
cl NTHCAL = NTHCAL + 1 |
ERELCAL(NTHCAL) = VHITS(4,I) |
|
cl ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) |
|
|
cl ICASI(NTHCAL) = NUMBV((NVCAL-1),I) |
|
|
cl ICAST(NTHCAL) = NUMBV((NVCAL),I) |
|
|
cl XINCAL(NTHCAL) = VHITS(1,I) |
|
|
cl YINCAL(NTHCAL) = VHITS(2,I) |
|
|
cl ZINCAL(NTHCAL) = VHITS(3,I) |
|
|
cl ERELCAL(NTHCAL) = VHITS(4,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 |
cl ENDDO |
ENDDO |
135 |
|
C |
136 |
|
C The energy released per strip |
137 |
|
C |
138 |
|
NV = NVOL1 |
139 |
|
NVM= NVMAX |
140 |
|
* |
141 |
|
* The tungsten plane case |
142 |
|
* |
143 |
|
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 |
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,', |
10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,', |
198 |
+ NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
+ NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
199 |
10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4, |
10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4, |