EIC 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 <map>
17 #include <memory>
18 #include <string>
19 
20 namespace ActsExamples {
21 
22 // Tools to make duplication rate and duplication number plots to show tracking
23 // duplication.
24 //
25 // The duplication is investigated for those truth-matched reco tracks. If there
26 // are a few reco tracks matched to the same truth particle, the reco track with
27 // the highest matching probability is tagges as 'real' and the others are
28 // 'duplicated'.
30  public:
32  struct Config {
33  std::map<std::string, PlotHelpers::Binning> varBinning = {
34  {"Eta", PlotHelpers::Binning("#eta", 40, -4, 4)},
35  {"Phi", PlotHelpers::Binning("#phi", 100, -3.15, 3.15)},
36  {"Pt", PlotHelpers::Binning("pT [GeV/c]", 40, 0, 100)},
37  {"Num", PlotHelpers::Binning("N", 30, -0.5, 29.5)}};
38  };
39 
42  TProfile* nDuplicated_vs_pT;
43  TProfile* nDuplicated_vs_eta;
44  TProfile* nDuplicated_vs_phi;
45  TEfficiency* duplicationRate_vs_pT;
46  TEfficiency* duplicationRate_vs_eta;
47  TEfficiency* duplicationRate_vs_phi;
48  };
49 
55 
59  void book(DuplicationPlotCache& duplicationPlotCache) const;
60 
66  void fill(DuplicationPlotCache& duplicationPlotCache,
67  const Acts::BoundTrackParameters& fittedParameters,
68  bool status) const;
69 
75  void fill(DuplicationPlotCache& duplicationPlotCache,
76  const ActsFatras::Particle& truthParticle,
77  size_t nDuplicatedTracks) const;
78 
82  void write(const DuplicationPlotCache& duplicationPlotCache) const;
83 
87  void clear(DuplicationPlotCache& duplicationPlotCache) const;
88 
89  private:
91  std::unique_ptr<const Acts::Logger> m_logger;
92 
94  const Acts::Logger& logger() const { return *m_logger; }
95 };
96 
97 } // namespace ActsExamples