48 const double residual = (*resiter)[
kResidual];
52 if (fabs(residual) < 0.1) {
54 sum_xx += residual * residual;
71 const double residual = (*resiter)[
kResidual];
74 sum_xx += residual * residual;
85 const double residual = (*resiter)[
kResidual];
88 sum_xx += residual * residual;
95 std::vector<int> parNum;
96 std::vector<std::string> parName;
97 std::vector<double>
start;
98 std::vector<double>
step;
99 std::vector<double>
low;
100 std::vector<double>
high;
139 std::stringstream raw_name, narrowed_name, xcontrol_name, ycontrol_name;
140 raw_name <<
name <<
"_raw";
141 narrowed_name <<
name <<
"_narrowed";
142 xcontrol_name <<
name <<
"_xcontrol";
143 ycontrol_name <<
name <<
"_ycontrol";
146 dir->make<TH1F>(raw_name.str().c_str(), (raw_name.str() +
std::string(
" (mrad)")).c_str(), 100, -100., 100.);
147 TH1F *narrowed_hist =
dir->make<TH1F>(
148 narrowed_name.str().c_str(), (narrowed_name.str() +
std::string(
" (mrad)")).c_str(), 100, -100., 100.);
149 TProfile *xcontrol_hist =
dir->make<TProfile>(
150 xcontrol_name.str().c_str(), (xcontrol_name.str() +
std::string(
" (mrad)")).c_str(), 100, -1., 1.);
151 TProfile *ycontrol_hist =
dir->make<TProfile>(
152 ycontrol_name.str().c_str(), (ycontrol_name.str() +
std::string(
" (mrad)")).c_str(), 100, -1., 1.);
154 narrowed_name <<
"fit";
155 xcontrol_name <<
"fit";
156 ycontrol_name <<
"fit";
158 double scale_factor = double(
numResiduals()) * (100. - -100.) / 100;
160 TF1 *narrowed_fit =
nullptr;
164 narrowed_fit->Write();
168 narrowed_fit->Write();
172 narrowed_fit->Write();
176 narrowed_fit->Write();
179 TF1 *xcontrol_fit =
new TF1(xcontrol_name.str().c_str(),
"[0]+x*[1]", -1., 1.);
181 xcontrol_fit->Write();
183 TF1 *ycontrol_fit =
new TF1(ycontrol_name.str().c_str(),
"[0]+x*[1]", -1., 1.);
185 ycontrol_fit->Write();
188 const double raw_residual = (*resiter)[
kResidual];
190 const double yangle = (*resiter)[
kYAngle];
194 double corrected_residual = raw_residual - xangle_correction - yangle_correction;
196 raw_hist->Fill(raw_residual * 1000.);
197 narrowed_hist->Fill(corrected_residual * 1000.);
199 xcontrol_hist->Fill(
xangle, (raw_residual - yangle_correction) * 1000.);
200 ycontrol_hist->Fill(yangle, (raw_residual - xangle_correction) * 1000.);