55 |
COMMON / CH / CHECK |
COMMON / CH / CHECK |
56 |
SAVE / CH / |
SAVE / CH / |
57 |
C |
C |
58 |
COMMON / CALOFIT / VARFIT, NPFIT |
COMMON / CALOFIT / VARFIT, NPFIT, IWPL,CHTRACK |
59 |
SAVE / CALOFIT / |
SAVE / CALOFIT / |
60 |
C |
C |
61 |
COMMON / pawcd / hmemor |
COMMON / pawcd / hmemor |
89 |
NLAST = 0. |
NLAST = 0. |
90 |
PLANETOT = 0. |
PLANETOT = 0. |
91 |
QMEAN = 0. |
QMEAN = 0. |
92 |
SELFTRIGGER = 0 |
C SELFTRIGGER = 0 |
|
CALL VZERO(VARCFIT,2) |
|
|
CALL VZERO(NPCFIT,2) |
|
|
CALL VZERO(TBAR,2*NPLA) |
|
|
CALL VZERO(TIBAR,2*NPLA) |
|
|
CALL VZERO(BAR,2*NPLA) |
|
|
CALL VZERO(IBAR,2*NPLA) |
|
|
CALL VZERO(IBAR,2*NPLA) |
|
|
CALL VZERO(Y,NPLA) |
|
|
CALL VZERO(YY,NPLA) |
|
|
CALL VZERO(XOUT,NPLA) |
|
|
CALL VZERO(YOUT,NPLA) |
|
93 |
C |
C |
94 |
C BEGIN WITH THE FISRT TRACK IF WE HAVE A TRACK FROM TRACKER |
C BEGIN WITH THE FISRT TRACK IF WE HAVE A TRACK FROM TRACKER |
95 |
C |
C |
106 |
CALL VZERO(IBAR,2*NPLA) |
CALL VZERO(IBAR,2*NPLA) |
107 |
CALL VZERO(TBAR,2*NPLA) |
CALL VZERO(TBAR,2*NPLA) |
108 |
CALL VZERO(TIBAR,2*NPLA) |
CALL VZERO(TIBAR,2*NPLA) |
109 |
|
CALL VZERO(Y,NPLA) |
110 |
|
CALL VZERO(YY,NPLA) |
111 |
|
CALL VZERO(XOUT,NPLA) |
112 |
|
CALL VZERO(YOUT,NPLA) |
113 |
do m = 1, 5 |
do m = 1, 5 |
114 |
al_p(m) = al_pp(t,m) |
al_p(m) = al_pp(t,m) |
115 |
enddo |
enddo |
228 |
C |
C |
229 |
C WE MUST PROCESS A SELFTRIGGER EVENT |
C WE MUST PROCESS A SELFTRIGGER EVENT |
230 |
C |
C |
231 |
IF (TRIGTY.GE.2) THEN |
IF (TRIGTY.GE.2.AND.HZN.EQ.0) THEN |
232 |
C |
C |
233 |
C CALL SELFTRIGGER SUBROUTINE |
C CALL SELFTRIGGER SUBROUTINE |
234 |
C |
C |
235 |
|
CALL VZERO(IWPL,2) |
236 |
|
CALL VZERO(VARCFIT,2) |
237 |
|
CALL VZERO(NPCFIT,2) |
238 |
|
CALL VZERO(TBAR,2*NPLA) |
239 |
|
CALL VZERO(TIBAR,2*NPLA) |
240 |
|
CALL VZERO(BAR,2*NPLA) |
241 |
|
CALL VZERO(IBAR,2*NPLA) |
242 |
|
CALL VZERO(Y,NPLA) |
243 |
|
CALL VZERO(YY,NPLA) |
244 |
|
CALL VZERO(XOUT,NPLA) |
245 |
|
CALL VZERO(YOUT,NPLA) |
246 |
|
C |
247 |
CALL SELFTRIG() |
CALL SELFTRIG() |
248 |
ELEN = PARZEN3 |
ELEN = PARZEN3 |
249 |
SELEN = ABS(ELEN) * (11.98*1E-2 + 7.6 * EXP(-5736/ABS(ELEN))) |
SELEN = ABS(ELEN) * (11.98*1E-2 + 7.6 * EXP(-5736/ABS(ELEN))) |
253 |
C |
C |
254 |
DO M = 1,2 |
DO M = 1,2 |
255 |
C |
C |
256 |
|
c print *,' ax ',ax,' ay ',ay |
257 |
|
c print *,' bx ',bx,' by ',by |
258 |
IF (NPCFIT(M).GE.2) THEN |
IF (NPCFIT(M).GE.2) THEN |
259 |
IF (M.EQ.1) THEN |
IF (M.EQ.1) THEN |
260 |
VARCFIT(1) = CHI2X |
VARCFIT(1) = CHI2X |
261 |
IMPX = 10. * ( AX + 12.1 ) |
IMPX = AX ! PAMELA REF |
262 |
TANX = BX |
TANX = BX |
263 |
ELSE |
ELSE |
264 |
VARCFIT(2) = CHI2Y |
VARCFIT(2) = CHI2Y |
265 |
IMPY = 10. * ( AY + 12.2 ) |
IMPY = AY ! PAMELA REF |
266 |
TANY = BY |
TANY = BY |
267 |
ENDIF |
ENDIF |
268 |
C |
C |
277 |
C |
C |
278 |
IF (M.EQ.1) THEN |
IF (M.EQ.1) THEN |
279 |
DISTX = PIANO(I) - 5.81 |
DISTX = PIANO(I) - 5.81 |
280 |
Y(I) = DISTX * TANX + CX |
Y(I) = (DISTX * TANX) + AX - XALIG |
281 |
|
c CBAR(M,I) = Y(I) |
282 |
BAR(M,I) = Y(I) |
BAR(M,I) = Y(I) |
283 |
CBAR(M,I) = Y(I) |
CBAR(M,I) = (Y(I) + XALIG)/10. |
284 |
IF (I.EQ.22) MX=ABS(Y(1)-Y(22))/ABS(ZIN(1)-ZIN(22)) |
IF (I.EQ.22) MX=ABS(Y(1)-Y(22))/ABS(ZIN(1)-ZIN(22)) |
285 |
C |
C |
286 |
ELSE |
ELSE |
287 |
DISTY = PIANO(I) |
DISTY = PIANO(I) |
288 |
YY(I) = DISTY * TANY + CY |
YY(I) = (DISTY * TANY) + AY - YALIG |
289 |
|
c CBAR(M,I) = YY(I) |
290 |
BAR(M,I) = YY(I) |
BAR(M,I) = YY(I) |
291 |
CBAR(M,I) = YY(I) |
CBAR(M,I) = (YY(I) + YALIG)/10. |
292 |
IF (I.EQ.22) MY=ABS(Y(1)-Y(22))/ABS(ZIN(1)-ZIN(22)) |
IF (I.EQ.22) MY=ABS(Y(1)-Y(22))/ABS(ZIN(1)-ZIN(22)) |
293 |
C |
C |
294 |
ENDIF |
ENDIF |
295 |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
296 |
cibar(M,I) = ibar(m,i) |
cibar(M,I) = ibar(m,i) |
297 |
|
IF (ibar(m,i).EQ.-1) THEN |
298 |
|
CHTRACK = CHTRACK + 1 |
299 |
|
ELSE |
300 |
|
IWPL(M) = IWPL(M) + 1 |
301 |
|
ENDIF |
302 |
ENDDO |
ENDDO |
303 |
ENDIF |
ENDIF |
304 |
C |
C |
305 |
ENDDO |
ENDDO |
306 |
C |
C |
307 |
ELSE |
ENDIF |
308 |
IF (GOOD2.EQ.0) THEN |
C |
309 |
|
IF (TRIGTY.GE.2.AND.HZN.NE.0) THEN |
310 |
|
IF (GOOD2.EQ.1) THEN |
311 |
PRINT *,' CALORIMETER - WARNING F77: unknown request' |
PRINT *,' CALORIMETER - WARNING F77: unknown request' |
312 |
GOOD2 = 1 |
GOOD2 = 1 |
313 |
GOTO 50 |
GOTO 50 |
314 |
ENDIF |
ENDIF |
315 |
|
IF ( NPCFIT(1).EQ.0.OR.NPCFIT(2).EQ.0 ) THEN |
316 |
|
GOOD2 = 1 |
317 |
|
GOTO 50 |
318 |
|
ENDIF |
319 |
ENDIF |
ENDIF |
320 |
C |
C |
321 |
6996 CONTINUE |
6996 CONTINUE |
324 |
C |
C |
325 |
C IF THE TRACK IS OUTSIDE THE CALORIMETER GO OUT, IF NOT CALCULATE DX0L |
C IF THE TRACK IS OUTSIDE THE CALORIMETER GO OUT, IF NOT CALCULATE DX0L |
326 |
C |
C |
327 |
IF (CHTRACK.EQ.44) THEN |
IF (CHTRACK.EQ.44) THEN ! CHTRACK is the number of planes not touched by the track |
328 |
GOOD2 = 0 |
GOOD2 = 0 |
329 |
c PRINT *,' CALORIMETER - WARNING F77: track outside calorimeter' |
c PRINT *,' CALORIMETER - WARNING F77: track outside calorimeter' |
330 |
GOTO 50 |
GOTO 50 |
339 |
& + (BAR(1,1)-(2.66*MX+BAR(1,1)))**2 + 2.66**2) / |
& + (BAR(1,1)-(2.66*MX+BAR(1,1)))**2 + 2.66**2) / |
340 |
& 3.6 |
& 3.6 |
341 |
C |
C |
|
C DX0L = X01PL * SQRT( (IWPL(1) * SQRT(1 + MX*MX))**2 + |
|
|
C & (IWPL(2) * SQRT(1 + MY*MY))**2 )/2. |
|
342 |
ENDIF |
ENDIF |
343 |
C |
C |
344 |
C |
C |
356 |
GOTO 50 |
GOTO 50 |
357 |
ENDIF |
ENDIF |
358 |
ENDIF |
ENDIF |
359 |
IF (TRIGTY.GE.2.AND.GOOD2.EQ.0) THEN |
IF (TRIGTY.GE.2.AND.HZN.EQ.0.AND.GOOD2.EQ.0) THEN |
360 |
RIG = ELEN ! SELFTRIGGER RIGIDITY |
RIG = ELEN ! SELFTRIGGER RIGIDITY |
361 |
IF ( RIG.EQ.0. ) THEN |
IF ( RIG.EQ.0. ) THEN |
362 |
GOOD2 = 0 |
GOOD2 = 1 |
363 |
PRINT *,' CALORIMETER - WARNING F77: ST track with R = 0' |
PRINT *,' CALORIMETER - WARNING F77: ST track with R = 0' |
364 |
GOTO 50 |
GOTO 50 |
365 |
ENDIF |
ENDIF |
366 |
ENDIF |
ENDIF |
367 |
C |
C |
368 |
|
IF (GOOD2.EQ.0.AND.(TRIGTY.LT.2.OR.HZN.EQ.1)) THEN |
369 |
|
RIG = RIGINPUT |
370 |
|
ENDIF |
371 |
|
C |
372 |
RNSS = 0. |
RNSS = 0. |
373 |
QTOTT = 0. |
QTOTT = 0. |
374 |
C |
C |
375 |
PPLANEMAX = 1.01*(LOG(ABS(RIG)/0.0081)-1.) |
PPLANEMAX = 1.01*(LOG(ABS(RIG)/0.0081)-1.) / 0.74 |
376 |
C |
C |
377 |
IPLANE = INT(ANINT(PPLANEMAX)) + 5 |
IPLANE = INT(ANINT(PPLANEMAX)) + 5 |
378 |
C |
C |
401 |
C |
C |
402 |
DO J = 1,IPLANE |
DO J = 1,IPLANE |
403 |
NNX = IBAR(1,J) |
NNX = IBAR(1,J) |
404 |
|
RNSS = 0. ! BACO!! |
405 |
|
QTOTT = 0. ! BACO!! |
406 |
IF (NNX.NE.-1) THEN |
IF (NNX.NE.-1) THEN |
407 |
IF (NNX.LT.9) NNX = 9 |
IF (NNX.LT.9) NNX = 9 |
408 |
IF (NNX.GT.88) NNX = 88 |
IF (NNX.GT.88) NNX = 88 |
618 |
ENDIF |
ENDIF |
619 |
ENDDO |
ENDDO |
620 |
C |
C |
|
EINF = EMIN |
|
|
ESUP = 50. |
|
621 |
C |
C |
622 |
C CALCULATE PLANETOT AND QMEAN |
C CALCULATE PLANETOT AND QMEAN |
623 |
C |
C |
628 |
NPIANI = 5 |
NPIANI = 5 |
629 |
QMEAN = 0. |
QMEAN = 0. |
630 |
INDEX = 0 |
INDEX = 0 |
631 |
CALL ELIO(RPIANO,NPIANI,QMEAN,NTOT,INDEX) |
C |
632 |
PLANETOT = RPIANO(1) + RPIANO(2) |
IF (TRIGTY.GE.2.AND.HZN.NE.0) THEN |
633 |
|
EINF = 50. |
634 |
|
ESUP = 15000. |
635 |
|
CALL NUCLEI(RPIANO,NPIANI,QMEAN,NTOT,INDEX) |
636 |
|
PLANETOT = RPIANO(1) + RPIANO(2) |
637 |
|
ELSE |
638 |
|
EINF = EMIN |
639 |
|
ESUP = 15000. |
640 |
|
CALL ELIO(RPIANO,NPIANI,QMEAN,NTOT,INDEX) |
641 |
|
PLANETOT = RPIANO(1) + RPIANO(2) |
642 |
|
ENDIF |
643 |
C |
C |
644 |
50 CONTINUE |
50 CONTINUE |
645 |
C |
C |