Warning, file /acts/Examples/Framework/include/ActsExamples/Validation/ResPlotTool.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/EventData/TrackParameters.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Utilities/Logger.hpp"
0014 #include "ActsExamples/EventData/SimParticle.hpp"
0015 #include "ActsExamples/Utilities/Helpers.hpp"
0016
0017 #include <map>
0018 #include <memory>
0019 #include <string>
0020 #include <vector>
0021
0022 class TH1F;
0023 class TH2F;
0024
0025 namespace ActsExamples {
0026
0027
0028
0029
0030
0031 class ResPlotTool {
0032 public:
0033
0034 struct Config {
0035
0036 std::vector<std::string> paramNames = {"d0", "z0", "phi",
0037 "theta", "qop", "t"};
0038
0039
0040 std::map<std::string, PlotHelpers::Binning> varBinning = {
0041 {"Eta", PlotHelpers::Binning("#eta", 40, -4, 4)},
0042 {"Pt", PlotHelpers::Binning("pT [GeV/c]", 40, 0, 100)},
0043 {"Pull", PlotHelpers::Binning("pull", 100, -5, 5)},
0044 {"Residual_d0", PlotHelpers::Binning("r_{d0} [mm]", 100, -0.5, 0.5)},
0045 {"Residual_z0", PlotHelpers::Binning("r_{z0} [mm]", 100, -0.5, 0.5)},
0046 {"Residual_phi",
0047 PlotHelpers::Binning("r_{#phi} [rad]", 100, -0.01, 0.01)},
0048 {"Residual_theta",
0049 PlotHelpers::Binning("r_{#theta} [rad]", 100, -0.01, 0.01)},
0050 {"Residual_qop",
0051 PlotHelpers::Binning("r_{q/p} [c/GeV]", 100, -0.1, 0.1)},
0052 {"Residual_t", PlotHelpers::Binning("r_{t} [s]", 100, -1000, 1000)}};
0053 };
0054
0055
0056 struct Cache {
0057
0058 std::map<std::string, TH1F*> res;
0059
0060 std::map<std::string, TH2F*> res_vs_eta;
0061
0062 std::map<std::string, TH1F*> resMean_vs_eta;
0063
0064 std::map<std::string, TH1F*> resWidth_vs_eta;
0065
0066 std::map<std::string, TH2F*> res_vs_pT;
0067
0068 std::map<std::string, TH1F*> resMean_vs_pT;
0069
0070 std::map<std::string, TH1F*> resWidth_vs_pT;
0071
0072
0073 std::map<std::string, TH1F*> pull;
0074
0075 std::map<std::string, TH2F*> pull_vs_eta;
0076
0077 std::map<std::string, TH1F*> pullMean_vs_eta;
0078
0079 std::map<std::string, TH1F*> pullWidth_vs_eta;
0080
0081 std::map<std::string, TH2F*> pull_vs_pT;
0082
0083 std::map<std::string, TH1F*> pullMean_vs_pT;
0084
0085 std::map<std::string, TH1F*> pullWidth_vs_pT;
0086 };
0087
0088
0089
0090
0091
0092 ResPlotTool(const Config& cfg, Acts::Logging::Level lvl);
0093
0094
0095
0096
0097 void book(Cache& cache) const;
0098
0099
0100
0101
0102
0103
0104
0105 void fill(Cache& cache, const Acts::GeometryContext& gctx,
0106 const SimParticleState& truthParticle,
0107 const Acts::BoundTrackParameters& fittedParamters) const;
0108
0109
0110
0111
0112
0113 void refinement(Cache& cache) const;
0114
0115
0116
0117
0118 void write(const Cache& cache) const;
0119
0120
0121
0122
0123 void clear(Cache& cache) const;
0124
0125 private:
0126
0127 Config m_cfg;
0128
0129 std::unique_ptr<const Acts::Logger> m_logger;
0130
0131
0132 const Acts::Logger& logger() const { return *m_logger; }
0133 };
0134
0135 }