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