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.);
double MuonResidualsFitter_logGaussPowerTails(double residual, double center, double sigma)
Double_t MuonResidualsFitter_powerLawTails_TF1(Double_t *xvec, Double_t *par)
int residualsModel() const
std::vector< double * >::const_iterator residuals_begin() const
MuonResidualsFitter * fitter()
double plot(std::string name, TFileDirectory *dir, Alignable *ali) override
long numResiduals() const
std::vector< double * >::const_iterator residuals_end() const
bool dofit(void(*fcn)(int &, double *, double &, double *, int), std::vector< int > &parNum, std::vector< std::string > &parName, std::vector< double > &start, std::vector< double > &step, std::vector< double > &low, std::vector< double > &high)
double MuonResidualsFitter_logROOTVoigt(double residual, double center, double sigma, double gamma)
bool fit(Alignable *ali) override
double MuonResidualsFitter_logPowerLawTails(double residual, double center, double sigma, double gamma)
Double_t MuonResidualsFitter_GaussPowerTails_TF1(Double_t *xvec, Double_t *par)
Double_t MuonResidualsFitter_pureGaussian_TF1(Double_t *xvec, Double_t *par)
void MuonResidualsAngleFitter_FCN(int &npar, double *gin, double &fval, double *par, int iflag)
void inform(TMinuit *tMinuit) override
Double_t MuonResidualsFitter_ROOTVoigt_TF1(Double_t *xvec, Double_t *par)
static TMinuit * MuonResidualsAngleFitter_TMinuit
int sum_x
More diagnostics.
double MuonResidualsFitter_logPureGaussian(double residual, double center, double sigma)
Power< A, B >::type pow(const A &a, const B &b)