Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 08:22:58

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/EventData/BoundTrackParameters.hpp"
0012 #include "Acts/Utilities/Histogram.hpp"
0013 #include "Acts/Utilities/Logger.hpp"
0014 
0015 #include <cstddef>
0016 #include <map>
0017 #include <memory>
0018 #include <string>
0019 
0020 namespace ActsExamples {
0021 
0022 /// Tools to make track quality plots.
0023 class TrackQualityPlotTool {
0024  public:
0025   using AxisVariant = Acts::Experimental::AxisVariant;
0026   using BoostRegularAxis = Acts::Experimental::BoostRegularAxis;
0027   using ProfileHistogram1 = Acts::Experimental::ProfileHistogram1;
0028 
0029   /// @brief The nested configuration struct
0030   struct Config {
0031     std::map<std::string, AxisVariant> varBinning = {
0032         {"Eta", BoostRegularAxis(40, -4, 4, "reco #eta")},
0033         {"Phi", BoostRegularAxis(100, -3.15, 3.15, "reco #phi")},
0034         {"Pt", BoostRegularAxis(40, 0, 100, "reco p_{T} [GeV/c]")},
0035         {"Num", BoostRegularAxis(30, -0.5, 29.5, "N")}};
0036   };
0037 
0038   /// Constructor
0039   ///
0040   /// @param cfg Configuration struct
0041   /// @param lvl Message level declaration
0042   TrackQualityPlotTool(const Config& cfg, Acts::Logging::Level lvl);
0043 
0044   /// @brief fill track quality w.r.t. fitted track parameters
0045   ///
0046   /// @param fittedParameters fitted track parameters of this track
0047   /// @param completeness completeness of the track
0048   /// @param purity purity of the track
0049   void fill(const Acts::BoundTrackParameters& fittedParameters,
0050             double completeness, double purity);
0051 
0052   /// @brief Accessor for profile histograms map (const reference)
0053   const std::map<std::string, ProfileHistogram1>& profiles() const {
0054     return m_profiles;
0055   }
0056 
0057  private:
0058   const Acts::Logger& logger() const { return *m_logger; }
0059 
0060   Config m_cfg;
0061   std::unique_ptr<const Acts::Logger> m_logger;
0062 
0063   std::map<std::string, ProfileHistogram1> m_profiles;
0064 };
0065 
0066 }  // namespace ActsExamples