9 |
& xout(22),yout(22),zin(22) |
& xout(22),yout(22),zin(22) |
10 |
C |
C |
11 |
REAL ZALIG, DISTX |
REAL ZALIG, DISTX |
12 |
REAL PIANO(22), VARFIT(2) |
REAL PIANO(22) |
|
REAL TBAR(2,22), CBAR(2,22) |
|
13 |
C |
C |
14 |
INTEGER m, i, T, IFAIL |
INTEGER m, i, IFAIL |
|
INTEGER NPFIT(2) |
|
15 |
C |
C |
16 |
REAL hmemor(9000000) |
REAL hmemor(9000000) |
17 |
INTEGER Iquest(100) |
INTEGER Iquest(100) |
40 |
C |
C |
41 |
C BEGIN WITH THE FISRT TRACK |
C BEGIN WITH THE FISRT TRACK |
42 |
C |
C |
|
T = 1 |
|
|
C |
|
43 |
10 CONTINUE |
10 CONTINUE |
44 |
C |
C |
45 |
C COPY THE ALFA VECTOR FROM AL_PP TO AL_P FOR THE TRACK "T" |
C COPY THE ALFA VECTOR FROM AL_PP TO AL_P FOR THE TRACK "T" |
46 |
C |
C |
47 |
do m = 1, 5 |
do m = 1, 5 |
48 |
al_p(m) = al_pp(t,m) |
al_p(m) = al_pp(m) |
49 |
enddo |
enddo |
50 |
if (al_p(5).eq.0.) THEN |
if (al_p(5).eq.0.) THEN |
51 |
PRINT *,' MYDETECTOR2 - WARNING F77: track with R = 0, discarded' |
PRINT *,' MYDETECTOR2 - WARNING F77: track with R = 0, discarded' |
66 |
ZIN(I) = distx / 10. |
ZIN(I) = distx / 10. |
67 |
enddo |
enddo |
68 |
IFAIL = 0 |
IFAIL = 0 |
69 |
call TRACK(22,ZIN,XOUT,YOUT,AL_P,IFAIL) |
call DOTRACK(22,ZIN,XOUT,YOUT,AL_P,IFAIL) |
70 |
if(IFAIL.ne.0)then |
if(IFAIL.ne.0)then |
71 |
GOOD = 0 |
GOOD = 0 |
72 |
print *,' MYDETECTOR2 - WARNING F77: tracking failed ' |
print *,' MYDETECTOR2 - WARNING F77: tracking failed ' |
87 |
969 continue |
969 continue |
88 |
|
|
89 |
C |
C |
90 |
C HERE WE MAKE SOME KIND OF ALTERNATIVE FIT WITH OUR INSTRUMENT TO COMPARE IT WITH THE TRACK COMING FROM TRACKER |
|
|
C |
|
|
|
|
|
C |
|
|
C IF WE HAVE A GOOD FIT FROM OUR INSTRUMENT (NPFIT(2).GT.15.AND.VARFIT(2).LT.1000) AND WE HAVE AN IMAGE TRACK WE CAN TRY TO SEE IF WE ARE CLOSER TO THE IMAGE OR TO THE MAIN TRACK |
|
|
C |
|
|
IF (GOOD.EQ.1.AND.NPFIT(2).GT.15.AND.VARFIT(2).LT.1000 |
|
|
& .AND.TRKCHI2.EQ.1) THEN |
|
|
IF (ABS(TBAR(2,1)-CBAR(2,1))<40.) THEN ! HERE WE CHECK IF THE TWO TRACKS ARE THE SAME PHYSICS TRACK |
|
|
C |
|
|
C GOOD, THE TWO TRACKS COINCIDE |
|
|
C |
|
|
IF (T.EQ.2) TRKCHI2 = 2 |
|
|
GOTO 6996 |
|
|
ELSE |
|
|
C |
|
|
C IT IS NOT A GOOD FIT BUT WE HAVE AN IMAGE AND THIS IS THE FIRST TRACK |
|
|
C |
|
|
IF (T.EQ.1) THEN |
|
|
T = 2 |
|
|
GOTO 10 |
|
|
ENDIF |
|
|
C |
|
|
C IT IS NOT A GOOD FIT BUT WE HAVE AN IMAGE AND THIS IS THE SECOND TRACK, USE THE FIRST ONE |
|
|
C |
|
|
IF (T.EQ.2) THEN |
|
|
TRKCHI2 = -1 |
|
|
T = 1 |
|
|
GOTO 10 |
|
|
ENDIF |
|
|
ENDIF |
|
|
C |
|
|
ENDIF |
|
|
C |
|
|
IF (T.EQ.1.AND.TRKCHI2.EQ.1) THEN |
|
|
GOOD = 1 |
|
|
T = 2 |
|
|
GOTO 10 |
|
|
ENDIF |
|
|
C |
|
|
|
|
|
6996 CONTINUE |
|
91 |
C |
C |
92 |
C HERE WE DETERMINE TRACK-RELATED VARIABLES |
C HERE WE DETERMINE TRACK-RELATED VARIABLES |
93 |
C |
C |