21 |
REAL ax,bx,eax,ebx,chi2x |
REAL ax,bx,eax,ebx,chi2x |
22 |
REAL ay,by,eay,eby,chi2y |
REAL ay,by,eay,eby,chi2y |
23 |
REAL parzen3, TMISD |
REAL parzen3, TMISD |
24 |
INTEGER Nfitx,Nfity |
INTEGER Nfitx,Nfity, MNPLA |
25 |
C |
C |
26 |
INTEGER INDEX, NTOT(2), NPIANI, GTR |
INTEGER INDEX, NTOT(2), NPIANI, GTR |
27 |
INTEGER j, m, i, IWPL(2), timpx, timpy, T, nn |
INTEGER j, m, i, IWPL(2), timpx, timpy, T, nn |
92 |
QMEAN = 0. |
QMEAN = 0. |
93 |
C SELFTRIGGER = 0 |
C SELFTRIGGER = 0 |
94 |
C |
C |
95 |
C BEGIN WITH THE FISRT TRACK IF WE HAVE A TRACK FROM TRACKER |
C BEGIN WITH THE FIRST TRACK IF WE HAVE A TRACK FROM TRACKER |
96 |
C |
C |
97 |
T = 1 |
T = 1 |
98 |
C |
C |
147 |
TY = TAN(ASIN(AL_P(3))) * SIN(AL_P(4)) |
TY = TAN(ASIN(AL_P(3))) * SIN(AL_P(4)) |
148 |
DO I = 1, NPLA |
DO I = 1, NPLA |
149 |
NN = 0 |
NN = 0 |
150 |
IF (M.EQ.2) NN = 1 |
c IF (M.EQ.2) NN = 1 |
151 |
IF (MOD(I,2).EQ.NN) THEN |
IF (MOD(I,2).EQ.NN) THEN |
152 |
IF (REVERSE.EQ.0) THEN |
IF (REVERSE.EQ.0) THEN |
|
SHIFT = +0.5 |
|
|
ELSE |
|
153 |
SHIFT = -0.5 |
SHIFT = -0.5 |
154 |
|
ELSE |
155 |
|
SHIFT = +0.5 |
156 |
ENDIF |
ENDIF |
157 |
ELSE |
ELSE |
158 |
IF (REVERSE.EQ.0) THEN |
IF (REVERSE.EQ.0) THEN |
|
SHIFT = -0.5 |
|
|
ELSE |
|
159 |
SHIFT = +0.5 |
SHIFT = +0.5 |
160 |
|
ELSE |
161 |
|
SHIFT = -0.5 |
162 |
ENDIF |
ENDIF |
163 |
ENDIF |
ENDIF |
164 |
C |
C |
273 |
IF (NPCFIT(M).GE.2) THEN |
IF (NPCFIT(M).GE.2) THEN |
274 |
IF (M.EQ.1) THEN |
IF (M.EQ.1) THEN |
275 |
VARCFIT(1) = CHI2X |
VARCFIT(1) = CHI2X |
276 |
IMPX = AX ! PAMELA REF |
IMPX = AX + BX * (ZALIG/10.) ! PAMELA REF |
277 |
TANX = BX |
TANX = BX |
278 |
ELSE |
ELSE |
279 |
VARCFIT(2) = CHI2Y |
VARCFIT(2) = CHI2Y |
280 |
IMPY = AY ! PAMELA REF |
IMPY = AY + BY * (ZALIG/10.) ! PAMELA REF |
281 |
TANY = BY |
TANY = BY |
282 |
ENDIF |
ENDIF |
283 |
C |
C |
284 |
DO I = 1,NPLA |
DO I = 1,NPLA |
285 |
NN = 0 |
NN = 0 |
286 |
IF (M.EQ.2) NN = 1 |
c IF (M.EQ.2) NN = 1 |
287 |
IF (MOD(I,2).EQ.NN) THEN |
IF (MOD(I,2).EQ.NN) THEN |
288 |
IF (REVERSE.EQ.0) THEN |
IF (REVERSE.EQ.0) THEN |
|
SHIFT = +0.5 |
|
|
ELSE |
|
289 |
SHIFT = -0.5 |
SHIFT = -0.5 |
290 |
|
ELSE |
291 |
|
SHIFT = +0.5 |
292 |
ENDIF |
ENDIF |
293 |
ELSE |
ELSE |
294 |
IF (REVERSE.EQ.0) THEN |
IF (REVERSE.EQ.0) THEN |
|
SHIFT = -0.5 |
|
|
ELSE |
|
295 |
SHIFT = +0.5 |
SHIFT = +0.5 |
296 |
|
ELSE |
297 |
|
SHIFT = -0.5 |
298 |
ENDIF |
ENDIF |
299 |
ENDIF |
ENDIF |
300 |
C |
C |
301 |
IF (M.EQ.1) THEN |
IF (M.EQ.1) THEN |
302 |
DISTX = PIANO(I) - 5.81 |
DISTX = PIANO(I) - 5.81 |
303 |
Y(I) = (DISTX * TANX) + AX - XALIG |
Y(I) = (DISTX * TANX) + IMPX*10. !- XALIG |
304 |
c CBAR(M,I) = Y(I) |
c CBAR(M,I) = Y(I) |
305 |
BAR(M,I) = Y(I) |
BAR(M,I) = Y(I) + XALIG |
306 |
CBAR(M,I) = (Y(I) + XALIG)/10. |
CBAR(M,I) = Y(I) / 10. |
307 |
IF (I.EQ.NPLA) MX=ABS(Y(1)-Y(NPLA))/ |
IF (I.EQ.NPLA) MX=ABS(Y(1)-Y(NPLA))/ |
308 |
& ABS(ZIN(1)-ZIN(NPLA)) |
& ABS(ZIN(1)-ZIN(NPLA)) |
309 |
C |
C |
310 |
ELSE |
ELSE |
311 |
DISTY = PIANO(I) |
DISTY = PIANO(I) |
312 |
YY(I) = (DISTY * TANY) + AY - YALIG |
YY(I) = (DISTY * TANY) + IMPY*10. !- YALIG |
313 |
|
c print *,' I ',i,' YY ',YY(I) |
314 |
c CBAR(M,I) = YY(I) |
c CBAR(M,I) = YY(I) |
315 |
BAR(M,I) = YY(I) |
BAR(M,I) = YY(I) + YALIG |
316 |
CBAR(M,I) = (YY(I) + YALIG)/10. |
CBAR(M,I) = YY(I) / 10. |
317 |
IF (I.EQ.NPLA) MY=ABS(Y(1)-Y(NPLA))/ |
IF (I.EQ.NPLA) MY=ABS(Y(1)-Y(NPLA))/ |
318 |
& ABS(ZIN(1)-ZIN(NPLA)) |
& ABS(ZIN(1)-ZIN(NPLA)) |
319 |
C |
C |
607 |
C |
C |
608 |
C CALCULATE NLAST AND QLAST |
C CALCULATE NLAST AND QLAST |
609 |
C |
C |
610 |
DO J = NPLA-4,NPLA |
MNPLA = NPLA -4 |
611 |
|
IF ( MNPLA .LT. 1 ) MNPLA = 1 |
612 |
|
DO J = MNPLA,NPLA |
613 |
NNX = IBAR(1,J) |
NNX = IBAR(1,J) |
614 |
IF (NNX.NE.-1) THEN |
IF (NNX.NE.-1) THEN |
615 |
IF (NNX.LT.5) NNX = 5 |
IF (NNX.LT.5) NNX = 5 |