EIC 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 <map>
17 #include <memory>
18 #include <string>
19 
20 namespace ActsExamples {
21 
22 // Tools to make fake rate plots to show tracking fake rate.
23 //
24 // The fake rate is investigated for all reco tracks. A track is 'fake' if it's
25 // not matched with truth.
27  public:
29  struct Config {
30  std::map<std::string, PlotHelpers::Binning> varBinning = {
31  {"Eta", PlotHelpers::Binning("#eta", 40, -4, 4)},
32  {"Phi", PlotHelpers::Binning("#phi", 100, -3.15, 3.15)},
33  {"Pt", PlotHelpers::Binning("pT [GeV/c]", 40, 0, 100)},
34  {"Num", PlotHelpers::Binning("N", 30, -0.5, 29.5)}};
35  };
36 
39  TH2F* nReco_vs_pT;
41 
42  TH2F* nFake_vs_pT;
43 
44  TH2F* nReco_vs_eta;
46 
47  TH2F* nFake_vs_eta;
48 
49  TEfficiency* fakeRate_vs_pT;
50  TEfficiency* fakeRate_vs_eta;
51  TEfficiency* fakeRate_vs_phi;
52  };
53 
59 
63  void book(FakeRatePlotCache& fakeRatePlotCache) const;
64 
70  void fill(FakeRatePlotCache& fakeRatePlotCache,
71  const Acts::BoundTrackParameters& fittedParameters,
72  bool status) const;
73 
81  void fill(FakeRatePlotCache& fakeRatePlotCache,
82  const ActsFatras::Particle& truthParticle,
83  size_t nTruthMatchedTracks, size_t nFakeTracks) const;
84 
88  void write(const FakeRatePlotCache& fakeRatePlotCache) const;
89 
93  void clear(FakeRatePlotCache& fakeRatePlotCache) const;
94 
95  private:
97  std::unique_ptr<const Acts::Logger> m_logger;
98 
100  const Acts::Logger& logger() const { return *m_logger; }
101 };
102 
103 } // namespace ActsExamples