Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SingleSeedVertexFinder.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SingleSeedVertexFinder.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2023 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 
14 #include "Acts/Utilities/Ray.hpp"
17 
18 #include <algorithm>
19 #include <string>
20 #include <utility>
21 #include <vector>
22 
23 namespace Acts {
24 
35 template <typename spacepoint_t>
37  public:
39  struct Config {
49 
53 
61 
65  std::uint32_t numPhiSlices = 60;
68 
70  std::uint32_t numZSlices = 150;
78 
83 
86 
89  std::uint32_t maxIterations = 20;
94  };
95 
97  const Config& config() const { return m_cfg; }
98 
103  std::unique_ptr<const Logger> lgr = getDefaultLogger(
104  "SingleSeedVertexFinder", Logging::INFO));
105 
107  ~SingleSeedVertexFinder() = default;
108 
113  const std::vector<spacepoint_t>& spacepoints) const;
114 
115  private:
117  struct Triplet {
118  Triplet(const spacepoint_t& aa, const spacepoint_t& bb,
119  const spacepoint_t& cc)
120  : a(aa), b(bb), c(cc), ray(Acts::Vector3::Zero(), {1., 1., 1.}) {}
121 
122  const spacepoint_t &a, &b, &c;
124  };
125 
128  SortedSpacepoints(const int phiSize, const int zSize) {
129  std::vector<std::pair<spacepoint_t const*, Acts::ActsScalar>> helper = {};
130  std::vector<std::vector<std::pair<spacepoint_t const*, Acts::ActsScalar>>>
131  helperZ(zSize, helper);
132  std::vector<std::vector<
133  std::vector<std::pair<spacepoint_t const*, Acts::ActsScalar>>>>
134  helperPhi(phiSize, helperZ);
135  sortedSP.fill(helperPhi);
136  }
137 
143  inline std::vector<std::pair<spacepoint_t const*, Acts::ActsScalar>>& addSP(
144  int layer, int phi, int z) {
145  return sortedSP[layer][phi][z];
146  }
147 
153  inline const std::vector<std::pair<spacepoint_t const*, Acts::ActsScalar>>&
154  getSP(int layer, int phi, int z) const {
155  return sortedSP[layer][phi][z];
156  }
157 
158  std::array<std::vector<std::vector<std::vector<
159  std::pair<spacepoint_t const*, Acts::ActsScalar>>>>,
160  3>
162  };
163 
166 
171  const std::vector<spacepoint_t>& spacepoints) const;
172 
176  std::vector<Triplet> findTriplets(
178  sortedSpacepoints) const;
179 
185  bool tripletValidationAndUpdate(Triplet& triplet) const;
186 
190  static std::pair<Acts::Vector3, Acts::ActsScalar> makePlaneFromTriplet(
191  const Triplet& triplet);
192 
197  const std::vector<Triplet>& triplets) const;
198 
202  static Acts::Ray3D makeRayFromTriplet(const Triplet& triplet);
203 
208  const std::vector<Triplet>& triplets) const;
209 
211  std::unique_ptr<const Logger> m_logger;
212 
214  const Logger& logger() const { return *m_logger; }
215 };
216 
217 } // namespace Acts
218