Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SeedFinder.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SeedFinder.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 
13 #include "Acts/Geometry/Extent.hpp"
22 
23 #include <array>
24 #include <limits>
25 #include <list>
26 #include <map>
27 #include <memory>
28 #include <set>
29 #include <string>
30 #include <utility>
31 #include <vector>
32 
33 namespace Acts {
34 
35 enum class SpacePointCandidateType : short { eBottom, eTop };
36 
37 enum class DetectorMeasurementInfo : short { eDefault, eDetailed };
38 
39 template <typename external_spacepoint_t, typename platform_t = void*>
40 class SeedFinder {
42  // Public methods:
44 
45  public:
46  struct SeedingState {
47  // bottom space point
48  std::vector<InternalSpacePoint<external_spacepoint_t>*> compatBottomSP;
49  std::vector<InternalSpacePoint<external_spacepoint_t>*> compatTopSP;
50  // contains parameters required to calculate circle with linear equation
51  // ...for bottom-middle
52  std::vector<LinCircle> linCircleBottom;
53  // ...for middle-top
54  std::vector<LinCircle> linCircleTop;
55 
56  // create vectors here to avoid reallocation in each loop
57  std::vector<const InternalSpacePoint<external_spacepoint_t>*> topSpVec;
58  std::vector<float> curvatures;
59  std::vector<float> impactParameters;
60 
61  // managing seed candidates for SpM
64 
65  // managing doublet candidates
66  boost::container::small_vector<Acts::Neighbour<external_spacepoint_t>, 9>
68  boost::container::small_vector<Acts::Neighbour<external_spacepoint_t>, 9>
70 
71  // Adding space point info
73  };
74 
78  ~SeedFinder() = default;
81  SeedFinder() = default;
86 
99  template <template <typename...> typename container_t, typename sp_range_t>
100  void createSeedsForGroup(
103  std::back_insert_iterator<container_t<Seed<external_spacepoint_t>>> outIt,
104  const sp_range_t& bottomSPs, const std::size_t middleSPs,
105  const sp_range_t& topSPs,
106  const Acts::Range1D<float>& rMiddleSPRange) const;
107 
127  template <typename sp_range_t>
128  std::vector<Seed<external_spacepoint_t>> createSeedsForGroup(
131  const sp_range_t& bottomSPs, const std::size_t middleSPs,
132  const sp_range_t& topSPs) const;
133 
134  private:
150  template <Acts::SpacePointCandidateType candidateType, typename out_range_t>
152  Acts::SpacePointData& spacePointData,
155  boost::container::small_vector<Neighbour<external_spacepoint_t>, 9>&
156  otherSPsNeighbours,
158  std::vector<LinCircle>& linCircleVec, out_range_t& outVec,
159  const float deltaRMinSP, const float deltaRMaxSP, const float uIP,
160  const float uIP2, const float cosPhiM, const float sinPhiM) const;
161 
169  template <Acts::DetectorMeasurementInfo detailedMeasurement>
170  void filterCandidates(Acts::SpacePointData& spacePointData,
173  SeedFilterState& seedFilterState,
174  SeedingState& state) const;
175 
176  private:
178 };
179 
180 } // namespace Acts
181 
182 #ifndef DOXYGEN
184 #endif