Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:00

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