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