36 ACTS_DEBUG(
"Initialize the histograms for residual and pull plots");
46 Form(
"res_%s", parName.c_str()),
47 Form(
"Residual of %s", parName.c_str()), bResidual);
50 Form(
"res_%s_vs_eta", parName.c_str()),
51 Form(
"Residual of %s vs eta", parName.c_str()), bEta, bResidual);
54 Form(
"resmean_%s_vs_eta", parName.c_str()),
55 Form(
"Residual mean of %s", parName.c_str()), bEta);
58 Form(
"reswidth_%s_vs_eta", parName.c_str()),
59 Form(
"Residual width of %s", parName.c_str()), bEta);
62 Form(
"res_%s_vs_pT", parName.c_str()),
63 Form(
"Residual of %s vs pT", parName.c_str()), bPt, bResidual);
66 Form(
"resmean_%s_vs_pT", parName.c_str()),
67 Form(
"Residual mean of %s", parName.c_str()), bPt);
70 Form(
"reswidth_%s_vs_pT", parName.c_str()),
71 Form(
"Residual width of %s", parName.c_str()), bPt);
74 resPlotCache.
pull[parName] =
76 Form(
"Pull of %s", parName.c_str()), bPull);
79 Form(
"pull_%s_vs_eta", parName.c_str()),
80 Form(
"Pull of %s vs eta", parName.c_str()), bEta, bPull);
84 Form(
"Pull mean of %s", parName.c_str()), bEta);
88 Form(
"Pull width of %s", parName.c_str()), bEta);
91 Form(
"pull_%s_vs_pT", parName.c_str()),
92 Form(
"Pull of %s vs pT", parName.c_str()), bPt, bPull);
96 Form(
"Pull mean of %s", parName.c_str()), bPt);
100 Form(
"Pull width of %s", parName.c_str()), bPt);
108 delete resPlotCache.
res.at(parName);
112 delete resPlotCache.
res_vs_pT.at(parName);
115 delete resPlotCache.
pull.at(parName);
127 ACTS_DEBUG(
"Write the hists to output file.");
130 resPlotCache.
res.at(parName)->Write();
134 resPlotCache.
res_vs_pT.at(parName)->Write();
137 resPlotCache.
pull.at(parName)->Write();
158 auto trackParameter = fittedParamters.
parameters();
164 ParametersVector truthParameter = ParametersVector::Zero();
175 ACTS_ERROR(
"Global to local transformation did not succeed.");
192 float residual = trackParameter[parID] - truthParameter[parID];
199 if (fittedParamters.
covariance().has_value()) {
202 float pull = residual / sqrt(
covariance(parID, parID));
210 <<
" has negative covariance = "
215 <<
" has no covariance");
229 for (
int j = 1; j <= static_cast<int>(bEta.
nBins());
j++) {
230 TH1D* temp_res = resPlotCache.
res_vs_eta.at(parName)->ProjectionY(
231 Form(
"%s_projy_bin%d",
"Residual_vs_eta_Histo",
j),
j,
j);
236 TH1D* temp_pull = resPlotCache.
pull_vs_eta.at(parName)->ProjectionY(
237 Form(
"%s_projy_bin%d",
"Pull_vs_eta_Histo",
j),
j,
j);
244 for (
int j = 1; j <= static_cast<int>(bPt.
nBins());
j++) {
245 TH1D* temp_res = resPlotCache.
res_vs_pT.at(parName)->ProjectionY(
246 Form(
"%s_projy_bin%d",
"Residual_vs_pT_Histo",
j),
j,
j);
250 TH1D* temp_pull = resPlotCache.
pull_vs_pT.at(parName)->ProjectionY(
251 Form(
"%s_projy_bin%d",
"Pull_vs_pT_Histo",
j),
j,
j);