1 |
* |
* |
2 |
* $Id$ |
* $Id: gpucal.F,v 3.4 2005/12/14 03:13:53 cafagna Exp $ |
3 |
|
* |
4 |
|
* $Log: gpucal.F,v $ |
5 |
|
* Revision 3.4 2005/12/14 03:13:53 cafagna |
6 |
|
* Neutron detector added. Geometry and GPCALOR package |
7 |
|
* |
8 |
|
* Revision 3.3 2005/06/21 02:42:04 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 10.57.01 by Francesco Cafagna |
*CMZ : 2.03/00 31/10/2000 10.57.01 by Francesco Cafagna |
19 |
*CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola |
*CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola |
52 |
************************************************************************ |
************************************************************************ |
53 |
#include "gphit.inc" |
#include "gphit.inc" |
54 |
#include "gcunit.inc" |
#include "gcunit.inc" |
55 |
*EM: |
*ml: (19/02/03) |
56 |
|
#include "gckine.inc" |
57 |
|
#include "gcflag.inc" |
58 |
|
#include "gpencal.inc" |
59 |
|
*end ml |
60 |
|
*EM: |
61 |
PARAMETER (CALIB=0.0001085200) |
PARAMETER (CALIB=0.0001085200) |
62 |
*END EM. |
*END EM. |
63 |
INTEGER IACT,IS,ID,IPA,IT,NUMVOL(20),IMEC,IDHIT |
INTEGER IACT,IS,ID,IPA,IT,NUMVOL(20),IMEC,IDHIT |
64 |
REAL DELOSS,PATH,TRAPAR(7),VHIT(NHCAL),XYZM(3),XYZD(3) |
REAL DELOSS,PATH,TRAPAR(7),VHIT(NHCAL),XYZM(3),XYZD(3) |
65 |
|
* REAL DELOSS,PATH,TRAPAR(7),XYZM(3),XYZD(3) |
66 |
REAL DELTA2,SIGMA2,SIGMA,GRNDM0,GPGAUS,PATHINI |
REAL DELTA2,SIGMA2,SIGMA,GRNDM0,GPGAUS,PATHINI |
67 |
LOGICAL SAVE |
LOGICAL SAVE |
68 |
* |
* |
69 |
|
*ml (19/02/02): |
70 |
|
INTEGER IPL,IMOD,IST |
71 |
|
DATA IEVOLD/-1/ |
72 |
|
* |
73 |
|
* It's a new event |
74 |
|
* |
75 |
|
C # IF(IEVOLD.NE.IEVENT) THEN |
76 |
|
C # c print*,'IS,ID,NUMVOL=',IS,ID,NUMVOL |
77 |
|
C # c print*,'GPUCAL:last event=',ievold |
78 |
|
C # IEVOLD=IEVENT |
79 |
|
C # CALL VZERO(ENEMAT,44*9*32) |
80 |
|
C # ENDIF |
81 |
|
|
82 |
|
C # Please note that ENEMAT is zeroed just on the very first event here. |
83 |
|
C # Then is cleared into GUTREV on an event by event basis. |
84 |
|
IF(IEVOLD.EQ.-1) THEN |
85 |
|
IEVOLD=IEVENT |
86 |
|
CALL VZERO(ENEMAT,44*9*32) |
87 |
|
ENDIF |
88 |
|
|
89 |
|
*end ml. |
90 |
|
* |
91 |
* Track is inside a volume |
* Track is inside a volume |
92 |
* |
* |
93 |
IF(IACT.EQ.0) THEN |
IF(IACT.EQ.0) THEN |
94 |
IF(IMEC.GT.0) THEN |
IF(IMEC.GT.0) THEN |
95 |
SAVE = .TRUE. |
SAVE = .TRUE. |
96 |
*EM: |
*EM: |
97 |
VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
cccc VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
98 |
* VHIT(4) = DELOSS + VHIT(4) |
* END EM |
99 |
*END EM |
C ML |
100 |
|
VHIT(4) = DELOSS + VHIT(4) |
101 |
|
ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))= |
102 |
|
+ ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))+DELOSS |
103 |
|
*END ML |
104 |
ENDIF |
ENDIF |
105 |
ENDIF |
ENDIF |
106 |
* |
* |
115 |
IF(IMEC.GT.0) THEN |
IF(IMEC.GT.0) THEN |
116 |
SAVE = .TRUE. |
SAVE = .TRUE. |
117 |
*EM: |
*EM: |
118 |
VHIT(4) = DELOSS/CALIB |
c VHIT(4) = DELOSS/CALIB |
119 |
* VHIT(4) = DELOSS |
*END EM. |
120 |
*END EM |
VHIT(4) = DELOSS |
121 |
|
C ML: |
122 |
|
ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))= |
123 |
|
+ ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))+DELOSS |
124 |
|
*END ML |
125 |
ENDIF |
ENDIF |
126 |
IDHIT = -1 |
IDHIT = -1 |
127 |
* Store the particle and momentum if is the first track |
* Store the particle and momentum if is the first track |
138 |
IF(IMEC.GT.0) THEN |
IF(IMEC.GT.0) THEN |
139 |
SAVE = .TRUE. |
SAVE = .TRUE. |
140 |
*EM: |
*EM: |
141 |
VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
c VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
142 |
* VHIT(4) = DELOSS + VHIT(4) |
*END EM |
143 |
|
VHIT(4) = DELOSS + VHIT(4) |
144 |
|
*ML: |
145 |
|
ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))= |
146 |
|
+ ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))+DELOSS |
147 |
*END EM |
*END EM |
148 |
ENDIF |
ENDIF |
149 |
#if defined(GPAMELA_NOGFLUCT) |
#if defined(GPAMELA_NOGFLUCT) |
161 |
SIGMA=SQRT(SIGMA2) |
SIGMA=SQRT(SIGMA2) |
162 |
GRNDM0 = GPGAUS(0.) |
GRNDM0 = GPGAUS(0.) |
163 |
*EM: |
*EM: |
164 |
VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
165 |
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
CML17/04/03 VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
166 |
*END EM |
*END EM |
167 |
IF(VHIT(4).LT.0.) VHIT(4)=0. |
CML17/04/03 IF(VHIT(4).LT.0.) VHIT(4)=0. |
168 |
ENDIF |
ENDIF |
169 |
#endif |
#endif |
170 |
* |
* |
173 |
IF(IDHIT.EQ.-1) THEN |
IF(IDHIT.EQ.-1) THEN |
174 |
*ML: |
*ML: |
175 |
* IF(SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
* IF(SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
176 |
IF(SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
IF(SAVE) THEN |
177 |
|
CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
178 |
|
c CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
179 |
|
ENDIF |
180 |
*END ML. |
*END ML. |
181 |
IF (IDHIT.EQ.0) THEN |
IF (IDHIT.EQ.0) THEN |
182 |
WRITE(CHMAIL,10000) IS,ID,IT |
WRITE(CHMAIL,10000) IS,ID,IT |
198 |
IF(IMEC.GT.0) THEN |
IF(IMEC.GT.0) THEN |
199 |
SAVE = .TRUE. |
SAVE = .TRUE. |
200 |
*EM: |
*EM: |
201 |
VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
c VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
202 |
c VHIT(4) = DELOSS + VHIT(4) |
* END EM. |
203 |
*END EM |
VHIT(4) = DELOSS + VHIT(4) |
204 |
|
*ML: |
205 |
|
ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))= |
206 |
|
+ ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))+DELOSS |
207 |
|
*END ML. |
208 |
ENDIF |
ENDIF |
209 |
#if defined(GPAMELA_NOGFLUCT) |
#if defined(GPAMELA_NOGFLUCT) |
210 |
* |
* |
221 |
SIGMA=SQRT(SIGMA2) |
SIGMA=SQRT(SIGMA2) |
222 |
GRNDM0 = GPGAUS(0.) |
GRNDM0 = GPGAUS(0.) |
223 |
*EM: |
*EM: |
224 |
VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
225 |
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
CML17/04/03 VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
226 |
*END EM. |
*END EM. |
227 |
IF(VHIT(4).LT.0.) VHIT(4)=0. |
CML17/04/03 IF(VHIT(4).LT.0.) VHIT(4)=0. |
228 |
ENDIF |
ENDIF |
229 |
#endif |
#endif |
230 |
* |
* |
232 |
* |
* |
233 |
IF(IDHIT.EQ.-1) THEN |
IF(IDHIT.EQ.-1) THEN |
234 |
*ML |
*ML |
235 |
* IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
C IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
236 |
IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
IF (SAVE) THEN |
237 |
|
CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
238 |
|
ENDIF |
239 |
|
CL IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
240 |
*END ML. |
*END ML. |
241 |
IF (IDHIT.EQ.0) THEN |
IF (IDHIT.EQ.0) THEN |
242 |
WRITE(CHMAIL,10200) IS,ID,IT |
WRITE(CHMAIL,10200) IS,ID,IT |