231 |
* temporary patch for saturated clusters |
* temporary patch for saturated clusters |
232 |
* ====================================== |
* ====================================== |
233 |
if( nsatstrips(ic).gt.0 )then |
if( nsatstrips(ic).gt.0 )then |
234 |
corr = cog(4,ic) |
c corr = cog(4,ic) |
235 |
|
corr = digsat(ic) |
236 |
res = pitchX*1e-4/sqrt(12.) |
res = pitchX*1e-4/sqrt(12.) |
237 |
cc cc=cog(4,ic) |
cc cc=cog(4,ic) |
238 |
c$$$ print*,ic,' *** ',cc |
c$$$ print*,ic,' *** ',cc |
314 |
* temporary patch for saturated clusters |
* temporary patch for saturated clusters |
315 |
* ====================================== |
* ====================================== |
316 |
if( nsatstrips(ic).gt.0 )then |
if( nsatstrips(ic).gt.0 )then |
317 |
corr = cog(4,ic) |
c corr = cog(4,ic) |
318 |
|
corr = digsat(ic) |
319 |
res = pitchY*1e-4/sqrt(12.) |
res = pitchY*1e-4/sqrt(12.) |
320 |
cc cc=cog(4,ic) |
cc cc=cog(4,ic) |
321 |
c$$$ print*,ic,' *** ',cc |
c$$$ print*,ic,' *** ',cc |
941 |
return |
return |
942 |
end |
end |
943 |
|
|
944 |
|
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
945 |
|
real function digsat(ic) |
946 |
|
*------------------------------------------------- |
947 |
|
* |
948 |
|
* |
949 |
|
*------------------------------------------------- |
950 |
|
include 'commontracker.f' |
951 |
|
include 'calib.f' |
952 |
|
include 'level1.f' |
953 |
|
|
954 |
|
integer nsat |
955 |
|
real pitchsat |
956 |
|
|
957 |
|
nsat = 0 |
958 |
|
pitchsat = 0. |
959 |
|
iv=VIEW(ic) |
960 |
|
istart = INDSTART(IC) |
961 |
|
istop = TOTCLLENGTH |
962 |
|
if(ic.lt.NCLSTR1)istop=INDSTART(IC+1)-1 |
963 |
|
do i = INDMAX(IC),istart,-1 |
964 |
|
if( (mod(iv,2).eq.1.and.CLADC(i).lt.ADCsatx) |
965 |
|
$ .or. |
966 |
|
$ (mod(iv,2).eq.0.and.CLADC(i).gt.ADCsaty) )then |
967 |
|
nsat = nsat + 1 |
968 |
|
pitchsat = pitchsat + i - INDMAX(IC) |
969 |
|
else |
970 |
|
goto 10 |
971 |
|
endif |
972 |
|
enddo |
973 |
|
10 continue |
974 |
|
do i = INDMAX(IC)+1,istop |
975 |
|
if( (mod(iv,2).eq.1.and.CLADC(i).lt.ADCsatx) |
976 |
|
$ .or. |
977 |
|
$ (mod(iv,2).eq.0.and.CLADC(i).gt.ADCsaty) )then |
978 |
|
nsat = nsat + 1 |
979 |
|
pitchsat = pitchsat + i - INDMAX(IC) |
980 |
|
else |
981 |
|
goto 20 |
982 |
|
endif |
983 |
|
enddo |
984 |
|
20 continue |
985 |
|
|
986 |
|
digsat = 0 |
987 |
|
if (nsat.gt.0) digsat = pitchsat / nsat |
988 |
|
|
989 |
|
return |
990 |
|
end |
991 |
|
|
992 |
|
|
993 |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
994 |
real function cog(ncog,ic) |
real function cog(ncog,ic) |
1055 |
c ============================================================== |
c ============================================================== |
1056 |
if(ncog.eq.1)then |
if(ncog.eq.1)then |
1057 |
COG = 0. |
COG = 0. |
1058 |
if(sr1.gt.sc)cog=1. |
if(sr1.gt.sc)cog=1. |
1059 |
if(sl1.gt.sc.and.sl1.gt.sr1)cog=-1. |
if(sl1.gt.sc.and.sl1.gt.sr1)cog=-1. |
1060 |
c ============================================================== |
c ============================================================== |
1061 |
elseif(ncog.eq.2)then |
elseif(ncog.eq.2)then |
1062 |
COG = 0. |
COG = 0. |
1064 |
if((sl1+sc).ne.0)COG = -sl1/(sl1+sc) |
if((sl1+sc).ne.0)COG = -sl1/(sl1+sc) |
1065 |
elseif(sl1.lt.sr1)then |
elseif(sl1.lt.sr1)then |
1066 |
if((sc+sr1).ne.0)COG = sr1/(sc+sr1) |
if((sc+sr1).ne.0)COG = sr1/(sc+sr1) |
1067 |
elseif( sl1.eq.sr1.and.sl1.ne.-9999.)then |
elseif( sl1.eq.sr1.and.sl1.ne.-9999.)then |
1068 |
if( clsigma(indmax(ic)-1).lt.clsigma(indmax(ic)+1) |
if( clsigma(indmax(ic)-1).lt.clsigma(indmax(ic)+1) |
1069 |
$ .and.(sl1+sc).ne.0 )cog = -sl1/(sl1+sc) |
$ .and.(sl1+sc).ne.0 )cog = -sl1/(sl1+sc) |
1070 |
if( clsigma(indmax(ic)-1).gt.clsigma(indmax(ic)+1) |
if( clsigma(indmax(ic)-1).gt.clsigma(indmax(ic)+1) |
1071 |
$ .and.(sc+sr1).ne.0 )cog = sr1/(sc+sr1) |
$ .and.(sc+sr1).ne.0 )cog = sr1/(sc+sr1) |
1072 |
endif |
endif |
1073 |
c if(cog==0)print*,'Strange cluster (2) - @maxs ',MAXS(ic) |
c if(cog==0)print*,'Strange cluster (2) - @maxs ',MAXS(ic) |
1074 |
c $ ,' : ',sl2,sl1,sc,sr1,sr2 |
c $ ,' : ',sl2,sl1,sc,sr1,sr2 |
1075 |
c ============================================================== |
c ============================================================== |