--- DarthVader/TrackerLevel2/src/F77/functionspfa.f 2007/09/04 09:47:49 1.22 +++ DarthVader/TrackerLevel2/src/F77/functionspfa.f 2008/03/05 17:00:20 1.23 @@ -70,7 +70,8 @@ by = bbb if(iview.eq.12) angx = -1. * ang if(iview.eq.12) by = -1. * bbb - tgtemp = tan(ang*acos(-1.)/180.) + pmuH_h*by*0.00001 +cc tgtemp = tan(ang*acos(-1.)/180.) + pmuH_h*by*0.00001 !ORRORE!! + tgtemp = tan(angx*acos(-1.)/180.) + pmuH_h*by*0.00001 elseif(mod(iview,2).eq.1)then c ================================================= @@ -612,7 +613,9 @@ cog2 = cog(2,ic) pfaeta2=cog2 +* ---------------- * find angular bin +* ---------------- * (in futuro possiamo pensare di interpolare anche sull'angolo) do iang=1,nangbin if(angL(iang).lt.angle.and.angR(iang).ge.angle)then @@ -626,42 +629,32 @@ if(angle.ge.angR(nangbin))iang=nangbin 98 continue !jump here if ok +* ------------- +* within +/-0.5 +* ------------- -c$$$* find extremes of interpolation -c$$$ iflag=0 -c$$$* -------------------------------- -c$$$ if(cog2.lt.eta2(1,iang).or.cog2.gt.eta2(netaval,iang))then -c$$$c print*,'pfaeta2 *** warning *** argument out of range: ',cog2 -c$$$* goto 100 -c$$$* ---------------------------------------------- -c$$$* non salto piu`, ma scalo di 1 o -1 -c$$$* nel caso si tratti di un cluster -c$$$* in cui la strip con il segnale massimo non coincide -c$$$* con la strip con il rapposto s/n massimo!!! -c$$$* ---------------------------------------------- -c$$$ if(cog2.lt.eta2(1,iang))then !temp -c$$$ cog2=cog2+1. !temp -c$$$ iflag=1 !temp -c$$$ else !temp -c$$$ cog2=cog2-1. !temp -c$$$ iflag=-1 !temp -c$$$ endif !temp -c$$$c print*,'shifted >>> ',cog2 -c$$$ endif - + iaddmax=10 iadd=0 10 continue if(cog2.lt.eta2(1,iang))then cog2 = cog2 + 1 iadd = iadd + 1 + if(iadd>iaddmax)goto 111 goto 10 endif 20 continue if(cog2.gt.eta2(netaval,iang))then cog2 = cog2 - 1 iadd = iadd - 1 + if(iadd<-1*iaddmax)goto 111 goto 20 endif + goto 1111 + 111 continue + if(DEBUG.eq.1)print*,'pfaeta2 *** warning *** anomalous cluster' + if(DEBUG.eq.1)print*,'--> COG(2) = ',cog2-iadd,' (set to zero)' + cog2=0 + 1111 continue * -------------------------------- c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2 @@ -726,10 +719,14 @@ iview = VIEW(ic) lad = nld(MAXS(ic),VIEW(ic)) - cog3 = cog(3,ic) + cog3 = cog(3,ic) + cc = cog3 + cog3 = cc pfaeta3=cog3 +* ---------------- * find angular bin +* ---------------- * (in futuro possiamo pensare di interpolare anche sull'angolo) do iang=1,nangbin c print*,'~~~~~~~~~~~~ ',iang,angL(iang),angR(iang),angle @@ -744,41 +741,32 @@ if(angle.ge.angR(nangbin))iang=nangbin 98 continue !jump here if ok +* ------------- +* within +/-0.5 +* ------------- -c$$$* find extremes of interpolation -c$$$ iflag=0 -c$$$* -------------------------------- -c$$$ if(cog3.lt.eta3(1,iang).or.cog3.gt.eta3(netaval,iang))then -c$$$* ---------------------------------------------- -c$$$* non salto piu`, ma scalo di 1 o -1 -c$$$* nel caso si tratti di un cluster -c$$$* in cui la strip con il segnale massimo non coincide -c$$$* con la strip con il rapposto s/n massimo!!! -c$$$* ---------------------------------------------- -c$$$ if(cog2.lt.eta2(1,iang))then !temp -c$$$ cog2=cog2+1. !temp -c$$$ iflag=1 !temp -c$$$ else !temp -c$$$ cog2=cog2-1. !temp -c$$$ iflag=-1 !temp -c$$$ endif !temp -c$$$c print*,'shifted >>> ',cog2 -c$$$ endif - - + iaddmax=10 iadd=0 10 continue if(cog3.lt.eta3(1,iang))then - cog3 = cog3 + 1 + cog3 = cog3 + 1. iadd = iadd + 1 + if(iadd>iaddmax) goto 111 goto 10 endif 20 continue if(cog3.gt.eta3(netaval,iang))then - cog3 = cog3 - 1 + cog3 = cog3 - 1. iadd = iadd - 1 + if(iadd<-1*iaddmax) goto 111 goto 20 endif + goto 1111 + 111 continue + if(DEBUG.eq.1)print*,'pfaeta3 *** warning *** anomalous cluster' + if(DEBUG.eq.1)print*,'--> COG(3) = ',cog3-iadd,' (set to zero)' + cog3=0 + 1111 continue * -------------------------------- c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2 @@ -804,14 +792,6 @@ pfaeta3 = AA*cog3+BB pfaeta3 = pfaeta3 - iadd -c$$$ if(iflag.eq.1)then -c$$$ pfaeta2=pfaeta2-1. !temp -c$$$ cog2=cog2-1. !temp -c$$$ endif -c$$$ if(iflag.eq.-1)then -c$$$ pfaeta2=pfaeta2+1. !temp -c$$$ cog2=cog2+1. !temp -c$$$ endif if(DEBUG.EQ.1)print*,'ETA3 (ic ',ic,' ang',angle,')' $ ,cog3-iadd,' -->',pfaeta3 @@ -845,7 +825,9 @@ cog4=cog(4,ic) pfaeta4=cog4 +* ---------------- * find angular bin +* ---------------- * (in futuro possiamo pensare di interpolare anche sull'angolo) do iang=1,nangbin c print*,'~~~~~~~~~~~~ ',iang,angL(iang),angR(iang),angle @@ -860,41 +842,32 @@ if(angle.ge.angR(nangbin))iang=nangbin 98 continue !jump here if ok +* ------------- +* within +/-0.5 +* ------------- -c$$$* find extremes of interpolation -c$$$ iflag=0 -c$$$* -------------------------------- -c$$$ if(cog3.lt.eta3(1,iang).or.cog3.gt.eta3(netaval,iang))then -c$$$* ---------------------------------------------- -c$$$* non salto piu`, ma scalo di 1 o -1 -c$$$* nel caso si tratti di un cluster -c$$$* in cui la strip con il segnale massimo non coincide -c$$$* con la strip con il rapposto s/n massimo!!! -c$$$* ---------------------------------------------- -c$$$ if(cog2.lt.eta2(1,iang))then !temp -c$$$ cog2=cog2+1. !temp -c$$$ iflag=1 !temp -c$$$ else !temp -c$$$ cog2=cog2-1. !temp -c$$$ iflag=-1 !temp -c$$$ endif !temp -c$$$c print*,'shifted >>> ',cog2 -c$$$ endif - - + iaddmax=10 iadd=0 10 continue if(cog4.lt.eta4(1,iang))then cog4 = cog4 + 1 iadd = iadd + 1 + if(iadd>iaddmax)goto 111 goto 10 endif 20 continue if(cog4.gt.eta4(netaval,iang))then cog4 = cog4 - 1 iadd = iadd - 1 + if(iadd<-1*iaddmax)goto 111 goto 20 endif + goto 1111 + 111 continue + if(DEBUG.eq.1)print*,'pfaeta4 *** warning *** anomalous cluster' + if(DEBUG.eq.1)print*,'--> COG(4) = ',cog4-iadd,' (set to zero)' + cog4=0 + 1111 continue * -------------------------------- c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2 @@ -997,7 +970,7 @@ COG = 0. -c print*,'## ',sl2,sl1,sc,sr1,sr2 +c print *,'## ',sl2,sl1,sc,sr1,sr2 c ============================================================== if(ncog.eq.1)then @@ -1138,6 +1111,14 @@ c print *,'## cog ',ncog,ic,cog,'/////////////' + if(COG.lt.-0.75.or.COG.gt.+0.75)then + if(DEBUG.eq.1) + $ print*,'cog *** warning *** anomalous cluster ??? --> ' + if(DEBUG.eq.1) + $ print*,sl2,sl1,sc,sr1,sr2,' --> COG(',ncog,') = ',COG + endif + + return end