1 |
***************************************************************************** |
2 |
INTEGER FUNCTION MYDECTRK() |
3 |
c |
4 |
IMPLICIT NONE |
5 |
C |
6 |
INCLUDE 'COMMON.TXT' |
7 |
C |
8 |
DOUBLE PRECISION al_p(5), |
9 |
& xout(22),yout(22),zin(22) |
10 |
C |
11 |
REAL ZALIG, DISTX |
12 |
REAL PIANO(22) |
13 |
C |
14 |
INTEGER m, i, IFAIL |
15 |
C |
16 |
REAL hmemor(9000000) |
17 |
INTEGER Iquest(100) |
18 |
C |
19 |
COMMON / pawcd / hmemor |
20 |
save / pawcd / |
21 |
C |
22 |
Common / QUESTd / Iquest |
23 |
save / questd / |
24 |
C |
25 |
C Begin ! |
26 |
C |
27 |
MYDECTRK = 0 |
28 |
C |
29 |
C Z positions where to calculate the track |
30 |
C |
31 |
PIANO(1) = 0. |
32 |
DO I = 2, 22 |
33 |
IF ( MOD(I,2).EQ.0 ) THEN |
34 |
PIANO(I) = PIANO(I-1) - 8.09 |
35 |
ELSE |
36 |
PIANO(I) = PIANO(I-1) - 10.09 |
37 |
ENDIF |
38 |
ENDDO |
39 |
ZALIG = -263. |
40 |
C |
41 |
C BEGIN WITH THE FISRT TRACK |
42 |
C |
43 |
10 CONTINUE |
44 |
C |
45 |
C COPY THE ALFA VECTOR FROM AL_PP TO AL_P FOR THE TRACK "T" |
46 |
C |
47 |
do m = 1, 5 |
48 |
al_p(m) = al_pp(m) |
49 |
enddo |
50 |
if (al_p(5).eq.0.) THEN |
51 |
PRINT *,' MYDETECTOR2 - WARNING F77: track with R = 0, discarded' |
52 |
GOTO 969 |
53 |
ENDIF |
54 |
C |
55 |
C CALL THE TRACKING ROUTINE |
56 |
C |
57 |
DO M = 1,2 |
58 |
DO I = 1,22 |
59 |
XOUT(I) = 0. |
60 |
YOUT(I) = 0. |
61 |
IF (MOD(M,2).EQ.0) THEN |
62 |
DISTX = PIANO(I) + ZALIG |
63 |
ELSE |
64 |
DISTX = PIANO(I) - 5.81 + ZALIG |
65 |
ENDIF |
66 |
ZIN(I) = distx / 10. |
67 |
enddo |
68 |
IFAIL = 0 |
69 |
call DOTRACK(22,ZIN,XOUT,YOUT,AL_P,IFAIL) |
70 |
if(IFAIL.ne.0)then |
71 |
GOOD = 0 |
72 |
print *,' MYDETECTOR2 - WARNING F77: tracking failed ' |
73 |
goto 969 |
74 |
endif |
75 |
DO I = 1, 22 |
76 |
C |
77 |
C CHECK IF XOUT OR YOUT ARE NaN |
78 |
C |
79 |
IF (XOUT(I).NE.XOUT(I).OR.YOUT(I).NE.YOUT(I)) THEN |
80 |
print *, |
81 |
& ' MYDETECTOR2 - WARNING F77: tracking error (NaN values)' |
82 |
GOTO 969 |
83 |
ENDIF |
84 |
C |
85 |
ENDDO |
86 |
ENDDO |
87 |
969 continue |
88 |
|
89 |
C |
90 |
|
91 |
C |
92 |
C HERE WE DETERMINE TRACK-RELATED VARIABLES |
93 |
C |
94 |
MYTRKVAR = 18. |
95 |
|
96 |
50 CONTINUE |
97 |
C |
98 |
RETURN |
99 |
END |
100 |
|
101 |
|