--- DarthVader/TrackerLevel2/src/F77/functionspfa.f 2009/08/11 12:58:25 1.26 +++ DarthVader/TrackerLevel2/src/F77/functionspfa.f 2013/03/12 11:02:02 1.27 @@ -231,7 +231,8 @@ * temporary patch for saturated clusters * ====================================== if( nsatstrips(ic).gt.0 )then - corr = cog(4,ic) +c corr = cog(4,ic) + corr = digsat(ic) res = pitchX*1e-4/sqrt(12.) cc cc=cog(4,ic) c$$$ print*,ic,' *** ',cc @@ -313,7 +314,8 @@ * temporary patch for saturated clusters * ====================================== if( nsatstrips(ic).gt.0 )then - corr = cog(4,ic) +c corr = cog(4,ic) + corr = digsat(ic) res = pitchY*1e-4/sqrt(12.) cc cc=cog(4,ic) c$$$ print*,ic,' *** ',cc @@ -939,7 +941,54 @@ return end - +*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** + real function digsat(ic) +*------------------------------------------------- +* +* +*------------------------------------------------- + include 'commontracker.f' + include 'calib.f' + include 'level1.f' + + integer nsat + real pitchsat + + nsat = 0 + pitchsat = 0. + iv=VIEW(ic) + istart = INDSTART(IC) + istop = TOTCLLENGTH + if(ic.lt.NCLSTR1)istop=INDSTART(IC+1)-1 + do i = INDMAX(IC),istart,-1 + if( (mod(iv,2).eq.1.and.CLADC(i).lt.ADCsatx) + $ .or. + $ (mod(iv,2).eq.0.and.CLADC(i).gt.ADCsaty) )then + nsat = nsat + 1 + pitchsat = pitchsat + i - INDMAX(IC) + else + goto 10 + endif + enddo + 10 continue + do i = INDMAX(IC)+1,istop + if( (mod(iv,2).eq.1.and.CLADC(i).lt.ADCsatx) + $ .or. + $ (mod(iv,2).eq.0.and.CLADC(i).gt.ADCsaty) )then + nsat = nsat + 1 + pitchsat = pitchsat + i - INDMAX(IC) + else + goto 20 + endif + enddo + 20 continue + + digsat = 0 + if (nsat.gt.0) digsat = pitchsat / nsat + + return + end + *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** real function cog(ncog,ic)