44 |
C measurements, reject if > 10 sigma, calculate chi2 and "quality" |
C measurements, reject if > 10 sigma, calculate chi2 and "quality" |
45 |
C beta is taken as good if chi2<20 and quality>10 |
C beta is taken as good if chi2<20 and quality>10 |
46 |
C The function "newbeta" is located in "tofl2com.for" |
C The function "newbeta" is located in "tofl2com.for" |
47 |
|
C mar-08 WM: Call to "newbeta" changed, now a flag tells the function if the |
48 |
|
C call comes from "tofl2com" or form "toftrack" |
49 |
|
C mar-08 WM: Bug found in dEdx if check_charge>1 |
50 |
C |
C |
51 |
C**************************************************************************** |
C**************************************************************************** |
52 |
IMPLICIT NONE |
IMPLICIT NONE |
1081 |
if (tof11(left,i,iadc).lt.3786) then |
if (tof11(left,i,iadc).lt.3786) then |
1082 |
tof11(left,i,iadc) = tof11(left,i,iadc)*cos(theta) |
tof11(left,i,iadc) = tof11(left,i,iadc)*cos(theta) |
1083 |
xkorr = atten(left,11,i,yhelp) |
xkorr = atten(left,11,i,yhelp) |
1084 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1085 |
adc_c(ch11a(i),hb11a(i))=tof11(left,i,iadc)/xkorr |
adc_c(ch11a(i),hb11a(i))=tof11(left,i,iadc)/xkorr |
1086 |
endif |
endif |
1087 |
|
|
1089 |
if (tof11(right,i,iadc).lt.3786) then |
if (tof11(right,i,iadc).lt.3786) then |
1090 |
tof11(right,i,iadc) = tof11(right,i,iadc)*cos(theta) |
tof11(right,i,iadc) = tof11(right,i,iadc)*cos(theta) |
1091 |
xkorr = atten(right,11,i,yhelp) |
xkorr = atten(right,11,i,yhelp) |
1092 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1093 |
adc_c(ch11b(i),hb11b(i))=tof11(right,i,iadc)/xkorr |
adc_c(ch11b(i),hb11b(i))=tof11(right,i,iadc)/xkorr |
1094 |
endif |
endif |
1095 |
ENDIF |
ENDIF |
1104 |
if (tof12(left,i,iadc).lt.3786) then |
if (tof12(left,i,iadc).lt.3786) then |
1105 |
tof12(left,i,iadc) = tof12(left,i,iadc)*cos(theta) |
tof12(left,i,iadc) = tof12(left,i,iadc)*cos(theta) |
1106 |
xkorr = atten(left,12,i,xhelp) |
xkorr = atten(left,12,i,xhelp) |
1107 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1108 |
adc_c(ch12a(i),hb12a(i))=tof12(left,i,iadc)/xkorr |
adc_c(ch12a(i),hb12a(i))=tof12(left,i,iadc)/xkorr |
1109 |
endif |
endif |
1110 |
|
|
1111 |
if (tof12(right,i,iadc).lt.3786) then |
if (tof12(right,i,iadc).lt.3786) then |
1112 |
tof12(right,i,iadc) = tof12(right,i,iadc)*cos(theta) |
tof12(right,i,iadc) = tof12(right,i,iadc)*cos(theta) |
1113 |
xkorr = atten(right,12,i,xhelp) |
xkorr = atten(right,12,i,xhelp) |
1114 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1115 |
adc_c(ch12b(i),hb12b(i))=tof12(right,i,iadc)/xkorr |
adc_c(ch12b(i),hb12b(i))=tof12(right,i,iadc)/xkorr |
1116 |
endif |
endif |
1117 |
ENDIF |
ENDIF |
1127 |
if (tof21(left,i,iadc).lt.3786) then |
if (tof21(left,i,iadc).lt.3786) then |
1128 |
tof21(left,i,iadc) = tof21(left,i,iadc)*cos(theta) |
tof21(left,i,iadc) = tof21(left,i,iadc)*cos(theta) |
1129 |
xkorr = atten(left,21,i,xhelp) |
xkorr = atten(left,21,i,xhelp) |
1130 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1131 |
adc_c(ch21a(i),hb21a(i))=tof21(left,i,iadc)/xkorr |
adc_c(ch21a(i),hb21a(i))=tof21(left,i,iadc)/xkorr |
1132 |
endif |
endif |
1133 |
|
|
1134 |
if (tof21(right,i,iadc).lt.3786) then |
if (tof21(right,i,iadc).lt.3786) then |
1135 |
tof21(right,i,iadc) = tof21(right,i,iadc)*cos(theta) |
tof21(right,i,iadc) = tof21(right,i,iadc)*cos(theta) |
1136 |
xkorr = atten(right,21,i,xhelp) |
xkorr = atten(right,21,i,xhelp) |
1137 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1138 |
adc_c(ch21b(i),hb21b(i))=tof21(right,i,iadc)/xkorr |
adc_c(ch21b(i),hb21b(i))=tof21(right,i,iadc)/xkorr |
1139 |
endif |
endif |
1140 |
ENDIF |
ENDIF |
1148 |
if (tof22(left,i,iadc).lt.3786) then |
if (tof22(left,i,iadc).lt.3786) then |
1149 |
tof22(left,i,iadc) = tof22(left,i,iadc)*cos(theta) |
tof22(left,i,iadc) = tof22(left,i,iadc)*cos(theta) |
1150 |
xkorr = atten(left,22,i,yhelp) |
xkorr = atten(left,22,i,yhelp) |
1151 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1152 |
adc_c(ch22a(i),hb22a(i))=tof22(left,i,iadc)/xkorr |
adc_c(ch22a(i),hb22a(i))=tof22(left,i,iadc)/xkorr |
1153 |
endif |
endif |
1154 |
|
|
1155 |
if (tof22(right,i,iadc).lt.3786) then |
if (tof22(right,i,iadc).lt.3786) then |
1156 |
tof22(right,i,iadc) = tof22(right,i,iadc)*cos(theta) |
tof22(right,i,iadc) = tof22(right,i,iadc)*cos(theta) |
1157 |
xkorr = atten(right,22,i,yhelp) |
xkorr = atten(right,22,i,yhelp) |
1158 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1159 |
adc_c(ch22b(i),hb22b(i))=tof22(right,i,iadc)/xkorr |
adc_c(ch22b(i),hb22b(i))=tof22(right,i,iadc)/xkorr |
1160 |
endif |
endif |
1161 |
ENDIF |
ENDIF |
1172 |
if (tof31(left,i,iadc).lt.3786) then |
if (tof31(left,i,iadc).lt.3786) then |
1173 |
tof31(left,i,iadc) = tof31(left,i,iadc)*cos(theta) |
tof31(left,i,iadc) = tof31(left,i,iadc)*cos(theta) |
1174 |
xkorr = atten(left,31,i,yhelp) |
xkorr = atten(left,31,i,yhelp) |
1175 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1176 |
adc_c(ch31a(i),hb31a(i))=tof31(left,i,iadc)/xkorr |
adc_c(ch31a(i),hb31a(i))=tof31(left,i,iadc)/xkorr |
1177 |
endif |
endif |
1178 |
|
|
1179 |
if (tof31(right,i,iadc).lt.3786) then |
if (tof31(right,i,iadc).lt.3786) then |
1180 |
tof31(right,i,iadc) = tof31(right,i,iadc)*cos(theta) |
tof31(right,i,iadc) = tof31(right,i,iadc)*cos(theta) |
1181 |
xkorr = atten(right,31,i,yhelp) |
xkorr = atten(right,31,i,yhelp) |
1182 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1183 |
adc_c(ch31b(i),hb31b(i))=tof31(right,i,iadc)/xkorr |
adc_c(ch31b(i),hb31b(i))=tof31(right,i,iadc)/xkorr |
1184 |
endif |
endif |
1185 |
ENDIF |
ENDIF |
1193 |
if (tof32(left,i,iadc).lt.3786) then |
if (tof32(left,i,iadc).lt.3786) then |
1194 |
tof32(left,i,iadc) = tof32(left,i,iadc)*cos(theta) |
tof32(left,i,iadc) = tof32(left,i,iadc)*cos(theta) |
1195 |
xkorr = atten(left,32,i,xhelp) |
xkorr = atten(left,32,i,xhelp) |
1196 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1197 |
adc_c(ch32a(i),hb32a(i))=tof32(left,i,iadc)/xkorr |
adc_c(ch32a(i),hb32a(i))=tof32(left,i,iadc)/xkorr |
1198 |
endif |
endif |
1199 |
|
|
1200 |
if (tof32(right,i,iadc).lt.3786) then |
if (tof32(right,i,iadc).lt.3786) then |
1201 |
tof32(right,i,iadc) = tof32(right,i,iadc)*cos(theta) |
tof32(right,i,iadc) = tof32(right,i,iadc)*cos(theta) |
1202 |
xkorr = atten(right,32,i,xhelp) |
xkorr = atten(right,32,i,xhelp) |
1203 |
if (iz.le.1) xkorr=xkorr/hepratio |
xkorr=xkorr/hepratio |
1204 |
adc_c(ch32b(i),hb32b(i))=tof32(right,i,iadc)/xkorr |
adc_c(ch32b(i),hb32b(i))=tof32(right,i,iadc)/xkorr |
1205 |
endif |
endif |
1206 |
ENDIF |
ENDIF |
1768 |
C if (icount.gt.0) beta_mean=sxw/sw |
C if (icount.gt.0) beta_mean=sxw/sw |
1769 |
C beta_a(13) = beta_mean |
C beta_a(13) = beta_mean |
1770 |
C |
C |
1771 |
|
|
1772 |
C------- New mean beta calculation |
C------- New mean beta calculation |
1773 |
|
|
1774 |
do i=1,12 |
do i=1,12 |
1775 |
btemp(i) = beta_a(i) |
btemp(i) = beta_a(i) |
1776 |
enddo |
enddo |
1777 |
|
|
1778 |
beta_a(13)=newbeta(btemp,hitvec,10.,10.,20.) |
beta_a(13)=newbeta(2,btemp,hitvec,10.,10.,20.) |
1779 |
|
|
1780 |
C------- |
C------- |
1781 |
|
|
1807 |
c write(*,*) ytr_tof |
c write(*,*) ytr_tof |
1808 |
|
|
1809 |
|
|
|
|
|
1810 |
RETURN |
RETURN |
1811 |
END |
END |
1812 |
|
|
1815 |
|
|
1816 |
C------------------------------------------------------------------ |
C------------------------------------------------------------------ |
1817 |
|
|
1818 |
|
|