Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:22:19

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2023-2025 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 #pragma once
0009 
0010 // Local include(s).
0011 #include "traccc/resolution/stat_plot_tool_config.hpp"
0012 #include "traccc/utils/helpers.hpp"
0013 #include "traccc/utils/messaging.hpp"
0014 #include "traccc/utils/track_matching_config.hpp"
0015 #include "traccc/utils/truth_matching_config.hpp"
0016 
0017 // Project include(s).
0018 #include "traccc/edm/track_container.hpp"
0019 #include "traccc/utils/event_data.hpp"
0020 
0021 // System include(s).
0022 #include <map>
0023 #include <memory>
0024 #include <string>
0025 #include <string_view>
0026 
0027 namespace traccc {
0028 namespace details {
0029 
0030 /// Data members that should not pollute the API of
0031 /// @c traccc::finding_performance_writer
0032 struct finding_performance_writer_data;
0033 
0034 }  // namespace details
0035 
0036 class finding_performance_writer : public messaging {
0037  public:
0038   /// Configuration for the tool
0039   struct config {
0040     // Algorithm name, for ROOT display
0041     std::string algorithm_name = "finding";
0042     /// Output filename.
0043     std::string file_path = "performance_track_finding.root";
0044     /// Output file mode
0045     std::string file_mode = "RECREATE";
0046 
0047     /// Plot tool configurations.
0048     std::map<std::string, plot_helpers::binning> var_binning = {
0049         {"Eta", plot_helpers::binning("#eta", 40, -4.f, 4.f)},
0050         {"Phi", plot_helpers::binning("#phi", 100, -3.15f, 3.15f)},
0051         {"Pt", plot_helpers::binning("p_{T} [GeV/c]", 40, 0.f, 100.f)},
0052         {"Num", plot_helpers::binning("N", 30, -0.5f, 29.5f)}};
0053 
0054     truth_matching_config truth_config;
0055     track_matching_config track_truth_config;
0056 
0057     bool require_fit = false;
0058 
0059     stat_plot_tool_config stat_config{};
0060   };
0061 
0062   /// Construct from configuration and log level.
0063   /// @param cfg The configuration
0064   ///
0065   finding_performance_writer(const config& cfg,
0066                              std::unique_ptr<const traccc::Logger> logger);
0067 
0068   /// Destructor
0069   ~finding_performance_writer();
0070 
0071   void write(
0072       const edm::track_container<default_algebra>::const_view& track_view,
0073       const event_data& evt_data);
0074 
0075   void finalize();
0076 
0077  private:
0078   /// Configuration for the tool
0079   config m_cfg;
0080 
0081   /// Opaque data members for the class
0082   std::unique_ptr<details::finding_performance_writer_data> m_data;
0083 
0084   /// Common method to both track finding and ambiguity resolution
0085   void write_common(
0086       const std::vector<std::vector<event_data::measurement_proxy>>& tracks,
0087       const event_data& evt_data);
0088 
0089 };  // class finding_performance_writer
0090 
0091 }  // namespace traccc