File indexing completed on 2025-01-18 09:11:47
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 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 {"Z0", PlotHelpers::Binning("z_0 [mm]", 50, -200, 200)},
0038 {"DeltaR", PlotHelpers::Binning("#Delta R", 100, 0, 0.3)}};
0039 };
0040
0041
0042 struct EffPlotCache {
0043 TEfficiency* trackEff_vs_pT{nullptr};
0044 TEfficiency* trackEff_vs_eta{nullptr};
0045 TEfficiency* trackEff_vs_phi{nullptr};
0046 TEfficiency* trackEff_vs_z0{nullptr};
0047 TEfficiency* trackEff_vs_DeltaR{
0048 nullptr};
0049
0050 };
0051
0052
0053
0054
0055
0056 EffPlotTool(const Config& cfg, Acts::Logging::Level lvl);
0057
0058
0059
0060
0061 void book(EffPlotCache& effPlotCache) const;
0062
0063
0064
0065
0066
0067
0068
0069 void fill(EffPlotCache& effPlotCache, const SimParticleState& truthParticle,
0070 double deltaR, bool status) const;
0071
0072
0073
0074
0075 void write(const EffPlotCache& effPlotCache) const;
0076
0077
0078
0079
0080 void clear(EffPlotCache& effPlotCache) const;
0081
0082 private:
0083 Config m_cfg;
0084 std::unique_ptr<const Acts::Logger> m_logger;
0085
0086
0087 const Acts::Logger& logger() const { return *m_logger; }
0088 };
0089
0090 }