1 |
* |
* |
2 |
* $Id$ |
* $Id: gpucal.F,v 3.1.1.1 2002/07/11 16:02:14 cafagna Exp $ |
3 |
|
* |
4 |
|
* $Log: gpucal.F,v $ |
5 |
|
* Revision 3.1.1.1 2002/07/11 16:02:14 cafagna |
6 |
|
* First GPAMELA release on CVS |
7 |
* |
* |
|
* $Log$ |
|
8 |
* |
* |
9 |
*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 |
10 |
*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 |
43 |
************************************************************************ |
************************************************************************ |
44 |
#include "gphit.inc" |
#include "gphit.inc" |
45 |
#include "gcunit.inc" |
#include "gcunit.inc" |
46 |
|
*ml: (19/02/03) |
47 |
|
#include "gckine.inc" |
48 |
|
#include "gcflag.inc" |
49 |
|
#include "gpencal.inc" |
50 |
|
*end ml |
51 |
*EM: |
*EM: |
52 |
PARAMETER (CALIB=0.0001085200) |
PARAMETER (CALIB=0.0001085200) |
53 |
*END EM. |
*END EM. |
54 |
INTEGER IACT,IS,ID,IPA,IT,NUMVOL(20),IMEC,IDHIT |
INTEGER IACT,IS,ID,IPA,IT,NUMVOL(20),IMEC,IDHIT |
55 |
REAL DELOSS,PATH,TRAPAR(7),VHIT(NHCAL),XYZM(3),XYZD(3) |
CML17/04/03 REAL DELOSS,PATH,TRAPAR(7),VHIT(NHCAL),XYZM(3),XYZD(3) |
56 |
|
REAL DELOSS,PATH,TRAPAR(7),XYZM(3),XYZD(3) |
57 |
REAL DELTA2,SIGMA2,SIGMA,GRNDM0,GPGAUS,PATHINI |
REAL DELTA2,SIGMA2,SIGMA,GRNDM0,GPGAUS,PATHINI |
58 |
LOGICAL SAVE |
LOGICAL SAVE |
59 |
* |
* |
60 |
|
*ml (19/02/02): |
61 |
|
INTEGER IPL,IMOD,IST |
62 |
|
DATA IEVOLD/-1/ |
63 |
|
* |
64 |
|
* It's a new event |
65 |
|
* |
66 |
|
IF(IEVOLD.NE.IEVENT) THEN |
67 |
|
c print*,'IS,ID,NUMVOL=',IS,ID,NUMVOL |
68 |
|
c print*,'GPUCAL:last event=',ievold |
69 |
|
IEVOLD=IEVENT |
70 |
|
CALL VZERO(ENEMAT,44*9*32) |
71 |
|
ENDIF |
72 |
|
*end ml. |
73 |
|
* |
74 |
* Track is inside a volume |
* Track is inside a volume |
75 |
* |
* |
76 |
IF(IACT.EQ.0) THEN |
IF(IACT.EQ.0) THEN |
77 |
IF(IMEC.GT.0) THEN |
IF(IMEC.GT.0) THEN |
78 |
SAVE = .TRUE. |
SAVE = .TRUE. |
79 |
*EM: |
*EM: |
80 |
VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
cccc VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
81 |
* VHIT(4) = DELOSS + VHIT(4) |
* END EM |
82 |
*END EM |
C ML |
83 |
|
CML17/04/03 VHIT(4) = DELOSS + VHIT(4) |
84 |
|
ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))= |
85 |
|
+ ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))+DELOSS |
86 |
|
*END ML |
87 |
ENDIF |
ENDIF |
88 |
ENDIF |
ENDIF |
89 |
* |
* |
91 |
* |
* |
92 |
IF(IACT.EQ.1) THEN |
IF(IACT.EQ.1) THEN |
93 |
SAVE = .FALSE. |
SAVE = .FALSE. |
94 |
CALL VZERO(VHIT,NHCAL) |
CML17/04/03 CALL VZERO(VHIT,NHCAL) |
95 |
DO I=1,3 |
CML17/04/03 DO I=1,3 |
96 |
VHIT(I) = TRAPAR(I) |
CML17/04/03 VHIT(I) = TRAPAR(I) |
97 |
ENDDO |
CML17/04/03 ENDDO |
98 |
IF(IMEC.GT.0) THEN |
IF(IMEC.GT.0) THEN |
99 |
SAVE = .TRUE. |
SAVE = .TRUE. |
100 |
*EM: |
*EM: |
101 |
VHIT(4) = DELOSS/CALIB |
c VHIT(4) = DELOSS/CALIB |
102 |
* VHIT(4) = DELOSS |
*END EM. |
103 |
*END EM |
CML17/04/03 VHIT(4) = DELOSS |
104 |
|
C ML: |
105 |
|
ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))= |
106 |
|
+ ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))+DELOSS |
107 |
|
*END ML |
108 |
ENDIF |
ENDIF |
109 |
IDHIT = -1 |
IDHIT = -1 |
110 |
* Store the particle and momentum if is the first track |
* Store the particle and momentum if is the first track |
121 |
IF(IMEC.GT.0) THEN |
IF(IMEC.GT.0) THEN |
122 |
SAVE = .TRUE. |
SAVE = .TRUE. |
123 |
*EM: |
*EM: |
124 |
VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
c VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
125 |
* VHIT(4) = DELOSS + VHIT(4) |
*END EM |
126 |
|
CML17/04/03 VHIT(4) = DELOSS + VHIT(4) |
127 |
|
*ML: |
128 |
|
ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))= |
129 |
|
+ ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))+DELOSS |
130 |
*END EM |
*END EM |
131 |
ENDIF |
ENDIF |
132 |
#if defined(GPAMELA_NOGFLUCT) |
#if defined(GPAMELA_NOGFLUCT) |
144 |
SIGMA=SQRT(SIGMA2) |
SIGMA=SQRT(SIGMA2) |
145 |
GRNDM0 = GPGAUS(0.) |
GRNDM0 = GPGAUS(0.) |
146 |
*EM: |
*EM: |
147 |
VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
148 |
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
CML17/04/03 VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
149 |
*END EM |
*END EM |
150 |
IF(VHIT(4).LT.0.) VHIT(4)=0. |
CML17/04/03 IF(VHIT(4).LT.0.) VHIT(4)=0. |
151 |
ENDIF |
ENDIF |
152 |
#endif |
#endif |
153 |
* |
* |
156 |
IF(IDHIT.EQ.-1) THEN |
IF(IDHIT.EQ.-1) THEN |
157 |
*ML: |
*ML: |
158 |
* IF(SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
* IF(SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
159 |
IF(SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
CL IF(SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
160 |
*END ML. |
*END ML. |
161 |
IF (IDHIT.EQ.0) THEN |
IF (IDHIT.EQ.0) THEN |
162 |
WRITE(CHMAIL,10000) IS,ID,IT |
WRITE(CHMAIL,10000) IS,ID,IT |
178 |
IF(IMEC.GT.0) THEN |
IF(IMEC.GT.0) THEN |
179 |
SAVE = .TRUE. |
SAVE = .TRUE. |
180 |
*EM: |
*EM: |
181 |
VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
c VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
182 |
c VHIT(4) = DELOSS + VHIT(4) |
* END EM. |
183 |
*END EM |
CML17/04/03 VHIT(4) = DELOSS + VHIT(4) |
184 |
|
*ML: |
185 |
|
ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))= |
186 |
|
+ ENEMAT(NUMVOL(1),NUMVOL(2),NUMVOL(3))+DELOSS |
187 |
|
*END ML. |
188 |
ENDIF |
ENDIF |
189 |
#if defined(GPAMELA_NOGFLUCT) |
#if defined(GPAMELA_NOGFLUCT) |
190 |
* |
* |
201 |
SIGMA=SQRT(SIGMA2) |
SIGMA=SQRT(SIGMA2) |
202 |
GRNDM0 = GPGAUS(0.) |
GRNDM0 = GPGAUS(0.) |
203 |
*EM: |
*EM: |
204 |
VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
205 |
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
CML17/04/03 VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
206 |
*END EM. |
*END EM. |
207 |
IF(VHIT(4).LT.0.) VHIT(4)=0. |
CML17/04/03 IF(VHIT(4).LT.0.) VHIT(4)=0. |
208 |
ENDIF |
ENDIF |
209 |
#endif |
#endif |
210 |
* |
* |
213 |
IF(IDHIT.EQ.-1) THEN |
IF(IDHIT.EQ.-1) THEN |
214 |
*ML |
*ML |
215 |
* IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
* IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
216 |
IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
CL IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
217 |
*END ML. |
*END ML. |
218 |
IF (IDHIT.EQ.0) THEN |
IF (IDHIT.EQ.0) THEN |
219 |
WRITE(CHMAIL,10200) IS,ID,IT |
WRITE(CHMAIL,10200) IS,ID,IT |