Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-13 10:01:53

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/Definitions/Units.hpp"
0012 #include "Acts/Seeding/GbtsLayerDescription.hpp"
0013 #include "Acts/Seeding/detail/GbtsFilterTypes.hpp"
0014 #include "Acts/Utilities/Logger.hpp"
0015 
0016 #include <array>
0017 #include <cstdint>
0018 #include <memory>
0019 #include <vector>
0020 
0021 namespace Acts::Experimental {
0022 
0023 class GbtsGeometry;
0024 class GraphBasedTrackSeeder;
0025 
0026 /// Tracking filter operating on the GBTS edge graph.
0027 class GbtsTrackingFilter final {
0028  public:
0029   /// Configuration for the tracking filter.
0030   struct Config {
0031     /// Multiple scattering sigma (for 900 MeV track at eta=0).
0032     float sigmaMS = 0.016;
0033     /// Radiation length fraction per layer (2.5% per layer).
0034     float radLen = 0.025;
0035 
0036     /// Measurement uncertainty in x direction.
0037     float sigmaX = 0.08 * Acts::UnitConstants::mm;
0038     /// Measurement uncertainty in y direction.
0039     float sigmaY = 0.25 * Acts::UnitConstants::mm;
0040 
0041     /// Across the strips only. The along-strip resolution is not configured:
0042     /// it is derived per node from the node's own strip. See `update`.
0043     float sigmaXStrip = 0.03 * Acts::UnitConstants::mm;
0044 
0045     /// Measurement weight in x direction.
0046     float weightX = 0.5;
0047     /// Measurement weight in y direction.
0048     float weightY = 0.5;
0049 
0050     /// Maximum delta chi2 in x direction.
0051     float maxDChi2X = 5.0;
0052     /// Maximum delta chi2 in y direction.
0053     float maxDChi2Y = 6.0;
0054 
0055     /// Chi2 penalty for adding a hit.
0056     float addHit = 14.0;
0057 
0058     /// Maximum track curvature.
0059     float maxCurvature = 1e-3f / Acts::UnitConstants::mm;
0060     /// Maximum longitudinal impact parameter.
0061     float maxZ0 = 170.0 * Acts::UnitConstants::mm;
0062 
0063     /// Initial variance of the transverse state (y, dy/dx, d2y/dx2).
0064     std::array<float, 3> initialVarianceX = {0.25f, 0.001f, 0.001f};
0065     /// Initial variance of the longitudinal state (z, dz/dr).
0066     std::array<float, 2> initialVarianceY = {1.5f, 0.001f};
0067   };
0068 
0069   /// @param config Configuration for seed finder
0070   /// @param geometry GBTS geometry for layer information
0071   /// @param logger Logging instance
0072   GbtsTrackingFilter(const Config& config,
0073                      const std::shared_ptr<const GbtsGeometry>& geometry,
0074                      std::unique_ptr<const Logger> logger = getDefaultLogger(
0075                          "GbtsTrackingFilter", Logging::Level::INFO));
0076 
0077  private:
0078   // Only the seeder walks the edge graph.
0079   friend class GraphBasedTrackSeeder;
0080 
0081   using State = detail::GbtsFilterState;
0082 
0083   /// Follow track starting from edge
0084   /// @param state Tracking filter state
0085   /// @param nodeView View of the node positions and layers
0086   /// @param sb Edge storage
0087   /// @param pS Starting edge
0088   /// @return Final edge state after following the track
0089   detail::GbtsEdgeState followTrack(State& state,
0090                                     const detail::GbtsNodeView& nodeView,
0091                                     std::vector<detail::GbtsEdge>& sb,
0092                                     detail::GbtsEdge& pS) const;
0093 
0094   /// Configuration for the tracking filter.
0095   Config m_cfg{};
0096 
0097   /// GBTS geometry for layer information
0098   std::shared_ptr<const GbtsGeometry> m_geometry;
0099 
0100   /// Logging instance
0101   std::unique_ptr<const Logger> m_logger;
0102 
0103   /// Access the logging instance
0104   /// @return Logger reference
0105   const Logger& logger() const { return *m_logger; }
0106 
0107   /// Propagate edge state
0108   /// @param state Tracking filter state
0109   /// @param nodeView View of the node positions and layers
0110   /// @param sb Edge storage
0111   /// @param pS Edge to propagate from
0112   /// @param ts Edge state to update
0113   void propagate(State& state, const detail::GbtsNodeView& nodeView,
0114                  std::vector<detail::GbtsEdge>& sb, detail::GbtsEdge& pS,
0115                  detail::GbtsEdgeState& ts) const;
0116 
0117   /// Update edge state with edge
0118   /// @param nodeView View of the node positions and layers
0119   /// @param pS Edge to update with
0120   /// @param ts Edge state to update
0121   /// @return Success flag
0122   bool update(const detail::GbtsNodeView& nodeView, const detail::GbtsEdge& pS,
0123               detail::GbtsEdgeState& ts) const;
0124 
0125   /// Get layer type from layer index
0126   /// @param layerIndex Layer index
0127   /// @return Layer type
0128   GbtsLayerType getLayerType(std::uint32_t layerIndex) const;
0129 };
0130 
0131 }  // namespace Acts::Experimental