1 |
cafagna |
3.1 |
* |
2 |
|
|
* $Id$ |
3 |
|
|
* |
4 |
|
|
* $Log$ |
5 |
|
|
* |
6 |
|
|
*CMZ : 2.03/00 31/10/2000 10.57.01 by Francesco Cafagna |
7 |
|
|
*CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola |
8 |
|
|
*CMZ : 2.00/00 29/02/2000 10.23.24 by Francesco Cafagna |
9 |
|
|
*CMZ : 1.02/00 08/02/2000 21.29.53 by Francesco Cafagna |
10 |
|
|
*CMZ : 1.00/02 04/04/96 16.47.16 by Francesco Cafagna |
11 |
|
|
*-- Author : Francesco Cafagna 21/02/96 |
12 |
|
|
SUBROUTINE GPUCAL(IACT,IS,ID,IPA,IT,DELOSS,PATH, |
13 |
|
|
+ TRAPAR,NUMVOL,IMEC) |
14 |
|
|
************************************************************************ |
15 |
|
|
* * |
16 |
|
|
* To collect and store the hit structure for CAL * |
17 |
|
|
* * |
18 |
|
|
* Variables definition: * |
19 |
|
|
* IN: * |
20 |
|
|
* IACT, integer specifing the action to be taken. It is the INWVOL * |
21 |
|
|
* variable in GCTRAK common * |
22 |
|
|
* IS , set number * |
23 |
|
|
* ID , detector number * |
24 |
|
|
* IPA , particle number * |
25 |
|
|
* IT , track number * |
26 |
|
|
* DELOSS, energy loss in the step * |
27 |
|
|
* PATH , current track lenght * |
28 |
|
|
* TRAPAR, track parameter, is the VECT vector in GCTRAK common * |
29 |
|
|
* NUMVOL, integer array of numbers identifying the DETECTOR * |
30 |
|
|
* IMEC , integer indicating the LOSS mecanism position inside NMEC * |
31 |
|
|
* vector, zero if not present * |
32 |
|
|
* * |
33 |
|
|
* * |
34 |
|
|
* NOTE: The IT variable is overwritten and the GSCHIT is used * |
35 |
|
|
* to account for the multi-tracks produced in an e.m. shower * |
36 |
|
|
* * |
37 |
|
|
* Called by: GUSTEP * |
38 |
|
|
* Author: Francesco Cafagna, 21/02/96 16.13.51 * |
39 |
|
|
* * |
40 |
|
|
************************************************************************ |
41 |
|
|
#include "gphit.inc" |
42 |
|
|
#include "gcunit.inc" |
43 |
|
|
*EM: |
44 |
|
|
PARAMETER (CALIB=0.0001085200) |
45 |
|
|
*END EM. |
46 |
|
|
INTEGER IACT,IS,ID,IPA,IT,NUMVOL(20),IMEC,IDHIT |
47 |
|
|
REAL DELOSS,PATH,TRAPAR(7),VHIT(NHCAL),XYZM(3),XYZD(3) |
48 |
|
|
REAL DELTA2,SIGMA2,SIGMA,GRNDM0,GPGAUS,PATHINI |
49 |
|
|
LOGICAL SAVE |
50 |
|
|
* |
51 |
|
|
* Track is inside a volume |
52 |
|
|
* |
53 |
|
|
IF(IACT.EQ.0) THEN |
54 |
|
|
IF(IMEC.GT.0) THEN |
55 |
|
|
SAVE = .TRUE. |
56 |
|
|
*EM: |
57 |
|
|
VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
58 |
|
|
* VHIT(4) = DELOSS + VHIT(4) |
59 |
|
|
*END EM |
60 |
|
|
ENDIF |
61 |
|
|
ENDIF |
62 |
|
|
* |
63 |
|
|
* Entering a new volume or is a new track |
64 |
|
|
* |
65 |
|
|
IF(IACT.EQ.1) THEN |
66 |
|
|
SAVE = .FALSE. |
67 |
|
|
CALL VZERO(VHIT,NHCAL) |
68 |
|
|
DO I=1,3 |
69 |
|
|
VHIT(I) = TRAPAR(I) |
70 |
|
|
ENDDO |
71 |
|
|
IF(IMEC.GT.0) THEN |
72 |
|
|
SAVE = .TRUE. |
73 |
|
|
*EM: |
74 |
|
|
VHIT(4) = DELOSS/CALIB |
75 |
|
|
* VHIT(4) = DELOSS |
76 |
|
|
*END EM |
77 |
|
|
ENDIF |
78 |
|
|
IDHIT = -1 |
79 |
|
|
* Store the particle and momentum if is the first track |
80 |
|
|
c IF(IT.EQ.1) THEN |
81 |
|
|
c VHIT(5) = IPA |
82 |
|
|
c VHIT(6) = TRAPAR(7) |
83 |
|
|
c ENDIF |
84 |
|
|
PATHINI = PATH |
85 |
|
|
ENDIF |
86 |
|
|
* |
87 |
|
|
* Track is exiting current volume |
88 |
|
|
* |
89 |
|
|
IF(IACT.EQ.2) THEN |
90 |
|
|
IF(IMEC.GT.0) THEN |
91 |
|
|
SAVE = .TRUE. |
92 |
|
|
*EM: |
93 |
|
|
VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
94 |
|
|
* VHIT(4) = DELOSS + VHIT(4) |
95 |
|
|
*END EM |
96 |
|
|
ENDIF |
97 |
|
|
#if defined(GPAMELA_NOGFLUCT) |
98 |
|
|
* |
99 |
|
|
* change in de/dx with gaussian convolution |
100 |
|
|
* see Hall paper: NIM 220 (1984) 356. |
101 |
|
|
* |
102 |
|
|
* FIRST: Look if the STOP mechanism is present |
103 |
|
|
* |
104 |
|
|
IF(IMEC.EQ.1) THEN |
105 |
|
|
* This particle has NOT been stopped. So gaussian energy spread... |
106 |
|
|
* Delta is in GeV^2/cm |
107 |
|
|
DELTA2=.5E-8 |
108 |
|
|
SIGMA2=DELTA2*(PATH - PATHINI) |
109 |
|
|
SIGMA=SQRT(SIGMA2) |
110 |
|
|
GRNDM0 = GPGAUS(0.) |
111 |
|
|
*EM: |
112 |
|
|
VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
113 |
|
|
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
114 |
|
|
*END EM |
115 |
|
|
IF(VHIT(4).LT.0.) VHIT(4)=0. |
116 |
|
|
ENDIF |
117 |
|
|
#endif |
118 |
|
|
* |
119 |
|
|
* Store the hit |
120 |
|
|
* |
121 |
|
|
IF(IDHIT.EQ.-1) THEN |
122 |
|
|
*ML: |
123 |
|
|
* IF(SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
124 |
|
|
IF(SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
125 |
|
|
*END ML. |
126 |
|
|
IF (IDHIT.EQ.0) THEN |
127 |
|
|
WRITE(CHMAIL,10000) IS,ID,IT |
128 |
|
|
CALL GMAIL(1,0) |
129 |
|
|
ENDIF |
130 |
|
|
ELSE |
131 |
|
|
WRITE(CHMAIL,10100) IS,ID,IT |
132 |
|
|
CALL GMAIL(1,0) |
133 |
|
|
ENDIF |
134 |
|
|
ENDIF |
135 |
|
|
* |
136 |
|
|
* Track is exiting the set up |
137 |
|
|
* |
138 |
|
|
IF(IACT.EQ.3) THEN |
139 |
|
|
* |
140 |
|
|
* Check if the hit have been previously stored or not |
141 |
|
|
* |
142 |
|
|
IF(IDHIT.LT.0) THEN |
143 |
|
|
IF(IMEC.GT.0) THEN |
144 |
|
|
SAVE = .TRUE. |
145 |
|
|
*EM: |
146 |
|
|
VHIT(4) = (DELOSS/CALIB) + VHIT(4) |
147 |
|
|
c VHIT(4) = DELOSS + VHIT(4) |
148 |
|
|
*END EM |
149 |
|
|
ENDIF |
150 |
|
|
#if defined(GPAMELA_NOGFLUCT) |
151 |
|
|
* |
152 |
|
|
* change in de/dx with gaussian convolution |
153 |
|
|
* see Hall paper: NIM 220 (1984) 356. |
154 |
|
|
* |
155 |
|
|
* FIRST: Look if the STOP mechanism is present |
156 |
|
|
* |
157 |
|
|
IF(IMEC.EQ.1) THEN |
158 |
|
|
* This particle has NOT been stopped. So gaussian energy spread... |
159 |
|
|
* Delta is in GeV^2/cm |
160 |
|
|
DELTA2=.5E-8 |
161 |
|
|
SIGMA2=DELTA2*(PATH - PATHINI) |
162 |
|
|
SIGMA=SQRT(SIGMA2) |
163 |
|
|
GRNDM0 = GPGAUS(0.) |
164 |
|
|
*EM: |
165 |
|
|
VHIT(4)=VHIT(4)+GRNDM0*SIGMA/CALIB |
166 |
|
|
c VHIT(4)=VHIT(4)+GRNDM0*SIGMA |
167 |
|
|
*END EM. |
168 |
|
|
IF(VHIT(4).LT.0.) VHIT(4)=0. |
169 |
|
|
ENDIF |
170 |
|
|
#endif |
171 |
|
|
* |
172 |
|
|
* Store the hit |
173 |
|
|
* |
174 |
|
|
IF(IDHIT.EQ.-1) THEN |
175 |
|
|
*ML |
176 |
|
|
* IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,4,IDHIT) |
177 |
|
|
IF (SAVE) CALL GSCHIT (IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
178 |
|
|
*END ML. |
179 |
|
|
IF (IDHIT.EQ.0) THEN |
180 |
|
|
WRITE(CHMAIL,10200) IS,ID,IT |
181 |
|
|
CALL GMAIL(1,0) |
182 |
|
|
ENDIF |
183 |
|
|
ELSE |
184 |
|
|
WRITE(CHMAIL,10300) IS,ID,IT |
185 |
|
|
CALL GMAIL(1,0) |
186 |
|
|
ENDIF |
187 |
|
|
ENDIF |
188 |
|
|
ENDIF |
189 |
|
|
10000 FORMAT(' GPUCAL error: HIT have not be stored for SET=' |
190 |
|
|
+ ,I4,', DET=',I4,', TRACK=',I6) |
191 |
|
|
10100 FORMAT(' GPUCAL error: HIT have not be initialized for SET=' |
192 |
|
|
+ ,I4,', DET=',I4,', TRACK=',I6) |
193 |
|
|
10200 FORMAT(' GPUCAL error: HIT have not be stored for SET=' |
194 |
|
|
+ ,I4,', DET=',I4,', TRACK=',I6) |
195 |
|
|
10300 FORMAT(' GPUCAL error: HIT have not be initialized for SET=' |
196 |
|
|
+ ,I4,', DET=',I4,', TRACK=',I6) |
197 |
|
|
RETURN |
198 |
|
|
END |