EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackSummaryPlotTool.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackSummaryPlotTool.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
12 
16  : m_cfg(cfg),
17  m_logger(Acts::getDefaultLogger("TrackSummaryPlotTool", lvl)) {}
18 
20  TrackSummaryPlotTool::TrackSummaryPlotCache& trackSummaryPlotCache) const {
21  PlotHelpers::Binning bEta = m_cfg.varBinning.at("Eta");
22  PlotHelpers::Binning bPt = m_cfg.varBinning.at("Pt");
23  PlotHelpers::Binning bNum = m_cfg.varBinning.at("Num");
24  ACTS_DEBUG("Initialize the histograms for track info plots");
25  // number of track states versus eta
26  trackSummaryPlotCache.nStates_vs_eta = PlotHelpers::bookProf(
27  "nStates_vs_eta", "Number of total states vs. #eta", bEta, bNum);
28  // number of measurements versus eta
29  trackSummaryPlotCache.nMeasurements_vs_eta = PlotHelpers::bookProf(
30  "nMeasurements_vs_eta", "Number of measurements vs. #eta", bEta, bNum);
31  // number of holes versus eta
32  trackSummaryPlotCache.nHoles_vs_eta = PlotHelpers::bookProf(
33  "nHoles_vs_eta", "Number of holes vs. #eta", bEta, bNum);
34  // number of outliers versus eta
35  trackSummaryPlotCache.nOutliers_vs_eta = PlotHelpers::bookProf(
36  "nOutliers_vs_eta", "Number of outliers vs. #eta", bEta, bNum);
37  // number of track states versus pt
38  trackSummaryPlotCache.nStates_vs_pt = PlotHelpers::bookProf(
39  "nStates_vs_pT", "Number of total states vs. pT", bPt, bNum);
40  // number of measurements versus pt
41  trackSummaryPlotCache.nMeasurements_vs_pt = PlotHelpers::bookProf(
42  "nMeasurements_vs_pT", "Number of measurements vs. pT", bPt, bNum);
43  // number of holes versus pt
44  trackSummaryPlotCache.nHoles_vs_pt = PlotHelpers::bookProf(
45  "nHoles_vs_pT", "Number of holes vs. pT", bPt, bNum);
46  // number of outliers versus pt
47  trackSummaryPlotCache.nOutliers_vs_pt = PlotHelpers::bookProf(
48  "nOutliers_vs_pT", "Number of outliers vs. pT", bPt, bNum);
49 }
50 
52  TrackSummaryPlotCache& trackSummaryPlotCache) const {
53  delete trackSummaryPlotCache.nStates_vs_eta;
54  delete trackSummaryPlotCache.nMeasurements_vs_eta;
55  delete trackSummaryPlotCache.nOutliers_vs_eta;
56  delete trackSummaryPlotCache.nHoles_vs_eta;
57  delete trackSummaryPlotCache.nStates_vs_pt;
58  delete trackSummaryPlotCache.nMeasurements_vs_pt;
59  delete trackSummaryPlotCache.nOutliers_vs_pt;
60  delete trackSummaryPlotCache.nHoles_vs_pt;
61 }
62 
64  const TrackSummaryPlotTool::TrackSummaryPlotCache& trackSummaryPlotCache)
65  const {
66  ACTS_DEBUG("Write the plots to output file.");
67  trackSummaryPlotCache.nStates_vs_eta->Write();
68  trackSummaryPlotCache.nMeasurements_vs_eta->Write();
69  trackSummaryPlotCache.nOutliers_vs_eta->Write();
70  trackSummaryPlotCache.nHoles_vs_eta->Write();
71  trackSummaryPlotCache.nStates_vs_pt->Write();
72  trackSummaryPlotCache.nMeasurements_vs_pt->Write();
73  trackSummaryPlotCache.nOutliers_vs_pt->Write();
74  trackSummaryPlotCache.nHoles_vs_pt->Write();
75 }
76 
78  TrackSummaryPlotTool::TrackSummaryPlotCache& trackSummaryPlotCache,
79  const Acts::BoundTrackParameters& fittedParameters, size_t nStates,
80  size_t nMeasurements, size_t nOutliers, size_t nHoles) const {
83  const auto& momentum = fittedParameters.momentum();
84  const double fit_eta = eta(momentum);
85  const double fit_pT = perp(momentum);
86 
87  PlotHelpers::fillProf(trackSummaryPlotCache.nStates_vs_eta, fit_eta, nStates);
88  PlotHelpers::fillProf(trackSummaryPlotCache.nMeasurements_vs_eta, fit_eta,
89  nMeasurements);
90  PlotHelpers::fillProf(trackSummaryPlotCache.nOutliers_vs_eta, fit_eta,
91  nOutliers);
92  PlotHelpers::fillProf(trackSummaryPlotCache.nHoles_vs_eta, fit_eta, nHoles);
93 
94  PlotHelpers::fillProf(trackSummaryPlotCache.nStates_vs_pt, fit_pT, nStates);
95  PlotHelpers::fillProf(trackSummaryPlotCache.nMeasurements_vs_pt, fit_pT,
96  nMeasurements);
97  PlotHelpers::fillProf(trackSummaryPlotCache.nOutliers_vs_pt, fit_pT,
98  nOutliers);
99  PlotHelpers::fillProf(trackSummaryPlotCache.nHoles_vs_pt, fit_pT, nHoles);
100 }