ECCE @ 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 
114  template <typename T = InputTrack_t,
117  std::unique_ptr<const Logger> logger = getDefaultLogger(
118  "IterativeVertexFinder", Logging::INFO))
119  : m_cfg(std::move(cfg)),
120  m_extractParameters([](T params) { return params; }),
121  m_logger(std::move(logger)) {}
122 
130  std::unique_ptr<const Logger> logger = getDefaultLogger(
131  "IterativeVertexFinder", Logging::INFO))
132  : m_cfg(std::move(cfg)),
134  m_logger(std::move(logger)) {}
135 
143  const std::vector<const InputTrack_t*>& trackVector,
144  const VertexingOptions<InputTrack_t>& vertexingOptions) const;
145 
146  private:
148  const Config m_cfg;
149 
155  std::function<BoundParameters(InputTrack_t)> m_extractParameters;
156 
158  std::unique_ptr<const Logger> m_logger;
159 
161  const Logger& logger() const { return *m_logger; }
162 
168  const std::vector<const InputTrack_t*>& seedTracks,
169  const VertexingOptions<InputTrack_t>& vertexingOptions) const;
170 
175  void removeAllTracks(const std::vector<const InputTrack_t*>& perigeesToFit,
176  std::vector<const InputTrack_t*>& seedTracks) const;
177 
185  const BoundParameters& params, const Vertex<InputTrack_t>& vertex,
186  const VertexingOptions<InputTrack_t>& vertexingOptions) const;
187 
197  Vertex<InputTrack_t>& myVertex,
198  std::vector<const InputTrack_t*>& perigeesToFit,
199  std::vector<const InputTrack_t*>& seedTracks,
200  const VertexingOptions<InputTrack_t>& vertexingOptions) const;
201 
210  const std::vector<const InputTrack_t*>& perigeeList,
211  const Vertex<InputTrack_t>& seedVertex,
212  std::vector<const InputTrack_t*>& perigeesToFitOut,
213  std::vector<const InputTrack_t*>& perigeesToFitSplitVertexOut,
214  const VertexingOptions<InputTrack_t>& vertexingOptions) const;
215 
228  std::vector<Vertex<InputTrack_t>>& vertexCollection,
229  Vertex<InputTrack_t>& currentVertex,
230  std::vector<const InputTrack_t*>& perigeesToFit,
231  std::vector<const InputTrack_t*>& seedTracks,
232  const std::vector<const InputTrack_t*>& origTracks,
233  const VertexingOptions<InputTrack_t>& vertexingOptions) const;
234 
242  int countSignificantTracks(const Vertex<InputTrack_t>& vtx) const;
243 };
244 
245 } // namespace Acts
246 
247 #include "IterativeVertexFinder.ipp"