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