1 |
cafagna |
3.1 |
* |
2 |
cafagna |
3.3 |
* $Id: gputof.F,v 3.2 2006/05/02 18:00:11 cafagna Exp $ |
3 |
cafagna |
3.2 |
* |
4 |
|
|
* $Log: gputof.F,v $ |
5 |
cafagna |
3.3 |
* Revision 3.2 2006/05/02 18:00:11 cafagna |
6 |
|
|
* Bugs fixed in TOF set definition, TOF hit back to the original naming scheme |
7 |
|
|
* |
8 |
cafagna |
3.2 |
* Revision 3.1.1.1 2002/07/11 16:02:01 cafagna |
9 |
|
|
* First GPAMELA release on CVS |
10 |
cafagna |
3.1 |
* |
11 |
|
|
* |
12 |
|
|
*CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola |
13 |
|
|
*CMZ : 2.00/00 25/02/2000 19.34.00 by Francesco Cafagna |
14 |
|
|
*CMZ : 1.02/00 06/03/97 21.46.02 by Francesco Cafagna |
15 |
|
|
*CMZ : 1.00/02 04/04/96 16.47.15 by Francesco Cafagna |
16 |
|
|
*-- Author : Francesco Cafagna 21/02/96 |
17 |
|
|
SUBROUTINE GPUTOF(IACT,IS,ID,IPA,IT,DELOSS,TIME,PATH, |
18 |
|
|
+ TRAPAR,NUMVOL,IMEC) |
19 |
|
|
************************************************************************ |
20 |
|
|
* * |
21 |
|
|
* To collect and store the hit structure for TOF * |
22 |
|
|
* * |
23 |
|
|
* Variables definition: * |
24 |
|
|
* IN: * |
25 |
|
|
* IACT, integer specifing the action to be taken. It is the INWVOL * |
26 |
|
|
* variable in GCTRAK common * |
27 |
|
|
* IS , set number * |
28 |
|
|
* ID , detector number * |
29 |
|
|
* IPA , particle number * |
30 |
|
|
* IT , track number * |
31 |
|
|
* DELOSS, energy loss in the step * |
32 |
|
|
* TIME , current time of flight in seconds * |
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 |
|
|
* Called by: GUSTEP * |
40 |
|
|
* Author: Francesco Cafagna, 21/02/96 16.13.51 * |
41 |
|
|
* * |
42 |
|
|
************************************************************************ |
43 |
|
|
#include "gphit.inc" |
44 |
|
|
#include "gcunit.inc" |
45 |
|
|
#include "gpsed.inc" |
46 |
|
|
* |
47 |
|
|
INTEGER IACT,IS,ID,IPA,IT,NUMVOL(20),IMEC,IDHIT |
48 |
|
|
REAL DELOSS,TIME,PATH,TRAPAR(7),VHIT(NHTOF) |
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 |
cafagna |
3.2 |
VHIT(7) = DELOSS + VHIT(7) |
57 |
cafagna |
3.1 |
ENDIF |
58 |
|
|
ENDIF |
59 |
|
|
* |
60 |
|
|
* Entering a new volume or is a new track |
61 |
|
|
* |
62 |
|
|
IF(IACT.EQ.1) THEN |
63 |
|
|
SAVE = .FALSE. |
64 |
|
|
CALL VZERO(VHIT,NHTOF) |
65 |
|
|
DO I=1,3 |
66 |
|
|
VHIT(I) = TRAPAR(I) |
67 |
|
|
ENDDO |
68 |
|
|
IF(IMEC.GT.0) THEN |
69 |
|
|
SAVE = .TRUE. |
70 |
cafagna |
3.2 |
VHIT(7) = DELOSS |
71 |
cafagna |
3.1 |
ENDIF |
72 |
|
|
VHIT(8) = TIME |
73 |
|
|
VHIT(9) = PATH |
74 |
|
|
VHIT(10) = IPA |
75 |
cafagna |
3.2 |
VHIT(11) = TRAPAR(7) |
76 |
cafagna |
3.1 |
IDHIT = -1 |
77 |
|
|
ENDIF |
78 |
|
|
* |
79 |
|
|
* Track is exiting current volume |
80 |
|
|
* |
81 |
|
|
IF(IACT.EQ.2) THEN |
82 |
|
|
DO I=1,3 |
83 |
|
|
VHIT(I+3) = TRAPAR(I) |
84 |
|
|
#if defined(GPAMELA_INTER) |
85 |
|
|
* interactive case, we need the average position |
86 |
|
|
VHIT(I) = (VHIT(I) + VHIT(I+3) )/2. |
87 |
|
|
#endif |
88 |
|
|
ENDDO |
89 |
|
|
IF(IMEC.GT.0) THEN |
90 |
|
|
SAVE = .TRUE. |
91 |
cafagna |
3.2 |
VHIT(7) = DELOSS +VHIT(7) |
92 |
cafagna |
3.1 |
ENDIF |
93 |
|
|
VHIT(8) = (TIME + VHIT(8))/2. |
94 |
cafagna |
3.3 |
VHIT(9) = (PATH + VHIT(9))/2. |
95 |
|
|
C VHIT(9) = PATH - VHIT(9) |
96 |
cafagna |
3.2 |
c$$$ VHIT(11) = (TRAPAR(7) + VHIT(11))/2. |
97 |
cafagna |
3.1 |
* |
98 |
|
|
* Store the hit |
99 |
|
|
* |
100 |
|
|
IF(IDHIT.EQ.-1) THEN |
101 |
|
|
IF (SAVE) THEN |
102 |
|
|
IF(IS.EQ.ISS4) THEN |
103 |
|
|
CALL GSCHIT(IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
104 |
|
|
ELSE |
105 |
|
|
CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
106 |
|
|
ENDIF |
107 |
|
|
ENDIF |
108 |
|
|
IF (IDHIT.EQ.0) THEN |
109 |
|
|
WRITE(CHMAIL,10000) IS,ID,IT |
110 |
|
|
CALL GMAIL(1,0) |
111 |
|
|
ENDIF |
112 |
|
|
ELSE |
113 |
|
|
WRITE(CHMAIL,10100) IS,ID,IT |
114 |
|
|
CALL GMAIL(1,0) |
115 |
|
|
ENDIF |
116 |
|
|
ENDIF |
117 |
|
|
* |
118 |
|
|
* Track is exiting the set up |
119 |
|
|
* |
120 |
|
|
IF(IACT.EQ.3) THEN |
121 |
|
|
* |
122 |
|
|
* Check if the hit have been previously stored or not |
123 |
|
|
* |
124 |
|
|
IF(IDHIT.LT.0) THEN |
125 |
|
|
DO I=1,3 |
126 |
|
|
VHIT(I+3) = TRAPAR(I) |
127 |
|
|
#if defined(GPAMELA_INTER) |
128 |
|
|
* interactive case, we need the average position |
129 |
|
|
VHIT(I) = (VHIT(I) + VHIT(I+3) )/2. |
130 |
|
|
#endif |
131 |
|
|
ENDDO |
132 |
|
|
IF(IMEC.GT.0) THEN |
133 |
|
|
SAVE = .TRUE. |
134 |
cafagna |
3.2 |
VHIT(7) = DELOSS + VHIT(7) |
135 |
cafagna |
3.1 |
ENDIF |
136 |
|
|
VHIT(8) = (TIME + VHIT(8))/2. |
137 |
cafagna |
3.3 |
VHIT(9) = (PATH + VHIT(9))/2. |
138 |
|
|
C VHIT(9) = PATH - VHIT(9) |
139 |
cafagna |
3.2 |
c$$$ VHIT(11) = (TRAPAR(7) + VHIT(11))/2. |
140 |
cafagna |
3.1 |
* |
141 |
|
|
* Store the hit |
142 |
|
|
* |
143 |
|
|
IF(IDHIT.EQ.-1) THEN |
144 |
|
|
IF (SAVE) THEN |
145 |
|
|
IF(IS.EQ.ISS4) THEN |
146 |
|
|
CALL GSCHIT(IS,ID,1,NUMVOL,VHIT,1,IDHIT) |
147 |
|
|
ELSE |
148 |
|
|
CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
149 |
|
|
ENDIF |
150 |
|
|
ENDIF |
151 |
|
|
IF (IDHIT.EQ.0) THEN |
152 |
|
|
WRITE(CHMAIL,10200) IS,ID,IT |
153 |
|
|
CALL GMAIL(1,0) |
154 |
|
|
ENDIF |
155 |
|
|
ELSE |
156 |
|
|
WRITE(CHMAIL,10300) IS,ID,IT |
157 |
|
|
CALL GMAIL(1,0) |
158 |
|
|
ENDIF |
159 |
|
|
ENDIF |
160 |
|
|
ENDIF |
161 |
|
|
10000 FORMAT(' GPUTOF error: HIT have not be stored for SET=' |
162 |
|
|
+ ,I4,', DET=',I4,', TRACK=',I6) |
163 |
|
|
10100 FORMAT(' GPUTOF error: HIT have not be initialized for SET=' |
164 |
|
|
+ ,I4,', DET=',I4,', TRACK=',I6) |
165 |
|
|
10200 FORMAT(' GPUTOF error: HIT have not be stored for SET=' |
166 |
|
|
+ ,I4,', DET=',I4,', TRACK=',I6) |
167 |
|
|
10300 FORMAT(' GPUTOF error: HIT have not be initialized for SET=' |
168 |
|
|
+ ,I4,', DET=',I4,', TRACK=',I6) |
169 |
|
|
RETURN |
170 |
|
|
END |
171 |
|
|
|
172 |
|
|
|
173 |
|
|
|
174 |
|
|
|
175 |
|
|
|
176 |
|
|
|
177 |
|
|
|
178 |
|
|
|
179 |
|
|
|
180 |
|
|
|
181 |
|
|
|