Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DuplicationPlotTool.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DuplicationPlotTool.hpp
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 
9 #pragma once
10 
15 
16 #include <cstddef>
17 #include <map>
18 #include <memory>
19 #include <string>
20 
21 class TEfficiency;
22 class TProfile;
23 namespace ActsFatras {
24 class Particle;
25 } // namespace ActsFatras
26 
27 namespace ActsExamples {
28 
29 // Tools to make duplication rate and duplication number plots to show tracking
30 // duplication.
31 //
32 // The duplication is investigated for those truth-matched reco tracks. If there
33 // are a few reco tracks matched to the same truth particle, the reco track with
34 // the highest matching probability is tagges as 'real' and the others are
35 // 'duplicated'.
37  public:
39  struct Config {
40  std::map<std::string, PlotHelpers::Binning> varBinning = {
41  {"Eta", PlotHelpers::Binning("#eta", 40, -4, 4)},
42  {"Phi", PlotHelpers::Binning("#phi", 100, -3.15, 3.15)},
43  {"Pt", PlotHelpers::Binning("pT [GeV/c]", 40, 0, 100)},
44  {"Num", PlotHelpers::Binning("N", 30, -0.5, 29.5)}};
45  };
46 
49  TProfile* nDuplicated_vs_pT;
50  TProfile* nDuplicated_vs_eta;
51  TProfile* nDuplicated_vs_phi;
52  TEfficiency* duplicationRate_vs_pT;
53  TEfficiency* duplicationRate_vs_eta;
54  TEfficiency* duplicationRate_vs_phi;
55  };
56 
62 
66  void book(DuplicationPlotCache& duplicationPlotCache) const;
67 
73  void fill(DuplicationPlotCache& duplicationPlotCache,
74  const Acts::BoundTrackParameters& fittedParameters,
75  bool status) const;
76 
82  void fill(DuplicationPlotCache& duplicationPlotCache,
83  const ActsFatras::Particle& truthParticle,
84  size_t nDuplicatedTracks) const;
85 
89  void write(const DuplicationPlotCache& duplicationPlotCache) const;
90 
94  void clear(DuplicationPlotCache& duplicationPlotCache) const;
95 
96  private:
98  std::unique_ptr<const Acts::Logger> m_logger;
99 
101  const Acts::Logger& logger() const { return *m_logger; }
102 };
103 
104 } // namespace ActsExamples