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