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 03/03/2000 15.39.06 by Francesco Cafagna |
8 |
*CMZ : 1.02/00 15/03/97 11.02.08 by Francesco Cafagna |
9 |
*CMZ : 1.00/02 04/04/96 16.47.16 by Francesco Cafagna |
10 |
*-- Author : Francesco Cafagna 21/02/96 |
11 |
SUBROUTINE GPUCAS(IACT,IS,ID,IPA,IT,DELOSS,TIME,PATH, |
12 |
+ TRAPAR,NUMVOL,IMEC) |
13 |
************************************************************************ |
14 |
* * |
15 |
* To collect and store the hit structure for CAS * |
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 * |
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 |
* * |
34 |
* Called by: GUSTEP * |
35 |
* Author: Francesco Cafagna, 21/02/96 16.13.51 * |
36 |
* * |
37 |
************************************************************************ |
38 |
#include "gphit.inc" |
39 |
#include "gcunit.inc" |
40 |
* |
41 |
INTEGER IACT,IS,ID,IPA,IT,NUMVOL(20),IMEC,IDHIT |
42 |
REAL DELOSS,TIME,PATH,TRAPAR(7),VHIT(NHCAS) |
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 |
VHIT(7) = DELOSS + VHIT(7) |
51 |
ENDIF |
52 |
ENDIF |
53 |
* |
54 |
* Entering a new volume or is a new track |
55 |
* |
56 |
IF(IACT.EQ.1) THEN |
57 |
SAVE = .FALSE. |
58 |
CALL VZERO(VHIT,NHCAS) |
59 |
DO I=1,3 |
60 |
VHIT(I) = TRAPAR(I) |
61 |
ENDDO |
62 |
IF(IMEC.GT.0) THEN |
63 |
SAVE = .TRUE. |
64 |
VHIT(7) = DELOSS |
65 |
ENDIF |
66 |
VHIT(8) = TIME |
67 |
VHIT(9) = PATH |
68 |
VHIT(10)= IPA |
69 |
VHIT(11)= TRAPAR(7) |
70 |
IDHIT = -1 |
71 |
ENDIF |
72 |
* |
73 |
* Track is exiting current volume |
74 |
* |
75 |
IF(IACT.EQ.2) THEN |
76 |
DO I=1,3 |
77 |
VHIT(I+3) = TRAPAR(I) |
78 |
#if defined(GPAMELA_INTER) |
79 |
* interactive case, we need the average position |
80 |
VHIT(I) = (VHIT(I) + VHIT(I+3) )/2. |
81 |
#endif |
82 |
ENDDO |
83 |
IF(IMEC.GT.0) THEN |
84 |
SAVE = .TRUE. |
85 |
VHIT(7) = DELOSS + VHIT(7) |
86 |
ENDIF |
87 |
VHIT(8) = (TIME + VHIT(8))/2. |
88 |
VHIT(9) = PATH - VHIT(9) |
89 |
VHIT(11)= (TRAPAR(7) + VHIT(11))/2. |
90 |
* |
91 |
* Store the hit |
92 |
* |
93 |
IF(IDHIT.EQ.-1) THEN |
94 |
IF(SAVE) CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
95 |
IF (IDHIT.EQ.0) THEN |
96 |
WRITE(CHMAIL,10000) IS,ID,IT |
97 |
CALL GMAIL(1,0) |
98 |
ENDIF |
99 |
ELSE |
100 |
WRITE(CHMAIL,10100) IS,ID,IT |
101 |
CALL GMAIL(1,0) |
102 |
ENDIF |
103 |
ENDIF |
104 |
* |
105 |
* Track is exiting the set up |
106 |
* |
107 |
IF(IACT.EQ.3) THEN |
108 |
* |
109 |
* Check if the hit have been previously stored or not |
110 |
* |
111 |
IF(IDHIT.LT.0) THEN |
112 |
DO I=1,3 |
113 |
VHIT(I+3) = TRAPAR(I) |
114 |
#if defined(GPAMELA_INTER) |
115 |
* interactive case, we need the average position |
116 |
VHIT(I) = (VHIT(I) + VHIT(I+3) )/2. |
117 |
#endif |
118 |
ENDDO |
119 |
IF(IMEC.GT.0) THEN |
120 |
SAVE = .TRUE. |
121 |
VHIT(7) = DELOSS + VHIT(7) |
122 |
ENDIF |
123 |
VHIT(8) = (TIME + VHIT(8))/2. |
124 |
VHIT(9) = PATH - VHIT(9) |
125 |
VHIT(11)= (TRAPAR(7) + VHIT(11))/2. |
126 |
* |
127 |
* Store the hit |
128 |
* |
129 |
IF(IDHIT.EQ.-1) THEN |
130 |
IF(SAVE) CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT) |
131 |
IF (IDHIT.EQ.0) THEN |
132 |
WRITE(CHMAIL,10200) IS,ID,IT |
133 |
CALL GMAIL(1,0) |
134 |
ENDIF |
135 |
ELSE |
136 |
WRITE(CHMAIL,10300) IS,ID,IT |
137 |
CALL GMAIL(1,0) |
138 |
ENDIF |
139 |
ENDIF |
140 |
ENDIF |
141 |
10000 FORMAT(' GPUCAS error: HIT have not be stored for SET=' |
142 |
+ ,I4,', DET=',I4,', TRACK=',I6) |
143 |
10100 FORMAT(' GPUCAS error: HIT have not be initialized for SET=' |
144 |
+ ,I4,', DET=',I4,', TRACK=',I6) |
145 |
10200 FORMAT(' GPUCAS error: HIT have not be stored for SET=' |
146 |
+ ,I4,', DET=',I4,', TRACK=',I6) |
147 |
10300 FORMAT(' GPUCAS error: HIT have not be initialized for SET=' |
148 |
+ ,I4,', DET=',I4,', TRACK=',I6) |
149 |
RETURN |
150 |
END |