Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FakeRatePlotTool.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FakeRatePlotTool.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 TH2F;
23 namespace ActsFatras {
24 class Particle;
25 } // namespace ActsFatras
26 
27 namespace ActsExamples {
28 
29 // Tools to make fake rate plots to show tracking fake rate.
30 //
31 // The fake rate is investigated for all reco tracks. A track is 'fake' if it's
32 // not matched with truth.
34  public:
36  struct Config {
37  std::map<std::string, PlotHelpers::Binning> varBinning = {
38  {"Eta", PlotHelpers::Binning("#eta", 40, -4, 4)},
39  {"Phi", PlotHelpers::Binning("#phi", 100, -3.15, 3.15)},
40  {"Pt", PlotHelpers::Binning("pT [GeV/c]", 40, 0, 100)},
41  {"Num", PlotHelpers::Binning("N", 30, -0.5, 29.5)}};
42  };
43 
46  TH2F* nReco_vs_pT;
48 
49  TH2F* nFake_vs_pT;
50 
51  TH2F* nReco_vs_eta;
53 
54  TH2F* nFake_vs_eta;
55 
56  TEfficiency* fakeRate_vs_pT;
57  TEfficiency* fakeRate_vs_eta;
58  TEfficiency* fakeRate_vs_phi;
59  };
60 
66 
70  void book(FakeRatePlotCache& fakeRatePlotCache) const;
71 
77  void fill(FakeRatePlotCache& fakeRatePlotCache,
78  const Acts::BoundTrackParameters& fittedParameters,
79  bool status) const;
80 
88  void fill(FakeRatePlotCache& fakeRatePlotCache,
89  const ActsFatras::Particle& truthParticle,
90  size_t nTruthMatchedTracks, size_t nFakeTracks) const;
91 
95  void write(const FakeRatePlotCache& fakeRatePlotCache) const;
96 
100  void clear(FakeRatePlotCache& fakeRatePlotCache) const;
101 
102  private:
104  std::unique_ptr<const Acts::Logger> m_logger;
105 
107  const Acts::Logger& logger() const { return *m_logger; }
108 };
109 
110 } // namespace ActsExamples