1 |
* |
2 |
* $Id$ |
3 |
* |
4 |
* $Log$ |
5 |
* |
6 |
*CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola |
7 |
*CMZ : 2.00/00 25/02/2000 19.34.00 by Francesco Cafagna |
8 |
*CMZ : 1.02/00 06/03/97 21.46.02 by Francesco Cafagna |
9 |
*CMZ : 1.00/02 04/04/96 16.47.15 by Francesco Cafagna |
10 |
*-- Author : Francesco Cafagna 21/02/96 |
11 |
SUBROUTINE GPUTOF(IACT,IS,ID,IPA,IT,DELOSS,TIME,PATH, |
12 |
+ TRAPAR,NUMVOL,IMEC) |
13 |
************************************************************************ |
14 |
* * |
15 |
* To collect and store the hit structure for TOF * |
16 |
* * |
17 |
* Variables definition: * |
18 |
* IN: * |
19 |
* IACT, integer specifing the action to be taken. It is the INWVOL * |
20 |
* variable in GCTRAK common * |
21 |
* IS , set number * |
22 |
* ID , detector number * |
23 |
* IPA , particle number * |
24 |
* IT , track number * |
25 |
* DELOSS, energy loss in the step * |
26 |
* TIME , current time of flight in seconds * |
27 |
* PATH , current track lenght * |
28 |
* TRAPAR, track parameter, is the VECT vector in GCTRAK common * |
29 |
* NUMVOL, integr array of numbers identifying the DETECTOR * |
30 |
* IMEC , integer indicating the LOSS mecanism position inside NMEC * |
31 |
* vector, zero if not present * |
32 |
* * |
33 |
* Called by: GUSTEP * |
34 |
* Author: Francesco Cafagna, 21/02/96 16.13.51 * |
35 |
* * |
36 |
************************************************************************ |
37 |
#include "gphit.inc" |
38 |
#include "gcunit.inc" |
39 |
#include "gpsed.inc" |
40 |
* |
41 |
INTEGER IACT,IS,ID,IPA,IT,NUMVOL(20),IMEC,IDHIT |
42 |
REAL DELOSS,TIME,PATH,TRAPAR(7),VHIT(NHTOF) |
43 |
LOGICAL SAVE |
44 |
* |
45 |
* Track is inside a volume |
46 |
* |
47 |
IF(IACT.EQ.0) THEN |
48 |
IF(IMEC.GT.0) THEN |
49 |
SAVE = .TRUE. |
50 |
*ML: |
51 |
* VHIT(7) = DELOSS + VHIT(7) |
52 |
VHIT(11) = DELOSS + VHIT(11) |
53 |
*END ML. |
54 |
ENDIF |
55 |
ENDIF |
56 |
* |
57 |
* Entering a new volume or is a new track |
58 |
* |
59 |
IF(IACT.EQ.1) THEN |
60 |
SAVE = .FALSE. |
61 |
CALL VZERO(VHIT,NHTOF) |
62 |
DO I=1,3 |
63 |
VHIT(I) = TRAPAR(I) |
64 |
ENDDO |
65 |
IF(IMEC.GT.0) THEN |
66 |
SAVE = .TRUE. |
67 |
*ML: |
68 |
VHIT(11) = DELOSS |
69 |
* VHIT(7) = DELOSS |
70 |
*END ML. |
71 |
ENDIF |
72 |
VHIT(8) = TIME |
73 |
VHIT(9) = PATH |
74 |
VHIT(10) = IPA |
75 |
*ML: |
76 |
* VHIT(11) = TRAPAR(7) |
77 |
VHIT(7) = TRAPAR(7) |
78 |
*END ML. |
79 |
IDHIT = -1 |
80 |
ENDIF |
81 |
* |
82 |
* Track is exiting current volume |
83 |
* |
84 |
IF(IACT.EQ.2) THEN |
85 |
DO I=1,3 |
86 |
VHIT(I+3) = TRAPAR(I) |
87 |
#if defined(GPAMELA_INTER) |
88 |
* interactive case, we need the average position |
89 |
VHIT(I) = (VHIT(I) + VHIT(I+3) )/2. |
90 |
#endif |
91 |
ENDDO |
92 |
IF(IMEC.GT.0) THEN |
93 |
SAVE = .TRUE. |
94 |
*ML: |
95 |
* VHIT(7) = DELOSS + VHIT(7) |
96 |
VHIT(11) = DELOSS +VHIT(11) |
97 |
*END ML. |
98 |
ENDIF |
99 |
VHIT(8) = (TIME + VHIT(8))/2. |
100 |
VHIT(9) = PATH - VHIT(9) |
101 |
*ML: |
102 |
* VHIT(11) = (TRAPAR(7) + VHIT(11))/2. |
103 |
VHIT(7) = (TRAPAR(7) + VHIT(7))/2. |
104 |
*END ML. |
105 |
* |
106 |
* Store the hit |
107 |
* |
108 |
IF(IDHIT.EQ.-1) THEN |
109 |
*ML: |
110 |
* IF (SAVE) CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
111 |
* IF (IDHIT.EQ.0) THEN |
112 |
* WRITE(CHMAIL,10000) IS,ID,IT |
113 |
* CALL GMAIL(1,0) |
114 |
* ENDIF |
115 |
* ELSE |
116 |
* WRITE(CHMAIL,10100) IS,ID,IT |
117 |
* CALL GMAIL(1,0) |
118 |
* ENDIF |
119 |
IF (SAVE) THEN |
120 |
IF(IS.EQ.ISS4) THEN |
121 |
CALL GSCHIT(IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
122 |
ELSE |
123 |
CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
124 |
ENDIF |
125 |
ENDIF |
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 |
* END ML. |
135 |
ENDIF |
136 |
* |
137 |
* Track is exiting the set up |
138 |
* |
139 |
IF(IACT.EQ.3) THEN |
140 |
* |
141 |
* Check if the hit have been previously stored or not |
142 |
* |
143 |
IF(IDHIT.LT.0) THEN |
144 |
DO I=1,3 |
145 |
VHIT(I+3) = TRAPAR(I) |
146 |
#if defined(GPAMELA_INTER) |
147 |
* interactive case, we need the average position |
148 |
VHIT(I) = (VHIT(I) + VHIT(I+3) )/2. |
149 |
#endif |
150 |
ENDDO |
151 |
IF(IMEC.GT.0) THEN |
152 |
SAVE = .TRUE. |
153 |
*ML: |
154 |
* VHIT(7) = DELOSS + VHIT(7) |
155 |
VHIT(11) = DELOSS + VHIT(11) |
156 |
*END ML. |
157 |
ENDIF |
158 |
VHIT(8) = (TIME + VHIT(8))/2. |
159 |
VHIT(9) = PATH - VHIT(9) |
160 |
*ML: |
161 |
* VHIT(11) = (TRAPAR(7) + VHIT(11))/2. |
162 |
VHIT(7) = (TRAPAR(7) + VHIT(7))/2. |
163 |
*END ML. |
164 |
* |
165 |
* Store the hit |
166 |
* |
167 |
IF(IDHIT.EQ.-1) THEN |
168 |
*ML: |
169 |
* IF (SAVE) CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
170 |
* IF (IDHIT.EQ.0) THEN |
171 |
* WRITE(CHMAIL,10200) IS,ID,IT |
172 |
* CALL GMAIL(1,0) |
173 |
* ENDIF |
174 |
* ELSE |
175 |
* WRITE(CHMAIL,10300) IS,ID,IT |
176 |
* CALL GMAIL(1,0) |
177 |
* ENDIF |
178 |
IF (SAVE) THEN |
179 |
IF(IS.EQ.ISS4) THEN |
180 |
CALL GSCHIT(IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
181 |
ELSE |
182 |
CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
183 |
ENDIF |
184 |
ENDIF |
185 |
IF (IDHIT.EQ.0) THEN |
186 |
WRITE(CHMAIL,10200) IS,ID,IT |
187 |
CALL GMAIL(1,0) |
188 |
ENDIF |
189 |
ELSE |
190 |
WRITE(CHMAIL,10300) IS,ID,IT |
191 |
CALL GMAIL(1,0) |
192 |
ENDIF |
193 |
*END ML. |
194 |
* IF (SAVE) CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
195 |
* IF (IDHIT.EQ.0) THEN |
196 |
* WRITE(CHMAIL,10200) IS,ID,IT |
197 |
* CALL GMAIL(1,0) |
198 |
* ENDIF |
199 |
* ELSE |
200 |
* WRITE(CHMAIL,10300) IS,ID,IT |
201 |
* CALL GMAIL(1,0) |
202 |
* ENDIF |
203 |
ENDIF |
204 |
ENDIF |
205 |
10000 FORMAT(' GPUTOF error: HIT have not be stored for SET=' |
206 |
+ ,I4,', DET=',I4,', TRACK=',I6) |
207 |
10100 FORMAT(' GPUTOF error: HIT have not be initialized for SET=' |
208 |
+ ,I4,', DET=',I4,', TRACK=',I6) |
209 |
10200 FORMAT(' GPUTOF error: HIT have not be stored for SET=' |
210 |
+ ,I4,', DET=',I4,', TRACK=',I6) |
211 |
10300 FORMAT(' GPUTOF error: HIT have not be initialized for SET=' |
212 |
+ ,I4,', DET=',I4,', TRACK=',I6) |
213 |
RETURN |
214 |
END |
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|