File indexing completed on 2026-07-26 08:22:21
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010
0011 #include "../utils/helpers.hpp"
0012 #include "traccc/resolution/stat_plot_tool_config.hpp"
0013
0014
0015 #include "traccc/edm/measurement_collection.hpp"
0016 #include "traccc/edm/track_collection.hpp"
0017 #include "traccc/edm/track_state_collection.hpp"
0018
0019 namespace traccc {
0020
0021 class stat_plot_tool {
0022 public:
0023
0024 struct stat_plot_cache {
0025 #ifdef TRACCC_HAVE_ROOT
0026
0027 std::unique_ptr<TH1> ndf_hist;
0028
0029 std::unique_ptr<TH1> chi2_hist;
0030
0031 std::unique_ptr<TH1> reduced_chi2_hist;
0032
0033 std::unique_ptr<TH1> pval_hist;
0034
0035 std::unique_ptr<TH1> purity_hist;
0036
0037 std::unique_ptr<TH1> completeness_hist;
0038
0039 std::map<unsigned int, std::unique_ptr<TH1>> chi2_filtered_hist;
0040
0041 std::map<unsigned int, std::unique_ptr<TH1>> chi2_smoothed_hist;
0042
0043 std::map<unsigned int, std::unique_ptr<TH1>> pval_filtered_hist;
0044
0045 std::map<unsigned int, std::unique_ptr<TH1>> pval_smoothed_hist;
0046 #endif
0047 };
0048
0049
0050
0051
0052 stat_plot_tool(const stat_plot_tool_config& cfg);
0053
0054
0055
0056
0057 void book(stat_plot_cache& cache) const;
0058
0059
0060
0061
0062
0063
0064
0065 template <typename track_backend_t>
0066 void fill(stat_plot_cache& cache,
0067 const edm::track<track_backend_t>& fit_res) const;
0068
0069
0070
0071
0072
0073
0074
0075 template <typename track_state_backend_t>
0076 void fill(stat_plot_cache& cache,
0077 const edm::track_state<track_state_backend_t>& trk_state,
0078 const edm::measurement_collection::host& measurements) const;
0079
0080
0081
0082
0083
0084 void fill(stat_plot_cache& cache, double purity, double completeness) const;
0085
0086
0087
0088
0089 void write(const stat_plot_cache& cache) const;
0090
0091 private:
0092 stat_plot_tool_config m_cfg;
0093 };
0094
0095 }
0096
0097
0098 #include "stat_plot_tool.ipp"