File indexing completed on 2025-01-18 09:27:32
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/EventData/MultiTrajectoryHelpers.hpp"
0012 #include "Acts/EventData/SourceLink.hpp"
0013 #include "Acts/EventData/TrackContainer.hpp"
0014 #include "Acts/Utilities/Delegate.hpp"
0015 #include "Acts/Utilities/Logger.hpp"
0016
0017 #include <memory>
0018
0019 #include <boost/container/flat_map.hpp>
0020 #include <boost/container/flat_set.hpp>
0021
0022 namespace Acts {
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 class GreedyAmbiguityResolution {
0038 public:
0039 struct Config {
0040
0041 std::uint32_t maximumSharedHits = 1;
0042
0043 std::uint32_t maximumIterations = 1000;
0044
0045
0046 std::size_t nMeasurementsMin = 7;
0047 };
0048
0049 struct State {
0050 std::size_t numberOfTracks{};
0051
0052 std::vector<int> trackTips;
0053 std::vector<float> trackChi2;
0054 std::vector<std::vector<std::size_t>> measurementsPerTrack;
0055
0056
0057 boost::container::flat_map<std::size_t,
0058 boost::container::flat_set<std::size_t>>
0059 tracksPerMeasurement;
0060 std::vector<std::size_t> sharedMeasurementsPerTrack;
0061
0062
0063 boost::container::flat_set<std::size_t> selectedTracks;
0064 };
0065
0066 GreedyAmbiguityResolution(const Config& cfg,
0067 std::unique_ptr<const Logger> logger =
0068 getDefaultLogger("GreedyAmbiguityResolution",
0069 Logging::INFO))
0070 : m_cfg{cfg}, m_logger{std::move(logger)} {}
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 template <typename track_container_t, typename traj_t,
0081 template <typename> class holder_t, typename source_link_hash_t,
0082 typename source_link_equality_t>
0083 void computeInitialState(
0084 const TrackContainer<track_container_t, traj_t, holder_t>& tracks,
0085 State& state, source_link_hash_t&& sourceLinkHash,
0086 source_link_equality_t&& sourceLinkEquality) const;
0087
0088
0089
0090
0091
0092 void resolve(State& state) const;
0093
0094 private:
0095 Config m_cfg;
0096
0097
0098 std::unique_ptr<const Logger> m_logger;
0099
0100
0101 const Logger& logger() const { return *m_logger; }
0102 };
0103
0104 }
0105
0106 #include "Acts/AmbiguityResolution/GreedyAmbiguityResolution.ipp"