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