--- DarthVader/CalorimeterLevel2/src/calol2cm.for 2006/05/23 08:35:45 1.2 +++ DarthVader/CalorimeterLevel2/src/calol2cm.for 2007/03/30 11:17:16 1.7 @@ -17,7 +17,7 @@ INTEGER gtr INTEGER j, m, nn, i INTEGER IBAR(2,NPLA), NPFIT(2) - INTEGER Iquest(100) + INTEGER Iquest(100), IWPL(2),CHTRACK c COMMON / TAGLIOEN / EINF, ESUP, ENER(2) SAVE / TAGLIOEN / @@ -37,7 +37,7 @@ COMMON / CH / CHECK SAVE / CH / C - COMMON / CALOFIT / VARFIT, NPFIT + COMMON / CALOFIT / VARFIT, NPFIT, IWPL,CHTRACK SAVE / CALOFIT / C COMMON / pawcd / hmemor @@ -86,6 +86,7 @@ QX22 = 0. QMAX = 0. GTR = 0 + CHTRACK = 0 C DISTX = 0. DISTY = 0. @@ -105,38 +106,52 @@ DO J = 1,96 IF ( MOD(I,2).NE.0 ) THEN IF ( ESTRIP(2,I,J).GT.EMIN ) THEN - ENPLANEY = ENPLANEY + ESTRIP(2,I,J) DEXY(2,I,J) = ESTRIP(2,I,J) + ENPLANEY = ENPLANEY + DEXY(2,I,J) NSTRIP = NSTRIP + 1. - QTOT = QTOT + ESTRIP(2,I,J) - IF (I.LT.11) QQ(1) = QQ(1) + ESTRIP(2,I,J) + QTOT = QTOT + DEXY(2,I,J) + IF (I.LT.11) QQ(1) = QQ(1) + DEXY(2,I,J) ENDIF IF ( ESTRIP(1,I,J).GT.EMIN ) THEN - ENPLANEX = ENPLANEX + ESTRIP(1,I,J) +C IF ( ESTRIP(1,I+1,J).GT.EMIN ) THEN +C +c print *,' i ',i,' i + 1 ',I+1 +C DEXY(1,I,J) = ESTRIP(1,I+1,J) DEXY(1,I,J) = ESTRIP(1,I,J) +C + ENPLANEX = ENPLANEX + DEXY(1,I,J) NSTRIP = NSTRIP + 1. - QTOT = QTOT + ESTRIP(1,I,J) - if (i.lt.11) QQ(2) = QQ(2) + ESTRIP(1,I,J) + QTOT = QTOT + DEXY(1,I,J) + if (i.lt.11) QQ(2) = QQ(2) + DEXY(1,I,J) +c IF (I.EQ.21) THEN +c NX22 = NX22 + 1. +c QX22 = QX22 + DEXY(1,I,J) +c ENDIF ENDIF ENDIF IF ( MOD(I,2).EQ.0 ) THEN IF (ESTRIP(2,I,J).GT.EMIN) THEN - ENPLANEY = ENPLANEY + ESTRIP(2,I,J) DEXY(2,I,J) = ESTRIP(2,I,J) + ENPLANEY = ENPLANEY + DEXY(2,I,J) NSTRIP = NSTRIP + 1. - QTOT = QTOT + ESTRIP(2,I,J) - if (i.lt.11) QQ(3) = QQ(3) + ESTRIP(2,I,J) + QTOT = QTOT + DEXY(2,I,J) + if (i.lt.11) QQ(3) = QQ(3) + DEXY(2,I,J) ENDIF IF (ESTRIP(1,I,J).GT.EMIN) THEN - ENPLANEX = ENPLANEX + ESTRIP(1,I,J) +C IF (ESTRIP(1,I-1,J).GT.EMIN) THEN +C +c print *,' i ',i,' i - 1 ',I-1 +C DEXY(1,I,J) = ESTRIP(1,I-1,J) DEXY(1,I,J) = ESTRIP(1,I,J) +C + ENPLANEX = ENPLANEX + DEXY(1,I,J) NSTRIP = NSTRIP + 1. - QTOT = QTOT + ESTRIP(1,I,J) + QTOT = QTOT + DEXY(1,I,J) IF (I.EQ.22) THEN NX22 = NX22 + 1. - QX22 = QX22 + ESTRIP(1,I,J) + QX22 = QX22 + DEXY(1,I,J) ENDIF - IF (I.LT.11) QQ(4) = QQ(4) + ESTRIP(1,I,J) + IF (I.LT.11) QQ(4) = QQ(4) + DEXY(1,I,J) ENDIF ENDIF C @@ -170,13 +185,14 @@ IMPX = (CX - XALIG)/10. TANX = TG(1) ELSE - IMPY =( YALIG - CY)/10. + IMPY =( CY - YALIG)/10. TANY = TG(2) ENDIF C DO I = 1,NPLA - NN = 0 - IF (M.EQ.2) NN = 1 + NN = 1 +C NN = 0 +C IF (M.EQ.2) NN = 1 IF (MOD(I,2).EQ.NN) THEN SHIFT = +0.5 ELSE @@ -193,11 +209,16 @@ DISTY = PIANO(I) YY(I) = DISTY * TG(2) + CY BAR(M,I) = YY(I) - CBAR(M,I) = (YALIG - YY(I))/10. + CBAR(M,I) = (-YALIG + YY(I))/10. C ENDIF CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) CIBAR(M,I) = IBAR(M,I) + IF (ibar(m,i).EQ.-1) THEN + CHTRACK = CHTRACK + 1 + ELSE + IWPL(M) = IWPL(M) + 1 + ENDIF ENDDO ENDIF C