/[PAMELA software]/gpamela/gptof/gputof.F
ViewVC logotype

Contents of /gpamela/gptof/gputof.F

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3.2 - (show annotations) (download)
Tue May 2 18:00:11 2006 UTC (18 years, 7 months ago) by cafagna
Branch: MAIN
CVS Tags: v4r6, v4r7, v4r8, v4r9, v4r12, v4r10, v4r11
Changes since 3.1: +12 -61 lines
Bugs fixed in TOF set definition, TOF hit back to the original naming scheme

1 *
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 *
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 VHIT(7) = DELOSS + VHIT(7)
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 VHIT(7) = DELOSS
68 ENDIF
69 VHIT(8) = TIME
70 VHIT(9) = PATH
71 VHIT(10) = IPA
72 VHIT(11) = TRAPAR(7)
73 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 VHIT(7) = DELOSS +VHIT(7)
89 ENDIF
90 VHIT(8) = (TIME + VHIT(8))/2.
91 VHIT(9) = PATH - VHIT(9)
92 c$$$ VHIT(11) = (TRAPAR(7) + VHIT(11))/2.
93 *
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 VHIT(7) = DELOSS + VHIT(7)
131 ENDIF
132 VHIT(8) = (TIME + VHIT(8))/2.
133 VHIT(9) = PATH - VHIT(9)
134 c$$$ VHIT(11) = (TRAPAR(7) + VHIT(11))/2.
135 *
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

  ViewVC Help
Powered by ViewVC 1.1.23