Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GreedyAmbiguityResolution.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GreedyAmbiguityResolution.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 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 
16 
17 #include <memory>
18 
19 #include <boost/container/flat_map.hpp>
20 #include <boost/container/flat_set.hpp>
21 
22 namespace Acts {
23 
38  public:
39  struct Config {
41  std::uint32_t maximumSharedHits = 1;
43  std::uint32_t maximumIterations = 1000;
44 
46  size_t nMeasurementsMin = 7;
47  };
48 
49  struct State {
50  std::size_t numberOfTracks{};
51 
52  std::vector<int> trackTips;
53  std::vector<float> trackChi2;
54  std::vector<std::vector<std::size_t>> measurementsPerTrack;
55 
56  // TODO consider boost 1.81 unordered_flat_map
57  boost::container::flat_map<std::size_t,
58  boost::container::flat_set<std::size_t>>
60  std::vector<std::size_t> sharedMeasurementsPerTrack;
61 
62  // TODO consider boost 1.81 unordered_flat_map
63  boost::container::flat_set<std::size_t> selectedTracks;
64  };
65 
67  std::unique_ptr<const Logger> logger =
68  getDefaultLogger("GreedyAmbiguityResolution",
71 
80  template <typename track_container_t, typename traj_t,
81  template <typename> class holder_t, typename source_link_hash_t,
82  typename source_link_equality_t>
83  void computeInitialState(
84  const TrackContainer<track_container_t, traj_t, holder_t>& tracks,
85  State& state, source_link_hash_t&& sourceLinkHash,
86  source_link_equality_t&& sourceLinkEquality) const;
87 
92  void resolve(State& state) const;
93 
94  private:
96 
98  std::unique_ptr<const Logger> m_logger;
99 
101  const Logger& logger() const { return *m_logger; }
102 };
103 
104 } // namespace Acts
105