EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IterativeVertexFinder.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file IterativeVertexFinder.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
23 
24 namespace Acts {
25 
59 template <typename vfitter_t, typename sfinder_t>
61  static_assert(VertexFitterConcept<vfitter_t>,
62  "Vertex fitter does not fulfill vertex fitter concept.");
63  using Propagator_t = typename vfitter_t::Propagator_t;
65 
66  public:
67  using InputTrack_t = typename vfitter_t::InputTrack_t;
69 
71  struct Config {
78  Config(const vfitter_t& fitter, const Linearizer_t& lin, sfinder_t sfinder,
79  const IPEstimator& est)
80  : vertexFitter(fitter),
81  linearizer(lin),
82  seedFinder(std::move(sfinder)),
83  ipEst(est) {}
84 
86  vfitter_t vertexFitter;
87 
90 
92  sfinder_t seedFinder;
93 
96 
98  bool useBeamConstraint = false;
101  int maxVertices = 50;
102  bool createSplitVertices = false;
105  bool doMaxTracksCut = false;
106  int maxTracks = 5000;
107  double cutOffTrackWeight = 0.01;
108  };
109 
111  struct State {
113  : ipState(mctx), linearizerState(mctx), fitterState(mctx) {}
115  typename IPEstimator::State ipState;
117  typename Linearizer_t::State linearizerState;
119  typename vfitter_t::State fitterState;
120  };
121 
126  template <
127  typename T = InputTrack_t,
130  std::unique_ptr<const Logger> logger = getDefaultLogger(
131  "IterativeVertexFinder", Logging::INFO))
132  : m_cfg(std::move(cfg)),
133  m_extractParameters([](T params) { return params; }),
134  m_logger(std::move(logger)) {}
135 
144  std::function<BoundTrackParameters(InputTrack_t)> func,
145  std::unique_ptr<const Logger> logger = getDefaultLogger(
146  "IterativeVertexFinder", Logging::INFO))
147  : m_cfg(std::move(cfg)),
149  m_logger(std::move(logger)) {}
150 
159  const std::vector<const InputTrack_t*>& trackVector,
160  const VertexingOptions<InputTrack_t>& vertexingOptions,
161  State& state) const;
162 
163  private:
165  const Config m_cfg;
166 
172  std::function<BoundTrackParameters(InputTrack_t)> m_extractParameters;
173 
175  std::unique_ptr<const Logger> m_logger;
176 
178  const Logger& logger() const { return *m_logger; }
179 
185  const std::vector<const InputTrack_t*>& seedTracks,
186  const VertexingOptions<InputTrack_t>& vertexingOptions) const;
187 
192  void removeAllTracks(const std::vector<const InputTrack_t*>& perigeesToFit,
193  std::vector<const InputTrack_t*>& seedTracks) const;
194 
203  const BoundTrackParameters& params, const Vertex<InputTrack_t>& vertex,
204  const VertexingOptions<InputTrack_t>& vertexingOptions,
205  State& state) const;
206 
217  Vertex<InputTrack_t>& myVertex,
218  std::vector<const InputTrack_t*>& perigeesToFit,
219  std::vector<const InputTrack_t*>& seedTracks,
220  const VertexingOptions<InputTrack_t>& vertexingOptions,
221  State& state) const;
222 
232  const std::vector<const InputTrack_t*>& perigeeList,
233  const Vertex<InputTrack_t>& seedVertex,
234  std::vector<const InputTrack_t*>& perigeesToFitOut,
235  std::vector<const InputTrack_t*>& perigeesToFitSplitVertexOut,
236  const VertexingOptions<InputTrack_t>& vertexingOptions,
237  State& state) const;
238 
252  std::vector<Vertex<InputTrack_t>>& vertexCollection,
253  Vertex<InputTrack_t>& currentVertex,
254  std::vector<const InputTrack_t*>& perigeesToFit,
255  std::vector<const InputTrack_t*>& seedTracks,
256  const std::vector<const InputTrack_t*>& origTracks,
257  const VertexingOptions<InputTrack_t>& vertexingOptions,
258  State& state) const;
259 
268 };
269 
270 } // namespace Acts
271 
272 #include "IterativeVertexFinder.ipp"