ECCE @ 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 
15  : m_cfg(cfg),
16  m_logger(Acts::getDefaultLogger("TrackSummaryPlotTool", lvl)) {}
17 
19  TrackSummaryPlotTool::TrackSummaryPlotCache& trackSummaryPlotCache) const {
20  PlotHelpers::Binning bEta = m_cfg.varBinning.at("Eta");
21  PlotHelpers::Binning bPt = m_cfg.varBinning.at("Pt");
22  PlotHelpers::Binning bNum = m_cfg.varBinning.at("Num");
23  ACTS_DEBUG("Initialize the histograms for track info plots");
24  // number of track states versus eta
25  trackSummaryPlotCache.nStates_vs_eta = PlotHelpers::bookProf(
26  "nStates_vs_eta", "Number of total states vs. #eta", bEta, bNum);
27  // number of measurements versus eta
28  trackSummaryPlotCache.nMeasurements_vs_eta = PlotHelpers::bookProf(
29  "nMeasurements_vs_eta", "Number of measurements vs. #eta", bEta, bNum);
30  // number of holes versus eta
31  trackSummaryPlotCache.nHoles_vs_eta = PlotHelpers::bookProf(
32  "nHoles_vs_eta", "Number of holes vs. #eta", bEta, bNum);
33  // number of outliers versus eta
34  trackSummaryPlotCache.nOutliers_vs_eta = PlotHelpers::bookProf(
35  "nOutliers_vs_eta", "Number of outliers vs. #eta", bEta, bNum);
36  // number of track states versus pt
37  trackSummaryPlotCache.nStates_vs_pt = PlotHelpers::bookProf(
38  "nStates_vs_pT", "Number of total states vs. pT", bPt, bNum);
39  // number of measurements versus pt
40  trackSummaryPlotCache.nMeasurements_vs_pt = PlotHelpers::bookProf(
41  "nMeasurements_vs_pT", "Number of measurements vs. pT", bPt, bNum);
42  // number of holes versus pt
43  trackSummaryPlotCache.nHoles_vs_pt = PlotHelpers::bookProf(
44  "nHoles_vs_pT", "Number of holes vs. pT", bPt, bNum);
45  // number of outliers versus pt
46  trackSummaryPlotCache.nOutliers_vs_pt = PlotHelpers::bookProf(
47  "nOutliers_vs_pT", "Number of outliers vs. pT", bPt, bNum);
48 }
49 
51  TrackSummaryPlotCache& trackSummaryPlotCache) const {
52  delete trackSummaryPlotCache.nStates_vs_eta;
53  delete trackSummaryPlotCache.nMeasurements_vs_eta;
54  delete trackSummaryPlotCache.nOutliers_vs_eta;
55  delete trackSummaryPlotCache.nHoles_vs_eta;
56  delete trackSummaryPlotCache.nStates_vs_pt;
57  delete trackSummaryPlotCache.nMeasurements_vs_pt;
58  delete trackSummaryPlotCache.nOutliers_vs_pt;
59  delete trackSummaryPlotCache.nHoles_vs_pt;
60 }
61 
63  const TrackSummaryPlotTool::TrackSummaryPlotCache& trackSummaryPlotCache)
64  const {
65  ACTS_DEBUG("Write the plots to output file.");
66  trackSummaryPlotCache.nStates_vs_eta->Write();
67  trackSummaryPlotCache.nMeasurements_vs_eta->Write();
68  trackSummaryPlotCache.nOutliers_vs_eta->Write();
69  trackSummaryPlotCache.nHoles_vs_eta->Write();
70  trackSummaryPlotCache.nStates_vs_pt->Write();
71  trackSummaryPlotCache.nMeasurements_vs_pt->Write();
72  trackSummaryPlotCache.nOutliers_vs_pt->Write();
73  trackSummaryPlotCache.nHoles_vs_pt->Write();
74 }
75 
77  TrackSummaryPlotTool::TrackSummaryPlotCache& trackSummaryPlotCache,
78  const ActsFatras::Particle& truthParticle, size_t nStates,
79  size_t nMeasurements, size_t nOutliers, size_t nHoles) const {
82 
83  const auto t_eta = eta(truthParticle.unitDirection());
84  const auto t_pT = truthParticle.transverseMomentum();
85 
86  PlotHelpers::fillProf(trackSummaryPlotCache.nStates_vs_eta, t_eta, nStates);
87  PlotHelpers::fillProf(trackSummaryPlotCache.nMeasurements_vs_eta, t_eta,
88  nMeasurements);
89  PlotHelpers::fillProf(trackSummaryPlotCache.nOutliers_vs_eta, t_eta,
90  nOutliers);
91  PlotHelpers::fillProf(trackSummaryPlotCache.nHoles_vs_eta, t_eta, nHoles);
92  PlotHelpers::fillProf(trackSummaryPlotCache.nStates_vs_pt, t_pT, nStates);
93  PlotHelpers::fillProf(trackSummaryPlotCache.nMeasurements_vs_pt, t_pT,
94  nMeasurements);
95  PlotHelpers::fillProf(trackSummaryPlotCache.nOutliers_vs_pt, t_pT, nOutliers);
96  PlotHelpers::fillProf(trackSummaryPlotCache.nHoles_vs_pt, t_pT, nHoles);
97 }