6 |
INCLUDE 'INTEST.TXT' |
INCLUDE 'INTEST.TXT' |
7 |
C |
C |
8 |
DOUBLE PRECISION al_p(5), |
DOUBLE PRECISION al_p(5), |
9 |
& xout(npla),yout(npla),zin(npla) |
& xout(nplav),yout(nplav),zin(nplav) |
10 |
C |
C |
11 |
REAL PIANO(22), VARFIT(2) |
REAL PIANO(NPLAV), VARFIT(2) |
12 |
REAL TX, TY, SHIFT |
REAL TX, TY, SHIFT |
13 |
REAL BAR(2,NPLA), DISTY |
REAL BAR(2,NPLAV), DISTY |
14 |
REAL DISTX, Y(NPLA), YY(NPLA) |
REAL DISTX, Y(NPLAV), YY(NPLAV) |
15 |
REAL RIG, PPLANEMAX, RMASS |
REAL RIG, PPLANEMAX, RMASS |
16 |
REAL RNSS, QTOTT, RQT, MX, MY |
REAL RNSS, QTOTT, RQT, MX, MY |
17 |
REAL CHECK, ENER, CX, CY |
REAL CHECK, ENER, CX, CY |
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 |
c INTEGER j, m, i, IWPL(2), timpx, timpy, T, nn |
28 |
|
INTEGER j, m, i, IWPL(2), T, nn |
29 |
INTEGER IPLANE, NNX, NNY, INFX, INFY, ISUPX, ISUPY |
INTEGER IPLANE, NNX, NNY, INFX, INFY, ISUPX, ISUPY |
30 |
INTEGER IBAR(2,NPLA), NPFIT(2), CHTRACK,IWPLU |
INTEGER IBAR(2,NPLAV), NPFIT(2), CHTRACK,IWPLU |
31 |
INTEGER Iquest(100), ICONTROL5, nin, IFAIL |
INTEGER Iquest(100), ICONTROL5, nin, IFAIL |
32 |
C |
C |
33 |
PARAMETER (X01PL=0.74) |
PARAMETER (X01PL=0.74) |
67 |
C |
C |
68 |
C Begin ! |
C Begin ! |
69 |
C |
C |
70 |
|
c print *,' sono qui' |
71 |
CALOL2TR = 0; |
CALOL2TR = 0; |
72 |
NCORE = 0. |
NCORE = 0. |
73 |
QCORE = 0. |
QCORE = 0. |
93 |
QMEAN = 0. |
QMEAN = 0. |
94 |
C SELFTRIGGER = 0 |
C SELFTRIGGER = 0 |
95 |
C |
C |
96 |
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 |
97 |
C |
C |
98 |
T = 1 |
T = 1 |
99 |
C |
C |
100 |
10 CONTINUE |
c 10 CONTINUE |
101 |
|
CONTINUE |
102 |
C |
C |
103 |
IF (GOOD2.EQ.1) THEN |
IF (GOOD2.EQ.1) THEN |
104 |
C |
C |
105 |
CHTRACK = 0 |
CHTRACK = 0 |
106 |
C |
C |
107 |
CALL VZERO(IWPL,2) |
CALL VZERO(IWPL,2) |
108 |
CALL VZERO(BAR,2*NPLA) |
CALL VZERO(BAR,2*NPLAV) |
109 |
CALL VZERO(IBAR,2*NPLA) |
CALL VZERO(IBAR,2*NPLAV) |
110 |
CALL VZERO(TBAR,2*NPLA) |
CALL VZERO(TBAR,2*NPLAV) |
111 |
CALL VZERO(TIBAR,2*NPLA) |
CALL VZERO(TIBAR,2*NPLAV) |
112 |
CALL VZERO(Y,NPLA) |
CALL VZERO(Y,NPLAV) |
113 |
CALL VZERO(YY,NPLA) |
CALL VZERO(YY,NPLAV) |
114 |
CALL VZERO(XOUT,NPLA) |
CALL VZERO(XOUT,NPLAV) |
115 |
CALL VZERO(YOUT,NPLA) |
CALL VZERO(YOUT,NPLAV) |
116 |
do m = 1, 5 |
do m = 1, 5 |
117 |
al_p(m) = al_pp(t,m) |
al_p(m) = al_pp(t,m) |
118 |
|
c print *,' al_p(',m,') = ',al_p(m) |
119 |
enddo |
enddo |
120 |
if (al_p(5).eq.0.) THEN |
if (al_p(5).eq.0.) THEN |
121 |
PRINT *,' CALORIMETER - WARNING F77: track with R = 0, discarded' |
c PRINT *,' CALORIMETER - WARNING F77: track with R = 0, discarded' |
122 |
GOOD2 = 0 |
GOOD2 = 0 |
123 |
GOTO 969 |
GOTO 969 |
124 |
ENDIF |
ENDIF |
128 |
YOUT(I) = 0. |
YOUT(I) = 0. |
129 |
IF (MOD(M,2).EQ.0) THEN |
IF (MOD(M,2).EQ.0) THEN |
130 |
DISTX = PIANO(I) + ZALIG |
DISTX = PIANO(I) + ZALIG |
131 |
|
c print *,'T Y PLANE I= ',I,' Z = ',DISTX |
132 |
ELSE |
ELSE |
133 |
DISTX = PIANO(I) - 5.81 + ZALIG |
DISTX = PIANO(I) - 5.81 + ZALIG |
134 |
|
c print *,'T X PLANE I= ',I,' Z = ',DISTX |
135 |
ENDIF |
ENDIF |
136 |
ZIN(I) = distx / 10. |
ZIN(I) = distx / 10. |
137 |
|
c print *,' ZIN(',I,') = ',ZIN(I) |
138 |
TBAR(M,I) = 0. |
TBAR(M,I) = 0. |
139 |
TIBAR(M,I) = 0 |
TIBAR(M,I) = 0 |
140 |
enddo |
enddo |
145 |
c print *,' CALORIMETER - WARNING F77: tracking failed ' |
c print *,' CALORIMETER - WARNING F77: tracking failed ' |
146 |
goto 969 |
goto 969 |
147 |
endif |
endif |
148 |
TX = TAN(ASIN(AL_P(3))) * COS(AL_P(4)) |
TX = REAL(DTAN(DASIN(AL_P(3))) * DCOS(AL_P(4))) |
149 |
TY = TAN(ASIN(AL_P(3))) * SIN(AL_P(4)) |
TY = REAL(DTAN(DASIN(AL_P(3))) * DSIN(AL_P(4))) |
150 |
DO I = 1, NPLA |
DO I = 1, NPLA |
151 |
NN = 0 |
NN = 0 |
152 |
IF (M.EQ.2) NN = 1 |
c IF (M.EQ.2) NN = 1 |
153 |
IF (MOD(I,2).EQ.NN) THEN |
IF (MOD(I,2).EQ.NN) THEN |
154 |
SHIFT = +0.5 |
IF (REVERSE.EQ.0) THEN |
155 |
|
SHIFT = -0.5 |
156 |
|
ELSE |
157 |
|
SHIFT = +0.5 |
158 |
|
ENDIF |
159 |
ELSE |
ELSE |
160 |
SHIFT = -0.5 |
IF (REVERSE.EQ.0) THEN |
161 |
|
SHIFT = +0.5 |
162 |
|
ELSE |
163 |
|
SHIFT = -0.5 |
164 |
|
ENDIF |
165 |
ENDIF |
ENDIF |
166 |
C |
C |
167 |
C CHECK IF XOUT OR YOUT ARE NaN |
C CHECK IF XOUT OR YOUT ARE NaN |
173 |
GOTO 969 |
GOTO 969 |
174 |
ENDIF |
ENDIF |
175 |
C |
C |
176 |
CX = XOUT(I)*10. + XALIG |
CX = REAL(XOUT(I))*10. + XALIG |
177 |
CY = YOUT(I)*10. + YALIG |
CY = REAL(YOUT(I))*10. + YALIG |
178 |
C |
C |
179 |
IF (I.EQ.1) THEN |
c IF (I.EQ.1) THEN !EM GCC4.7 TIMPX/Y are not used in che code... |
180 |
TIMPX = CX |
c TIMPX = NINT(CX) |
181 |
TIMPY = CY |
c TIMPY = NINT(CY) |
182 |
ENDIF |
c ENDIF |
183 |
IF (M.EQ.1) THEN |
IF (M.EQ.1) THEN |
184 |
Y(I) = CX |
Y(I) = CX |
185 |
BAR(M,I) = Y(I) |
BAR(M,I) = Y(I) |
186 |
TBAR(M,I) = (Y(I) - XALIG)/10. |
TBAR(M,I) = (Y(I) - XALIG)/10. |
187 |
IF (I.EQ.22) MX=ABS(Y(1)-Y(22))/ABS(ZIN(1)-ZIN(22)) |
IF (I.EQ.NPLA) MX=ABS(Y(1)-Y(NPLA))/ |
188 |
|
& ABS(REAL(ZIN(1)-ZIN(NPLA))) |
189 |
ELSE |
ELSE |
190 |
YY(I) = CY |
YY(I) = CY |
191 |
BAR(M,I) = YY(I) |
BAR(M,I) = YY(I) |
192 |
TBAR(M,I) = (-YALIG + YY(I))/10. |
TBAR(M,I) = (-YALIG + YY(I))/10. |
193 |
IF (I.EQ.22) MY=ABS(Y(1)-Y(22))/ABS(ZIN(1)-ZIN(22)) |
IF (I.EQ.NPLA) MY=ABS(Y(1)-Y(NPLA))/ |
194 |
|
& ABS(REAL(ZIN(1)-ZIN(NPLA))) |
195 |
ENDIF |
ENDIF |
196 |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
197 |
tibar(M,I) = ibar(m,i) |
tibar(M,I) = ibar(m,i) |
252 |
CALL VZERO(IWPL,2) |
CALL VZERO(IWPL,2) |
253 |
CALL VZERO(VARCFIT,2) |
CALL VZERO(VARCFIT,2) |
254 |
CALL VZERO(NPCFIT,2) |
CALL VZERO(NPCFIT,2) |
255 |
CALL VZERO(TBAR,2*NPLA) |
CALL VZERO(TBAR,2*NPLAV) |
256 |
CALL VZERO(TIBAR,2*NPLA) |
CALL VZERO(TIBAR,2*NPLAV) |
257 |
CALL VZERO(BAR,2*NPLA) |
CALL VZERO(BAR,2*NPLAV) |
258 |
CALL VZERO(IBAR,2*NPLA) |
CALL VZERO(IBAR,2*NPLAV) |
259 |
CALL VZERO(Y,NPLA) |
CALL VZERO(Y,NPLAV) |
260 |
CALL VZERO(YY,NPLA) |
CALL VZERO(YY,NPLAV) |
261 |
CALL VZERO(XOUT,NPLA) |
CALL VZERO(XOUT,NPLAV) |
262 |
CALL VZERO(YOUT,NPLA) |
CALL VZERO(YOUT,NPLAV) |
263 |
C |
C |
264 |
CALL SELFTRIG() |
CALL SELFTRIG() |
265 |
ELEN = PARZEN3 |
ELEN = PARZEN3 |
275 |
IF (NPCFIT(M).GE.2) THEN |
IF (NPCFIT(M).GE.2) THEN |
276 |
IF (M.EQ.1) THEN |
IF (M.EQ.1) THEN |
277 |
VARCFIT(1) = CHI2X |
VARCFIT(1) = CHI2X |
278 |
IMPX = AX ! PAMELA REF |
IMPX = AX + BX * (ZALIG/10.) ! PAMELA REF |
279 |
TANX = BX |
TANX = BX |
280 |
ELSE |
ELSE |
281 |
VARCFIT(2) = CHI2Y |
VARCFIT(2) = CHI2Y |
282 |
IMPY = AY ! PAMELA REF |
IMPY = AY + BY * (ZALIG/10.) ! PAMELA REF |
283 |
TANY = BY |
TANY = BY |
284 |
ENDIF |
ENDIF |
285 |
C |
C |
286 |
DO I = 1,NPLA |
DO I = 1,NPLA |
287 |
NN = 0 |
NN = 0 |
288 |
IF (M.EQ.2) NN = 1 |
c IF (M.EQ.2) NN = 1 |
289 |
IF (MOD(I,2).EQ.NN) THEN |
IF (MOD(I,2).EQ.NN) THEN |
290 |
SHIFT = +0.5 |
IF (REVERSE.EQ.0) THEN |
291 |
|
SHIFT = -0.5 |
292 |
|
ELSE |
293 |
|
SHIFT = +0.5 |
294 |
|
ENDIF |
295 |
ELSE |
ELSE |
296 |
SHIFT = -0.5 |
IF (REVERSE.EQ.0) THEN |
297 |
|
SHIFT = +0.5 |
298 |
|
ELSE |
299 |
|
SHIFT = -0.5 |
300 |
|
ENDIF |
301 |
ENDIF |
ENDIF |
302 |
C |
C |
303 |
IF (M.EQ.1) THEN |
IF (M.EQ.1) THEN |
304 |
DISTX = PIANO(I) - 5.81 |
DISTX = PIANO(I) - 5.81 |
305 |
Y(I) = (DISTX * TANX) + AX - XALIG |
Y(I) = (DISTX * TANX) + IMPX*10. !- XALIG |
306 |
c CBAR(M,I) = Y(I) |
c CBAR(M,I) = Y(I) |
307 |
BAR(M,I) = Y(I) |
BAR(M,I) = Y(I) + XALIG |
308 |
CBAR(M,I) = (Y(I) + XALIG)/10. |
CBAR(M,I) = Y(I) / 10. |
309 |
IF (I.EQ.22) MX=ABS(Y(1)-Y(22))/ABS(ZIN(1)-ZIN(22)) |
IF (I.EQ.NPLA) MX=ABS(Y(1)-Y(NPLA))/ |
310 |
|
& ABS(REAL(ZIN(1)-ZIN(NPLA))) |
311 |
C |
C |
312 |
ELSE |
ELSE |
313 |
DISTY = PIANO(I) |
DISTY = PIANO(I) |
314 |
YY(I) = (DISTY * TANY) + AY - YALIG |
YY(I) = (DISTY * TANY) + IMPY*10. !- YALIG |
315 |
|
c print *,' I ',i,' YY ',YY(I) |
316 |
c CBAR(M,I) = YY(I) |
c CBAR(M,I) = YY(I) |
317 |
BAR(M,I) = YY(I) |
BAR(M,I) = YY(I) + YALIG |
318 |
CBAR(M,I) = (YY(I) + YALIG)/10. |
CBAR(M,I) = YY(I) / 10. |
319 |
IF (I.EQ.22) MY=ABS(Y(1)-Y(22))/ABS(ZIN(1)-ZIN(22)) |
IF (I.EQ.NPLA) MY=ABS(Y(1)-Y(NPLA))/ |
320 |
|
& ABS(REAL(ZIN(1)-ZIN(NPLA))) |
321 |
C |
C |
322 |
ENDIF |
ENDIF |
323 |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
377 |
GTR = 1 |
GTR = 1 |
378 |
IF (TRKCHI2.LT.0) GTR = 2 |
IF (TRKCHI2.LT.0) GTR = 2 |
379 |
IF ( AL_PP(GTR,5).NE.0. ) THEN |
IF ( AL_PP(GTR,5).NE.0. ) THEN |
380 |
RIG = 1./(AL_PP(GTR,5)) |
RIG = REAL(1./(AL_PP(GTR,5))) |
381 |
ELSE |
ELSE |
382 |
GOOD2 = 0 |
GOOD2 = 0 |
383 |
PRINT *,' CALORIMETER - WARNING F77: track with R = 0' |
c PRINT *,' CALORIMETER - WARNING F77: track with R = 0' |
384 |
GOTO 50 |
GOTO 50 |
385 |
ENDIF |
ENDIF |
386 |
ENDIF |
ENDIF |
388 |
RIG = ELEN ! SELFTRIGGER RIGIDITY |
RIG = ELEN ! SELFTRIGGER RIGIDITY |
389 |
IF ( RIG.EQ.0. ) THEN |
IF ( RIG.EQ.0. ) THEN |
390 |
GOOD2 = 1 |
GOOD2 = 1 |
391 |
PRINT *,' CALORIMETER - WARNING F77: ST track with R = 0' |
c PRINT *,' CALORIMETER - WARNING F77: ST track with R = 0' |
392 |
GOTO 50 |
GOTO 50 |
393 |
ENDIF |
ENDIF |
394 |
ENDIF |
ENDIF |
406 |
C |
C |
407 |
IF (IPLANE.GT.NPLA) IPLANE=NPLA |
IF (IPLANE.GT.NPLA) IPLANE=NPLA |
408 |
IF (IPLANE.LT.1) IPLANE = 1 |
IF (IPLANE.LT.1) IPLANE = 1 |
409 |
|
c print *,' calcolo...' |
410 |
C |
C |
411 |
C CALCULATE QLOW AND NLOW |
C CALCULATE QLOW AND NLOW |
412 |
C |
C |
482 |
INFX = NNX - 8 |
INFX = NNX - 8 |
483 |
ISUPX = NNX + 8 |
ISUPX = NNX + 8 |
484 |
DO I = INFX,ISUPX |
DO I = INFX,ISUPX |
485 |
IF (DEXY(1,J,I).LT.EMIN) GO TO 710 |
IF (DEXY(1,J,I).GE.EMIN) THEN |
486 |
NCYL = NCYL + 1 |
NCYL = NCYL + 1 |
487 |
QCYL = QCYL + DEXY(1,J,I) |
QCYL = QCYL + DEXY(1,J,I) |
488 |
710 ENDDO |
ENDIF |
489 |
|
ENDDO |
490 |
ENDIF |
ENDIF |
491 |
NNY = IBAR(2,J) |
NNY = IBAR(2,J) |
492 |
IF (NNY.NE.-1) THEN |
IF (NNY.NE.-1) THEN |
495 |
INFY = NNY - 8 |
INFY = NNY - 8 |
496 |
ISUPY = NNY + 8 |
ISUPY = NNY + 8 |
497 |
DO I=INFY,ISUPY |
DO I=INFY,ISUPY |
498 |
IF (DEXY(2,J,I).LT.EMIN) GO TO 810 |
IF (DEXY(2,J,I).GE.EMIN) THEN |
499 |
NCYL = NCYL + 1 |
NCYL = NCYL + 1 |
500 |
QCYL = QCYL + DEXY(2,J,I) |
QCYL = QCYL + DEXY(2,J,I) |
501 |
810 ENDDO |
ENDIF |
502 |
|
ENDDO |
503 |
ENDIF |
ENDIF |
504 |
C |
C |
505 |
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 |
611 |
C |
C |
612 |
C CALCULATE NLAST AND QLAST |
C CALCULATE NLAST AND QLAST |
613 |
C |
C |
614 |
DO J = NPLA-4,NPLA |
MNPLA = NPLA -4 |
615 |
|
IF ( MNPLA .LT. 1 ) MNPLA = 1 |
616 |
|
DO J = MNPLA,NPLA |
617 |
NNX = IBAR(1,J) |
NNX = IBAR(1,J) |
618 |
IF (NNX.NE.-1) THEN |
IF (NNX.NE.-1) THEN |
619 |
IF (NNX.LT.5) NNX = 5 |
IF (NNX.LT.5) NNX = 5 |
676 |
C |
C |
677 |
50 CONTINUE |
50 CONTINUE |
678 |
C |
C |
679 |
|
c print *,' esco' |
680 |
RETURN |
RETURN |
681 |
END |
END |
682 |
|
|