ATLAS Offline Software
Loading...
Searching...
No Matches
DuplicateSeedDetector.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSTRACKRECONSTRUCTION_DUPLICATESEEDDETECTOR_H
6#define ACTSTRACKRECONSTRUCTION_DUPLICATESEEDDETECTOR_H
7
11
12#include <unordered_map>
13#include <vector>
14#include <boost/container/small_vector.hpp>
15
16namespace ActsTrk::detail {
17 class MeasurementIndex;
18
19 // === DuplicateSeedDetector ===============================================
20 // Identify duplicate seeds: seeds where all measurements were already located in a previously followed trajectory.
22 public:
23 using index_t = unsigned int;
24 using SpacePointIndicesFun_t = std::function<std::array<std::size_t, 3>(std::size_t)>; // copied from ITrackParamsEstimationTool
25 using UseTopSpFun_t = std::function<bool(const ActsTrk::Seed&)>;
26
27 DuplicateSeedDetector(std::size_t numSeeds, index_t measOffset, bool enabled);
31 DuplicateSeedDetector &operator=(DuplicateSeedDetector &&) noexcept = default;
33
34 // add seeds from an associated measurements collection.
35 void addSeeds(std::size_t typeIndex, const ActsTrk::SeedContainer &seeds, const MeasurementIndex &measurementIndex);
36 void addSeeds(std::size_t typeIndex, const ActsTrk::SeedContainer &seeds, const MeasurementIndex &measurementIndex,
37 SpacePointIndicesFun_t spacePointIndicesFun, UseTopSpFun_t useTopSpFun);
38 inline void newTrajectory();
40
41 // For complete removal of duplicate seeds, assumes isDuplicate(typeIndex,iseed) is called for monotonically increasing typeIndex,iseed.
42 inline bool isDuplicate(std::size_t typeIndex, index_t iseed);
43
44 private:
45 friend struct DuplicateSeedDetectorTest; // allow unit test access to internals
46
47 bool m_disabled{false};
48 index_t m_measOffset{0u}; // if a seed has N hits, only N - m_measOffset are needed to mark it as duplicate
49 std::vector<boost::container::small_vector<index_t, 2>> m_seedIndex; // m_seedIndex[measurementIndex][usedBySeedNumber]
50 std::vector<index_t> m_nUsedMeasurements;
51 std::vector<index_t> m_nSeedMeasurements;
52 std::vector<bool> m_isDuplicateSeed;
53 std::vector<index_t> m_seedOffset;
54 index_t m_numSeeds{0u}; // count of number of seeds so-far added with addSeeds()
55 std::size_t m_nextSeed{0ul}; // index of next seed expected with isDuplicate()
56 index_t m_foundSeeds{0u}; // count of found seeds for this/last trajectory
57
58 };
59
60} // namespace ActsTrk::detail
61
63
64#endif
DuplicateSeedDetector(std::size_t numSeeds, index_t measOffset, bool enabled)
void addMeasurement(const ActsTrk::ATLASUncalibSourceLink &sl, const MeasurementIndex &measurementIndex)
std::function< std::array< std::size_t, 3 >(std::size_t)> SpacePointIndicesFun_t
bool isDuplicate(std::size_t typeIndex, index_t iseed)
DuplicateSeedDetector & operator=(const DuplicateSeedDetector &)=delete
std::vector< boost::container::small_vector< index_t, 2 > > m_seedIndex
void addSeeds(std::size_t typeIndex, const ActsTrk::SeedContainer &seeds, const MeasurementIndex &measurementIndex)
std::function< bool(const ActsTrk::Seed &)> UseTopSpFun_t
DuplicateSeedDetector(const DuplicateSeedDetector &)=delete
DuplicateSeedDetector(DuplicateSeedDetector &&) noexcept=default
Athena definition of the Eigen plugin.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
const xAOD::UncalibratedMeasurement * ATLASUncalibSourceLink
STL namespace.
#define private