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 |
135 |
call DOTRACK(NPLA,ZIN,XOUT,YOUT,AL_P,IFAIL) |
call DOTRACK(NPLA,ZIN,XOUT,YOUT,AL_P,IFAIL) |
136 |
if(IFAIL.ne.0)then |
if(IFAIL.ne.0)then |
137 |
GOOD2 = 0 |
GOOD2 = 0 |
138 |
print *,' CALORIMETER - WARNING F77: tracking failed ' |
c print *,' CALORIMETER - WARNING F77: tracking failed ' |
139 |
goto 969 |
goto 969 |
140 |
endif |
endif |
141 |
TX = TAN(ASIN(AL_P(3))) * COS(AL_P(4)) |
TX = TAN(ASIN(AL_P(3))) * COS(AL_P(4)) |
142 |
TY = TAN(ASIN(AL_P(3))) * SIN(AL_P(4)) |
TY = TAN(ASIN(AL_P(3))) * SIN(AL_P(4)) |
143 |
DO I = 1, NPLA |
DO I = 1, NPLA |
144 |
NN = 0 |
NN = 0 |
145 |
IF (M.EQ.2) NN = 1 |
C????? IF (M.EQ.2) NN = 1 |
146 |
IF (MOD(I,2).EQ.NN) THEN |
IF (MOD(I,2).EQ.NN) THEN |
147 |
SHIFT = +0.5 |
SHIFT = +0.5 |
148 |
ELSE |
ELSE |
152 |
C CHECK IF XOUT OR YOUT ARE NaN |
C CHECK IF XOUT OR YOUT ARE NaN |
153 |
C |
C |
154 |
IF (XOUT(I).NE.XOUT(I).OR.YOUT(I).NE.YOUT(I)) THEN |
IF (XOUT(I).NE.XOUT(I).OR.YOUT(I).NE.YOUT(I)) THEN |
155 |
print *, |
c print *, |
156 |
& ' CALORIMETER - WARNING F77: tracking error (NaN values)' |
c & ' CALORIMETER - WARNING F77: tracking error (NaN values)' |
157 |
GOOD2 = 0 |
GOOD2 = 0 |
158 |
GOTO 969 |
GOTO 969 |
159 |
ENDIF |
ENDIF |
160 |
C |
C |
161 |
CX = XOUT(I)*10. + XALIG |
CX = XOUT(I)*10. + XALIG |
162 |
CY = -YOUT(I)*10. + YALIG |
CY = YOUT(I)*10. + YALIG |
163 |
C |
C |
164 |
IF (I.EQ.1) THEN |
IF (I.EQ.1) THEN |
165 |
TIMPX = CX |
TIMPX = CX |
173 |
ELSE |
ELSE |
174 |
YY(I) = CY |
YY(I) = CY |
175 |
BAR(M,I) = YY(I) |
BAR(M,I) = YY(I) |
176 |
TBAR(M,I) = (YALIG - YY(I))/10. |
TBAR(M,I) = (-YALIG + YY(I))/10. |
177 |
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)) |
178 |
ENDIF |
ENDIF |
179 |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
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))) |
266 |
C |
C |
267 |
DO I = 1,NPLA |
DO I = 1,NPLA |
268 |
NN = 0 |
NN = 0 |
269 |
IF (M.EQ.2) NN = 1 |
C????? IF (M.EQ.2) NN = 1 |
270 |
IF (MOD(I,2).EQ.NN) THEN |
IF (MOD(I,2).EQ.NN) THEN |
271 |
SHIFT = +0.5 |
SHIFT = +0.5 |
272 |
ELSE |
ELSE |
290 |
ENDIF |
ENDIF |
291 |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
292 |
cibar(M,I) = ibar(m,i) |
cibar(M,I) = ibar(m,i) |
293 |
|
IF (ibar(m,i).EQ.-1) THEN |
294 |
|
CHTRACK = CHTRACK + 1 |
295 |
|
ELSE |
296 |
|
IWPL(M) = IWPL(M) + 1 |
297 |
|
ENDIF |
298 |
ENDDO |
ENDDO |
299 |
ENDIF |
ENDIF |
300 |
C |
C |
301 |
ENDDO |
ENDDO |
302 |
C |
C |
303 |
ELSE |
ENDIF |
304 |
IF (GOOD2.EQ.0) THEN |
C |
305 |
|
IF (TRIGTY.GE.2.AND.HZN.NE.0) THEN |
306 |
|
IF (GOOD2.EQ.1) THEN |
307 |
PRINT *,' CALORIMETER - WARNING F77: unknown request' |
PRINT *,' CALORIMETER - WARNING F77: unknown request' |
308 |
GOOD2 = 1 |
GOOD2 = 1 |
309 |
GOTO 50 |
GOTO 50 |
310 |
ENDIF |
ENDIF |
311 |
|
IF ( NPCFIT(1).EQ.0.OR.NPCFIT(2).EQ.0 ) THEN |
312 |
|
GOOD2 = 1 |
313 |
|
GOTO 50 |
314 |
|
ENDIF |
315 |
ENDIF |
ENDIF |
316 |
C |
C |
317 |
6996 CONTINUE |
6996 CONTINUE |
320 |
C |
C |
321 |
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 |
322 |
C |
C |
323 |
IF (CHTRACK.EQ.44) THEN |
IF (CHTRACK.EQ.44) THEN ! CHTRACK is the number of planes not touched by the track |
324 |
GOOD2 = 0 |
GOOD2 = 0 |
325 |
PRINT *,' CALORIMETER - WARNING F77: track outside calorimeter' |
c PRINT *,' CALORIMETER - WARNING F77: track outside calorimeter' |
326 |
GOTO 50 |
GOTO 50 |
327 |
ELSE |
ELSE |
328 |
IF ( IWPL(1).LE.IWPL(2) ) THEN |
IF ( IWPL(1).LE.IWPL(2) ) THEN |
335 |
& + (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) / |
336 |
& 3.6 |
& 3.6 |
337 |
C |
C |
|
C DX0L = X01PL * SQRT( (IWPL(1) * SQRT(1 + MX*MX))**2 + |
|
|
C & (IWPL(2) * SQRT(1 + MY*MY))**2 )/2. |
|
338 |
ENDIF |
ENDIF |
339 |
C |
C |
340 |
C |
C |
352 |
GOTO 50 |
GOTO 50 |
353 |
ENDIF |
ENDIF |
354 |
ENDIF |
ENDIF |
355 |
IF (TRIGTY.GE.2.AND.GOOD2.EQ.0) THEN |
IF (TRIGTY.GE.2.AND.HZN.EQ.0.AND.GOOD2.EQ.0) THEN |
356 |
RIG = ELEN ! SELFTRIGGER RIGIDITY |
RIG = ELEN ! SELFTRIGGER RIGIDITY |
357 |
IF ( RIG.EQ.0. ) THEN |
IF ( RIG.EQ.0. ) THEN |
358 |
GOOD2 = 0 |
GOOD2 = 1 |
359 |
PRINT *,' CALORIMETER - WARNING F77: ST track with R = 0' |
PRINT *,' CALORIMETER - WARNING F77: ST track with R = 0' |
360 |
GOTO 50 |
GOTO 50 |
361 |
ENDIF |
ENDIF |
362 |
ENDIF |
ENDIF |
363 |
C |
C |
364 |
|
IF (GOOD2.EQ.0.AND.(TRIGTY.LT.2.OR.HZN.EQ.1)) THEN |
365 |
|
RIG = RIGINPUT |
366 |
|
ENDIF |
367 |
|
C |
368 |
RNSS = 0. |
RNSS = 0. |
369 |
QTOTT = 0. |
QTOTT = 0. |
370 |
C |
C |
577 |
DO J = NPLA-4,NPLA |
DO J = NPLA-4,NPLA |
578 |
NNX = IBAR(1,J) |
NNX = IBAR(1,J) |
579 |
IF (NNX.NE.-1) THEN |
IF (NNX.NE.-1) THEN |
580 |
IF (NNX.LT.9) NNX = 9 |
IF (NNX.LT.5) NNX = 5 |
581 |
IF (NNX.GT.88) NNX = 88 |
IF (NNX.GT.92) NNX = 92 |
582 |
INFX = NNX - 8 |
c IF (NNX.LT.9) NNX = 9 |
583 |
ISUPX = NNX + 8 |
c IF (NNX.GT.88) NNX = 88 |
584 |
|
INFX = NNX - 4 |
585 |
|
ISUPX = NNX + 4 |
586 |
|
c INFX = NNX - 8 |
587 |
|
c ISUPX = NNX + 8 |
588 |
DO I = INFX,ISUPX |
DO I = INFX,ISUPX |
589 |
IF (DEXY(1,J,I).GE.EMIN) THEN |
IF (DEXY(1,J,I).GE.EMIN) THEN |
590 |
NLAST = NLAST + 1 |
NLAST = NLAST + 1 |
595 |
C |
C |
596 |
NNY = IBAR(2,J) |
NNY = IBAR(2,J) |
597 |
IF (NNY.NE.-1) THEN |
IF (NNY.NE.-1) THEN |
598 |
IF (NNY.LT.9) NNY = 9 |
IF (NNY.LT.5) NNY = 5 |
599 |
IF (NNY.GT.88) NNY = 88 |
IF (NNY.GT.92) NNY = 92 |
600 |
INFY = NNY - 8 |
c IF (NNY.LT.9) NNY = 9 |
601 |
ISUPY = NNY + 8 |
c IF (NNY.GT.88) NNY = 88 |
602 |
|
INFY = NNY - 4 |
603 |
|
ISUPY = NNY + 4 |
604 |
|
c INFY = NNY - 8 |
605 |
|
c ISUPY = NNY + 8 |
606 |
DO I=INFY,ISUPY |
DO I=INFY,ISUPY |
607 |
IF (DEXY(2,J,I).GE.EMIN) THEN |
IF (DEXY(2,J,I).GE.EMIN) THEN |
608 |
NLAST = NLAST + 1 |
NLAST = NLAST + 1 |
613 |
ENDDO |
ENDDO |
614 |
C |
C |
615 |
EINF = EMIN |
EINF = EMIN |
616 |
ESUP = 50. |
ESUP = 150. |
617 |
|
C |
618 |
|
IF (TRIGTY.GE.2.AND.HZN.NE.0) THEN |
619 |
|
EINF = 50. |
620 |
|
ESUP = 1500. |
621 |
|
ENDIF |
622 |
C |
C |
623 |
C CALCULATE PLANETOT AND QMEAN |
C CALCULATE PLANETOT AND QMEAN |
624 |
C |
C |