/[PAMELA software]/gpamela/gpnd/gpund.F
ViewVC logotype

Contents of /gpamela/gpnd/gpund.F

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Dec 20 12:21:05 2005 UTC (18 years, 11 months ago) by cafagna
Branch: MAIN
gpnd directory added along with ND files

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

  ViewVC Help
Powered by ViewVC 1.1.23