23 ACTS_DEBUG(
"Initialize the histograms for residual and pull plots");
25 std::string parName = m_cfg.paramNames.at(parID);
27 std::string parResidual =
"Residual_" + parName;
33 Form(
"res_%s", parName.c_str()),
34 Form(
"Residual of %s", parName.c_str()), bResidual);
37 Form(
"res_%s_vs_eta", parName.c_str()),
38 Form(
"Residual of %s vs eta", parName.c_str()), bEta, bResidual);
41 Form(
"resmean_%s_vs_eta", parName.c_str()),
42 Form(
"Residual mean of %s", parName.c_str()), bEta);
45 Form(
"reswidth_%s_vs_eta", parName.c_str()),
46 Form(
"Residual width of %s", parName.c_str()), bEta);
49 Form(
"res_%s_vs_pT", parName.c_str()),
50 Form(
"Residual of %s vs pT", parName.c_str()), bPt, bResidual);
53 Form(
"resmean_%s_vs_pT", parName.c_str()),
54 Form(
"Residual mean of %s", parName.c_str()), bPt);
57 Form(
"reswidth_%s_vs_pT", parName.c_str()),
58 Form(
"Residual width of %s", parName.c_str()), bPt);
61 resPlotCache.
pull[parName] =
63 Form(
"Pull of %s", parName.c_str()), bPull);
66 Form(
"pull_%s_vs_eta", parName.c_str()),
67 Form(
"Pull of %s vs eta", parName.c_str()), bEta, bPull);
71 Form(
"Pull mean of %s", parName.c_str()), bEta);
75 Form(
"Pull width of %s", parName.c_str()), bEta);
78 Form(
"pull_%s_vs_pT", parName.c_str()),
79 Form(
"Pull of %s vs pT", parName.c_str()), bPt, bPull);
83 Form(
"Pull mean of %s", parName.c_str()), bPt);
87 Form(
"Pull width of %s", parName.c_str()), bPt);
94 std::string parName = m_cfg.paramNames.at(parID);
95 delete resPlotCache.
res.at(parName);
99 delete resPlotCache.
res_vs_pT.at(parName);
102 delete resPlotCache.
pull.at(parName);
114 ACTS_DEBUG(
"Write the hists to output file.");
116 std::string parName = m_cfg.paramNames.at(parID);
117 resPlotCache.
res.at(parName)->Write();
121 resPlotCache.
res_vs_pT.at(parName)->Write();
124 resPlotCache.
pull.at(parName)->Write();
144 auto trackParameter = fittedParamters.
parameters();
145 auto covariance = *fittedParamters.
covariance();
155 pSurface->globalToLocal(gctx, truthParticle.
position(),
171 std::string parName = m_cfg.paramNames.at(parID);
172 float residual = trackParameter[parID] - truthParameter[parID];
178 if (covariance(parID, parID) > 0) {
179 float pull = residual / sqrt(covariance(parID, parID));
187 <<
" has negative covariance = "
188 << covariance(parID, parID));
200 std::string parName = m_cfg.paramNames.at(parID);
202 for (
int j = 1; j <= bEta.
nBins; j++) {
203 TH1D* temp_res = resPlotCache.
res_vs_eta.at(parName)->ProjectionY(
204 Form(
"%s_projy_bin%d",
"Residual_vs_eta_Histo", j), j, j);
209 TH1D* temp_pull = resPlotCache.
pull_vs_eta.at(parName)->ProjectionY(
210 Form(
"%s_projy_bin%d",
"Pull_vs_eta_Histo", j), j, j);
217 for (
int j = 1; j <= bPt.
nBins; j++) {
218 TH1D* temp_res = resPlotCache.
res_vs_pT.at(parName)->ProjectionY(
219 Form(
"%s_projy_bin%d",
"Residual_vs_pT_Histo", j), j, j);
223 TH1D* temp_pull = resPlotCache.
pull_vs_pT.at(parName)->ProjectionY(
224 Form(
"%s_projy_bin%d",
"Pull_vs_pT_Histo", j), j, j);