File indexing completed on 2025-07-14 08:11:21
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Utilities/Logger.hpp"
0012 #include "ActsExamples/EventData/SimParticle.hpp"
0013 #include "ActsExamples/Utilities/Helpers.hpp"
0014
0015 #include <map>
0016 #include <memory>
0017 #include <string>
0018
0019 class TEfficiency;
0020
0021 namespace ActsExamples {
0022
0023
0024
0025
0026 class EffPlotTool {
0027 public:
0028
0029 struct Config {
0030 std::map<std::string, PlotHelpers::Binning> varBinning = {
0031 {"Eta", PlotHelpers::Binning("#eta", 40, -4, 4)},
0032 {"Phi", PlotHelpers::Binning("#phi", 100, -3.15, 3.15)},
0033 {"Pt", PlotHelpers::Binning("pT [GeV/c]", 40, 0, 100)},
0034 {"Z0", PlotHelpers::Binning("z_0 [mm]", 50, -200, 200)},
0035 {"DeltaR", PlotHelpers::Binning("#Delta R", 100, 0, 0.3)},
0036 {"prodR", PlotHelpers::Binning("prod_R [mm]", 100, 0, 200)}};
0037 };
0038
0039
0040 struct Cache {
0041
0042 TEfficiency* trackEff_vs_pT{nullptr};
0043
0044 TEfficiency* trackEff_vs_eta{nullptr};
0045
0046 TEfficiency* trackEff_vs_phi{nullptr};
0047
0048 TEfficiency* trackEff_vs_z0{nullptr};
0049
0050 TEfficiency* trackEff_vs_DeltaR{nullptr};
0051
0052 TEfficiency* trackEff_vs_prodR{nullptr};
0053 };
0054
0055
0056
0057
0058
0059 EffPlotTool(const Config& cfg, Acts::Logging::Level lvl);
0060
0061
0062
0063
0064 void book(Cache& cache) const;
0065
0066
0067
0068
0069
0070
0071
0072 void fill(Cache& cache, const SimParticleState& truthParticle, double deltaR,
0073 bool status) const;
0074
0075
0076
0077
0078 void write(const Cache& cache) const;
0079
0080
0081
0082
0083 void clear(Cache& cache) const;
0084
0085 private:
0086
0087 Config m_cfg;
0088
0089 std::unique_ptr<const Acts::Logger> m_logger;
0090
0091
0092 const Acts::Logger& logger() const { return *m_logger; }
0093 };
0094
0095 }