Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-28 09:20:51

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2026 Dmitry Kalinkin
0003 
0004 #pragma once
0005 
0006 #include <Acts/Definitions/Algebra.hpp>
0007 #include <Acts/Definitions/Units.hpp>
0008 #include <Acts/Geometry/GeometryContext.hpp>
0009 #if Acts_VERSION_MAJOR >= 46
0010 #include <Acts/EventData/BoundTrackParameters.hpp>
0011 #else
0012 #include <Acts/EventData/TrackParameters.hpp>
0013 #endif
0014 #include <Acts/MagneticField/MagneticFieldProvider.hpp>
0015 #include <Acts/Vertexing/IVertexFinder.hpp>
0016 #include <memory>
0017 
0018 namespace eicrecon {
0019 
0020 /// Vertex seeder for a pair of tracks: returns the midpoint of the points of
0021 /// closest approach of the two track helices. Unlike the Acts density seeders,
0022 /// which only scan in z along the beam line, the seed is placed in 3D, so it
0023 /// is suited for displaced (secondary) vertices. Returns no seed unless
0024 /// exactly two tracks are given.
0025 class TwoTrackVertexSeeder final : public Acts::IVertexFinder {
0026 public:
0027   struct Config {
0028     std::shared_ptr<const Acts::MagneticFieldProvider> bField;
0029     /// Maximum number of Gauss-Newton iterations
0030     unsigned int maxIterations = 20;
0031     /// Stop iterating once both path length updates are below this value
0032     double tolerance = 1e-4 * Acts::UnitConstants::mm;
0033   };
0034 
0035   struct State {};
0036 
0037   explicit TwoTrackVertexSeeder(const Config& cfg) : m_cfg(cfg) {}
0038 
0039   Acts::Result<std::vector<Acts::Vertex>> find(const std::vector<Acts::InputTrack>& trackVector,
0040                                                const Acts::VertexingOptions& vertexingOptions,
0041                                                Acts::IVertexFinder::State& anyState) const final;
0042 
0043   Acts::IVertexFinder::State makeState(const Acts::MagneticFieldContext& mctx) const final;
0044 
0045   void setTracksToRemove(Acts::IVertexFinder::State& anyState,
0046                          const std::vector<Acts::InputTrack>& removedTracks) const final;
0047 
0048   /// Midpoint of the points of closest approach of the helices of two tracks
0049   /// in a uniform field along z
0050   Acts::Vector3 closestApproach(const Acts::BoundTrackParameters& track1,
0051                                 const Acts::BoundTrackParameters& track2,
0052                                 const Acts::GeometryContext& gctx, double bz) const;
0053 
0054 private:
0055   Config m_cfg;
0056 };
0057 
0058 } // namespace eicrecon