24 ACTS_DEBUG(
"Initialize the histograms for residual and pull plots");
26 std::string parName = m_cfg.paramNames.at(parID);
28 std::string parResidual =
"Residual_" + parName;
34 Form(
"res_%s", parName.c_str()),
35 Form(
"Residual of %s", parName.c_str()), bResidual);
38 Form(
"res_%s_vs_eta", parName.c_str()),
39 Form(
"Residual of %s vs eta", parName.c_str()), bEta, bResidual);
42 Form(
"resmean_%s_vs_eta", parName.c_str()),
43 Form(
"Residual mean of %s", parName.c_str()), bEta);
46 Form(
"reswidth_%s_vs_eta", parName.c_str()),
47 Form(
"Residual width of %s", parName.c_str()), bEta);
50 Form(
"res_%s_vs_pT", parName.c_str()),
51 Form(
"Residual of %s vs pT", parName.c_str()), bPt, bResidual);
54 Form(
"resmean_%s_vs_pT", parName.c_str()),
55 Form(
"Residual mean of %s", parName.c_str()), bPt);
58 Form(
"reswidth_%s_vs_pT", parName.c_str()),
59 Form(
"Residual width of %s", parName.c_str()), bPt);
62 resPlotCache.
pull[parName] =
64 Form(
"Pull of %s", parName.c_str()), bPull);
67 Form(
"pull_%s_vs_eta", parName.c_str()),
68 Form(
"Pull of %s vs eta", parName.c_str()), bEta, bPull);
72 Form(
"Pull mean of %s", parName.c_str()), bEta);
76 Form(
"Pull width of %s", parName.c_str()), bEta);
79 Form(
"pull_%s_vs_pT", parName.c_str()),
80 Form(
"Pull of %s vs pT", parName.c_str()), bPt, bPull);
84 Form(
"Pull mean of %s", parName.c_str()), bPt);
88 Form(
"Pull width of %s", parName.c_str()), bPt);
95 std::string parName = m_cfg.paramNames.at(parID);
96 delete resPlotCache.
res.at(parName);
100 delete resPlotCache.
res_vs_pT.at(parName);
103 delete resPlotCache.
pull.at(parName);
115 ACTS_DEBUG(
"Write the hists to output file.");
117 std::string parName = m_cfg.paramNames.at(parID);
118 resPlotCache.
res.at(parName)->Write();
122 resPlotCache.
res_vs_pT.at(parName)->Write();
125 resPlotCache.
pull.at(parName)->Write();
146 auto trackParameter = fittedParamters.
parameters();
147 auto covariance = *fittedParamters.
covariance();
153 ParametersVector truthParameter = ParametersVector::Zero();
156 auto lpResult = pSurface->globalToLocal(gctx, truthParticle.
position(),
164 ACTS_ERROR(
"Global to local transformation did not succeed.");
180 std::string parName = m_cfg.paramNames.at(parID);
181 float residual = trackParameter[parID] - truthParameter[parID];
187 if (covariance(parID, parID) > 0) {
188 float pull = residual / sqrt(covariance(parID, parID));
196 <<
" has negative covariance = "
197 << covariance(parID, parID));
209 std::string parName = m_cfg.paramNames.at(parID);
211 for (
int j = 1; j <= bEta.
nBins; j++) {
212 TH1D* temp_res = resPlotCache.
res_vs_eta.at(parName)->ProjectionY(
213 Form(
"%s_projy_bin%d",
"Residual_vs_eta_Histo", j), j, j);
218 TH1D* temp_pull = resPlotCache.
pull_vs_eta.at(parName)->ProjectionY(
219 Form(
"%s_projy_bin%d",
"Pull_vs_eta_Histo", j), j, j);
226 for (
int j = 1; j <= bPt.
nBins; j++) {
227 TH1D* temp_res = resPlotCache.
res_vs_pT.at(parName)->ProjectionY(
228 Form(
"%s_projy_bin%d",
"Residual_vs_pT_Histo", j), j, j);
232 TH1D* temp_pull = resPlotCache.
pull_vs_pT.at(parName)->ProjectionY(
233 Form(
"%s_projy_bin%d",
"Pull_vs_pT_Histo", j), j, j);