Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-04 08:11:56

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/TrackParameters.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 info plots to show tracking track info.
0023 class TrackSummaryPlotTool {
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, "#eta")},
0033         {"Phi", BoostRegularAxis(100, -3.15, 3.15, "#phi")},
0034         {"Pt", BoostRegularAxis(40, 0, 100, "pT [GeV/c]")},
0035         {"Num", BoostRegularAxis(30, -0.5, 29.5, "N")}};
0036     /// Optional prefix for histogram names
0037     std::string prefix;
0038   };
0039 
0040   /// Constructor
0041   ///
0042   /// @param cfg Configuration struct
0043   /// @param lvl Message level declaration
0044   TrackSummaryPlotTool(const Config& cfg, Acts::Logging::Level lvl);
0045 
0046   /// @brief fill reco track info w.r.t. fitted track parameters
0047   ///
0048   /// @param fittedParameters fitted track parameters of this track
0049   /// @param nStates number of track states
0050   /// @param nMeasurements number of measurements
0051   /// @param nOutliers number of outliers
0052   /// @param nHoles number of holes
0053   /// @param nSharedHits number of shared hits
0054   void fill(const Acts::BoundTrackParameters& fittedParameters,
0055             std::size_t nStates, std::size_t nMeasurements,
0056             std::size_t nOutliers, std::size_t nHoles, std::size_t nSharedHits);
0057 
0058   /// @brief Accessor for profile histograms map (const reference)
0059   const std::map<std::string, ProfileHistogram1>& profiles() const {
0060     return m_profiles;
0061   }
0062 
0063  private:
0064   const Acts::Logger& logger() const { return *m_logger; }
0065 
0066   Config m_cfg;
0067   std::unique_ptr<const Acts::Logger> m_logger;
0068 
0069   std::map<std::string, ProfileHistogram1> m_profiles;
0070 };
0071 
0072 }  // namespace ActsExamples