Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-31 07:45:40

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/Algebra.hpp"
0012 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0013 #include "Acts/Utilities/Result.hpp"
0014 #include "Acts/Vertexing/GaussianTrackDensity.hpp"
0015 #include "Acts/Vertexing/IVertexFinder.hpp"
0016 #include "Acts/Vertexing/Vertex.hpp"
0017 #include "Acts/Vertexing/VertexingOptions.hpp"
0018 
0019 namespace Acts {
0020 
0021 /// @class TrackDensityVertexFinder
0022 ///
0023 /// @brief Finds a vertex seed based on the maximum
0024 /// of a track density function.
0025 /// Each track is modelled as a 2d density
0026 /// function around its d0/z0 perigee parameter values.
0027 /// The z seed position is then found as the position
0028 /// of the maximum of all summed track density functions.
0029 ///
0030 /// Ref. (1): https://cds.cern.ch/record/2670380
0031 class TrackDensityVertexFinder final : public IVertexFinder {
0032  public:
0033   /// @brief The Config struct
0034   struct Config {
0035     /// The track density estimator for vertex finding
0036     GaussianTrackDensity trackDensityEstimator;
0037   };
0038 
0039   /// State struct for fulfilling interface
0040   struct State {};
0041 
0042   /// @brief Function that finds single vertex candidate
0043   ///
0044   /// @param trackVector Input track collection
0045   /// @param vertexingOptions Vertexing options
0046   /// @param state State for fulfilling interfaces
0047   ///
0048   /// @return Vector of vertices, filled with a single
0049   ///         vertex (for consistent interfaces)
0050   Result<std::vector<Vertex>> find(const std::vector<InputTrack>& trackVector,
0051                                    const VertexingOptions& vertexingOptions,
0052                                    IVertexFinder::State& state) const override;
0053 
0054   IVertexFinder::State makeState(
0055       const Acts::MagneticFieldContext& /*mctx*/) const override {
0056     return IVertexFinder::State{State{}};
0057   }
0058 
0059   void setTracksToRemove(
0060       IVertexFinder::State& /*state*/,
0061       const std::vector<InputTrack>& /*removedTracks*/) const override {
0062     // Nothing to do here
0063   }
0064 
0065   /// @brief Constructor for user-defined InputTrack type
0066   ///
0067   /// @param cfg Configuration object
0068   explicit TrackDensityVertexFinder(const Config& cfg) : m_cfg(cfg) {}
0069 
0070  private:
0071   Config m_cfg;
0072 };
0073 
0074 }  // namespace Acts