--- DarthVader/TrackerLevel2/src/F77/functionspfa.f 2006/09/28 14:04:40 1.3 +++ DarthVader/TrackerLevel2/src/F77/functionspfa.f 2006/10/11 06:53:02 1.4 @@ -7,33 +7,33 @@ *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** - real function pfa_eta(ic,angle) + real function pfaeta(ic,angle) *-------------------------------------------------------------- * this function returns the position (in strip units) * it calls: -* - pfa_eta2(ic,angle) -* - pfa_eta3(ic,angle) -* - pfa_eta4(ic,angle) +* - pfaeta2(ic,angle) +* - pfaeta3(ic,angle) +* - pfaeta4(ic,angle) * according to the angle *-------------------------------------------------------------- include 'commontracker.f' c include 'calib.f' include 'level1.f' - pfa_eta = 0 + pfaeta = 0 if(mod(int(VIEW(ic)),2).eq.1)then !Y-view - pfa_eta = pfa_eta2(ic,angle) + pfaeta = pfaeta2(ic,angle) else !X-view if(abs(angle).le.10.)then - pfa_eta = pfa_eta2(ic,angle) + pfaeta = pfaeta2(ic,angle) elseif(abs(angle).gt.10..and.abs(angle).le.15.)then - pfa_eta = pfa_eta3(ic,angle) + pfaeta = pfaeta3(ic,angle) elseif(abs(angle).gt.15.)then - pfa_eta = pfa_eta4(ic,angle) + pfaeta = pfaeta4(ic,angle) endif endif @@ -46,7 +46,7 @@ real function ris_eta(ic,angle) *-------------------------------------------------------------- * this function returns the average spatial resolution -* (in cm) for the ETA algorithm (function pfa_eta(ic,angle)) +* (in cm) for the ETA algorithm (function pfaeta(ic,angle)) * it calls: * - risx_eta2(angle) * - risy_eta2(angle) @@ -129,8 +129,8 @@ c***************************************************** cccccc 02/02/2006 modified by Elena Vannuccini --> (1) c***************************************************** -c real function pfa_eta2(cog2,view,lad,angle) - real function pfa_eta2(ic,angle) !(1) +c real function pfaeta2(cog2,view,lad,angle) + real function pfaeta2(ic,angle) !(1) *-------------------------------------------------------------- * this function returns * @@ -155,7 +155,7 @@ iview = VIEW(ic) !(1) lad = nld(MAXS(ic),VIEW(ic)) !(1) cog2 = cog(2,ic) !(1) - pfa_eta2=cog2 + pfaeta2=cog2 * find angular bin * (in futuro possiamo pensare di interpolare anche sull'angolo) @@ -167,7 +167,7 @@ endif enddo if(DEBUG) - $ print*,'pfa_eta2 *** warning *** angle out of range: ',angle + $ print*,'pfaeta2 *** warning *** angle out of range: ',angle if(angle.lt.angL(1))iang=1 if(angle.gt.angR(nangbin))iang=nangbin 98 continue !jump here if ok @@ -177,7 +177,7 @@ c$$$ iflag=0 c$$$* -------------------------------- c$$$ if(cog2.lt.eta2(1,iang).or.cog2.gt.eta2(netaval,iang))then -c$$$c print*,'pfa_eta2 *** warning *** argument out of range: ',cog2 +c$$$c print*,'pfaeta2 *** warning *** argument out of range: ',cog2 c$$$* goto 100 c$$$* ---------------------------------------------- c$$$* non salto piu`, ma scalo di 1 o -1 @@ -230,20 +230,20 @@ AA=(y2-y1)/(x2-x1) BB=y1-AA*x1 - pfa_eta2 = AA*cog2+BB - pfa_eta2 = pfa_eta2 - iadd + pfaeta2 = AA*cog2+BB + pfaeta2 = pfaeta2 - iadd c$$$ if(iflag.eq.1)then -c$$$ pfa_eta2=pfa_eta2-1. !temp +c$$$ pfaeta2=pfaeta2-1. !temp c$$$ cog2=cog2-1. !temp c$$$ endif c$$$ if(iflag.eq.-1)then -c$$$ pfa_eta2=pfa_eta2+1. !temp +c$$$ pfaeta2=pfaeta2+1. !temp c$$$ cog2=cog2+1. !temp c$$$ endif if(DEBUG)print*,'ETA2 (ic ',ic,' ang',angle,')' - $ ,cog2-iadd,' -->',pfa_eta2 + $ ,cog2-iadd,' -->',pfaeta2 100 return @@ -253,8 +253,8 @@ c***************************************************** cccccc 02/02/2006 modified by Elena Vannuccini --> (1) c***************************************************** -c real function pfa_eta3(cog3,view,lad,angle) - real function pfa_eta3(ic,angle) !(1) +c real function pfaeta3(cog3,view,lad,angle) + real function pfaeta3(ic,angle) !(1) *-------------------------------------------------------------- * this function returns * @@ -280,7 +280,7 @@ iview = VIEW(ic) !(1) lad = nld(MAXS(ic),VIEW(ic)) !(1) cog3 = cog(3,ic) !(1) - pfa_eta3=cog3 + pfaeta3=cog3 * find angular bin * (in futuro possiamo pensare di interpolare anche sull'angolo) @@ -292,7 +292,7 @@ endif enddo if(DEBUG) - $ print*,'pfa_eta3 *** warning *** angle out of range: ',angle + $ print*,'pfaeta3 *** warning *** angle out of range: ',angle if(angle.lt.angL(1))iang=1 if(angle.gt.angR(nangbin))iang=nangbin 98 continue !jump here if ok @@ -354,20 +354,20 @@ AA=(y2-y1)/(x2-x1) BB=y1-AA*x1 - pfa_eta3 = AA*cog3+BB - pfa_eta3 = pfa_eta3 - iadd + pfaeta3 = AA*cog3+BB + pfaeta3 = pfaeta3 - iadd c$$$ if(iflag.eq.1)then -c$$$ pfa_eta2=pfa_eta2-1. !temp +c$$$ pfaeta2=pfaeta2-1. !temp c$$$ cog2=cog2-1. !temp c$$$ endif c$$$ if(iflag.eq.-1)then -c$$$ pfa_eta2=pfa_eta2+1. !temp +c$$$ pfaeta2=pfaeta2+1. !temp c$$$ cog2=cog2+1. !temp c$$$ endif if(DEBUG)print*,'ETA3 (ic ',ic,' ang',angle,')' - $ ,cog3-iadd,' -->',pfa_eta3 + $ ,cog3-iadd,' -->',pfaeta3 100 return end @@ -376,8 +376,8 @@ c***************************************************** cccccc 02/02/2006 modified by Elena Vannuccini --> (1) c***************************************************** -c real function pfa_eta4(cog4,view,lad,angle) - real function pfa_eta4(ic,angle) !(1) +c real function pfaeta4(cog4,view,lad,angle) + real function pfaeta4(ic,angle) !(1) *-------------------------------------------------------------- * this function returns * @@ -399,10 +399,10 @@ c logical DEBUG c common/dbg/DEBUG - iview = VIEW(ic) !(1) + iview = VIEW(ic) !(1) lad = nld(MAXS(ic),VIEW(ic)) !(1) cog4=cog(4,ic) !(1) - pfa_eta4=cog4 + pfaeta4=cog4 * find angular bin * (in futuro possiamo pensare di interpolare anche sull'angolo) @@ -414,7 +414,7 @@ endif enddo if(DEBUG) - $ print*,'pfa_eta4 *** warning *** angle out of range: ',angle + $ print*,'pfaeta4 *** warning *** angle out of range: ',angle if(angle.lt.angL(1))iang=1 if(angle.gt.angR(nangbin))iang=nangbin 98 continue !jump here if ok @@ -476,20 +476,20 @@ AA=(y2-y1)/(x2-x1) BB=y1-AA*x1 - pfa_eta4 = AA*cog4+BB - pfa_eta4 = pfa_eta4 - iadd + pfaeta4 = AA*cog4+BB + pfaeta4 = pfaeta4 - iadd c$$$ if(iflag.eq.1)then -c$$$ pfa_eta2=pfa_eta2-1. !temp +c$$$ pfaeta2=pfaeta2-1. !temp c$$$ cog2=cog2-1. !temp c$$$ endif c$$$ if(iflag.eq.-1)then -c$$$ pfa_eta2=pfa_eta2+1. !temp +c$$$ pfaeta2=pfaeta2+1. !temp c$$$ cog2=cog2+1. !temp c$$$ endif if(DEBUG)print*,'ETA4 (ic ',ic,' ang',angle,')' - $ ,cog4-iadd,' -->',pfa_eta4 + $ ,cog4-iadd,' -->',pfaeta4 100 return end @@ -655,7 +655,9 @@ COG = 0. - if(ncog.eq.2)then + if(ncog.eq.1)then + COG = 0. + elseif(ncog.eq.2)then if(sl1.gt.sr1)then COG = -sl1/(sl1+sc) elseif(sl1.le.sr1)then @@ -693,13 +695,14 @@ mu = 0 do i = istart,istop ipos = i-INDMAX(ic) - ivk = nvk(MAXS(ic)+ipos) - is = nst(MAXS(ic)+ipos) +cc ivk = nvk(MAXS(ic)+ipos) +cc is = nst(MAXS(ic)+ipos) * print*,'******************',istart,istop,ipos * $ ,MAXS(ic)+ipos,iv,ivk,is - cut = incut*SIGMA(iv,ivk,is) - if(SIGMA(iv,ivk,is).ne.CLSIGMA(i)) - $ print*,'cog(0,ic) --> hai fatto qualche cazzata' +cc cut = incut*SIGMA(iv,ivk,is) + cut = incut*CLSIGMA(i) +c if(SIGMA(iv,ivk,is).ne.CLSIGMA(i)) +c $ print*,'cog(0,ic) --> hai fatto qualche cazzata' if(CLSIGNAL(i).ge.cut)then COG = COG + ipos*CLSIGNAL(i) mu = mu + 1