ECCE @ 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 
11 #include <map>
12 #include <memory>
13 #include <string>
14 
18 
19 namespace FW {
20 
21 // Tools to make fake rate plots to show tracking fake rate.
23  public:
25  struct Config {
26  std::map<std::string, PlotHelpers::Binning> varBinning = {
27  {"Eta", PlotHelpers::Binning("#eta", 40, -4, 4)},
28  {"Phi", PlotHelpers::Binning("#phi", 100, -3.15, 3.15)},
29  {"Pt", PlotHelpers::Binning("pT [GeV/c]", 20, 0, 100)},
30  {"Num", PlotHelpers::Binning("N", 30, -0.5, 29.5)}};
31  };
32 
35  TH1F* nRecoTracks;
37  TH1F* nFakeTracks;
38  TEfficiency* fakerate_vs_eta;
39  TEfficiency* fakerate_vs_phi;
40  TEfficiency* fakerate_vs_pT;
41  //@Todo: make duplication number plots with duplication plot tool
45  };
46 
52 
55  void book(FakeRatePlotCache& fakeRatePlotCache) const;
56 
62  void fill(FakeRatePlotCache& fakeRatePlotCache,
63  const ActsFatras::Particle& truthParticle, bool status) const;
64 
72  void fill(FakeRatePlotCache& fakeRatePlotCache,
73  const ActsFatras::Particle& truthParticle,
74  size_t nTruthMatchedTracks, size_t nFakeTracks) const;
75 
78  void write(const FakeRatePlotCache& fakeRatePlotCache) const;
79 
82  void clear(FakeRatePlotCache& fakeRatePlotCache) const;
83 
84  private:
86  std::unique_ptr<const Acts::Logger> m_logger;
87 
89  const Acts::Logger& logger() const { return *m_logger; }
90 };
91 
92 } // namespace FW