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 |
99 |
10 CONTINUE |
c 10 CONTINUE |
100 |
|
CONTINUE |
101 |
C |
C |
102 |
IF (GOOD2.EQ.1) THEN |
IF (GOOD2.EQ.1) THEN |
103 |
C |
C |
127 |
YOUT(I) = 0. |
YOUT(I) = 0. |
128 |
IF (MOD(M,2).EQ.0) THEN |
IF (MOD(M,2).EQ.0) THEN |
129 |
DISTX = PIANO(I) + ZALIG |
DISTX = PIANO(I) + ZALIG |
130 |
|
c print *,'T Y PLANE I= ',I,' Z = ',DISTX |
131 |
ELSE |
ELSE |
132 |
DISTX = PIANO(I) - 5.81 + ZALIG |
DISTX = PIANO(I) - 5.81 + ZALIG |
133 |
|
c print *,'T X PLANE I= ',I,' Z = ',DISTX |
134 |
ENDIF |
ENDIF |
135 |
ZIN(I) = distx / 10. |
ZIN(I) = distx / 10. |
136 |
c print *,' ZIN(',I,') = ',ZIN(I) |
c print *,' ZIN(',I,') = ',ZIN(I) |
148 |
TY = TAN(ASIN(AL_P(3))) * SIN(AL_P(4)) |
TY = TAN(ASIN(AL_P(3))) * SIN(AL_P(4)) |
149 |
DO I = 1, NPLA |
DO I = 1, NPLA |
150 |
NN = 0 |
NN = 0 |
151 |
IF (M.EQ.2) NN = 1 |
c IF (M.EQ.2) NN = 1 |
152 |
IF (MOD(I,2).EQ.NN) THEN |
IF (MOD(I,2).EQ.NN) THEN |
153 |
IF (REVERSE.EQ.0) THEN |
IF (REVERSE.EQ.0) THEN |
|
SHIFT = +0.5 |
|
|
ELSE |
|
154 |
SHIFT = -0.5 |
SHIFT = -0.5 |
155 |
|
ELSE |
156 |
|
SHIFT = +0.5 |
157 |
ENDIF |
ENDIF |
158 |
ELSE |
ELSE |
159 |
IF (REVERSE.EQ.0) THEN |
IF (REVERSE.EQ.0) THEN |
|
SHIFT = -0.5 |
|
|
ELSE |
|
160 |
SHIFT = +0.5 |
SHIFT = +0.5 |
161 |
|
ELSE |
162 |
|
SHIFT = -0.5 |
163 |
ENDIF |
ENDIF |
164 |
ENDIF |
ENDIF |
165 |
C |
C |
274 |
IF (NPCFIT(M).GE.2) THEN |
IF (NPCFIT(M).GE.2) THEN |
275 |
IF (M.EQ.1) THEN |
IF (M.EQ.1) THEN |
276 |
VARCFIT(1) = CHI2X |
VARCFIT(1) = CHI2X |
277 |
IMPX = AX ! PAMELA REF |
IMPX = AX + BX * (ZALIG/10.) ! PAMELA REF |
278 |
TANX = BX |
TANX = BX |
279 |
ELSE |
ELSE |
280 |
VARCFIT(2) = CHI2Y |
VARCFIT(2) = CHI2Y |
281 |
IMPY = AY ! PAMELA REF |
IMPY = AY + BY * (ZALIG/10.) ! PAMELA REF |
282 |
TANY = BY |
TANY = BY |
283 |
ENDIF |
ENDIF |
284 |
C |
C |
285 |
DO I = 1,NPLA |
DO I = 1,NPLA |
286 |
NN = 0 |
NN = 0 |
287 |
IF (M.EQ.2) NN = 1 |
c IF (M.EQ.2) NN = 1 |
288 |
IF (MOD(I,2).EQ.NN) THEN |
IF (MOD(I,2).EQ.NN) THEN |
289 |
IF (REVERSE.EQ.0) THEN |
IF (REVERSE.EQ.0) THEN |
|
SHIFT = +0.5 |
|
|
ELSE |
|
290 |
SHIFT = -0.5 |
SHIFT = -0.5 |
291 |
|
ELSE |
292 |
|
SHIFT = +0.5 |
293 |
ENDIF |
ENDIF |
294 |
ELSE |
ELSE |
295 |
IF (REVERSE.EQ.0) THEN |
IF (REVERSE.EQ.0) THEN |
|
SHIFT = -0.5 |
|
|
ELSE |
|
296 |
SHIFT = +0.5 |
SHIFT = +0.5 |
297 |
|
ELSE |
298 |
|
SHIFT = -0.5 |
299 |
ENDIF |
ENDIF |
300 |
ENDIF |
ENDIF |
301 |
C |
C |
302 |
IF (M.EQ.1) THEN |
IF (M.EQ.1) THEN |
303 |
DISTX = PIANO(I) - 5.81 |
DISTX = PIANO(I) - 5.81 |
304 |
Y(I) = (DISTX * TANX) + AX - XALIG |
Y(I) = (DISTX * TANX) + IMPX*10. !- XALIG |
305 |
c CBAR(M,I) = Y(I) |
c CBAR(M,I) = Y(I) |
306 |
BAR(M,I) = Y(I) |
BAR(M,I) = Y(I) + XALIG |
307 |
CBAR(M,I) = (Y(I) + XALIG)/10. |
CBAR(M,I) = Y(I) / 10. |
308 |
IF (I.EQ.NPLA) MX=ABS(Y(1)-Y(NPLA))/ |
IF (I.EQ.NPLA) MX=ABS(Y(1)-Y(NPLA))/ |
309 |
& ABS(ZIN(1)-ZIN(NPLA)) |
& ABS(ZIN(1)-ZIN(NPLA)) |
310 |
C |
C |
311 |
ELSE |
ELSE |
312 |
DISTY = PIANO(I) |
DISTY = PIANO(I) |
313 |
YY(I) = (DISTY * TANY) + AY - YALIG |
YY(I) = (DISTY * TANY) + IMPY*10. !- YALIG |
314 |
|
c print *,' I ',i,' YY ',YY(I) |
315 |
c CBAR(M,I) = YY(I) |
c CBAR(M,I) = YY(I) |
316 |
BAR(M,I) = YY(I) |
BAR(M,I) = YY(I) + YALIG |
317 |
CBAR(M,I) = (YY(I) + YALIG)/10. |
CBAR(M,I) = YY(I) / 10. |
318 |
IF (I.EQ.NPLA) MY=ABS(Y(1)-Y(NPLA))/ |
IF (I.EQ.NPLA) MY=ABS(Y(1)-Y(NPLA))/ |
319 |
& ABS(ZIN(1)-ZIN(NPLA)) |
& ABS(ZIN(1)-ZIN(NPLA)) |
320 |
C |
C |
481 |
INFX = NNX - 8 |
INFX = NNX - 8 |
482 |
ISUPX = NNX + 8 |
ISUPX = NNX + 8 |
483 |
DO I = INFX,ISUPX |
DO I = INFX,ISUPX |
484 |
IF (DEXY(1,J,I).LT.EMIN) GO TO 710 |
IF (DEXY(1,J,I).GE.EMIN) THEN |
485 |
NCYL = NCYL + 1 |
NCYL = NCYL + 1 |
486 |
QCYL = QCYL + DEXY(1,J,I) |
QCYL = QCYL + DEXY(1,J,I) |
487 |
710 ENDDO |
ENDIF |
488 |
|
ENDDO |
489 |
ENDIF |
ENDIF |
490 |
NNY = IBAR(2,J) |
NNY = IBAR(2,J) |
491 |
IF (NNY.NE.-1) THEN |
IF (NNY.NE.-1) THEN |
494 |
INFY = NNY - 8 |
INFY = NNY - 8 |
495 |
ISUPY = NNY + 8 |
ISUPY = NNY + 8 |
496 |
DO I=INFY,ISUPY |
DO I=INFY,ISUPY |
497 |
IF (DEXY(2,J,I).LT.EMIN) GO TO 810 |
IF (DEXY(2,J,I).GE.EMIN) THEN |
498 |
NCYL = NCYL + 1 |
NCYL = NCYL + 1 |
499 |
QCYL = QCYL + DEXY(2,J,I) |
QCYL = QCYL + DEXY(2,J,I) |
500 |
810 ENDDO |
ENDIF |
501 |
|
ENDDO |
502 |
ENDIF |
ENDIF |
503 |
C |
C |
504 |
C QTR = DETECTED ENERGY AND NTR = NUMBER OF HIT STRIPS IN A CYLINDER oF |
C QTR = DETECTED ENERGY AND NTR = NUMBER OF HIT STRIPS IN A CYLINDER oF |
610 |
C |
C |
611 |
C CALCULATE NLAST AND QLAST |
C CALCULATE NLAST AND QLAST |
612 |
C |
C |
613 |
DO J = NPLA-4,NPLA |
MNPLA = NPLA -4 |
614 |
|
IF ( MNPLA .LT. 1 ) MNPLA = 1 |
615 |
|
DO J = MNPLA,NPLA |
616 |
NNX = IBAR(1,J) |
NNX = IBAR(1,J) |
617 |
IF (NNX.NE.-1) THEN |
IF (NNX.NE.-1) THEN |
618 |
IF (NNX.LT.5) NNX = 5 |
IF (NNX.LT.5) NNX = 5 |