ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ActsTrk::detail::DuplicateSeedDetector Class Reference

#include <DuplicateSeedDetector.h>

Collaboration diagram for ActsTrk::detail::DuplicateSeedDetector:

Public Member Functions

 DuplicateSeedDetector (std::size_t numSeeds, bool enabled)
 
 DuplicateSeedDetector (const DuplicateSeedDetector &)=delete
 
DuplicateSeedDetectoroperator= (const DuplicateSeedDetector &)=delete
 
 DuplicateSeedDetector (DuplicateSeedDetector &&) noexcept=default
 
DuplicateSeedDetectoroperator= (DuplicateSeedDetector &&) noexcept=default
 
 ~DuplicateSeedDetector ()=default
 
void addSeeds (std::size_t typeIndex, const ActsTrk::SeedContainer &seeds)
 
void newTrajectory ()
 
void addMeasurement (const ActsTrk::ATLASUncalibSourceLink &sl)
 
bool isDuplicate (std::size_t typeIndex, std::size_t iseed)
 
bool isEnabled () const
 
const std::unordered_multimap< const xAOD::UncalibratedMeasurement *, std::size_t > & seedIndexes () const
 
const std::vector< std::size_t > & nUsedMeasurements () const
 
const std::vector< std::size_t > & nSeedMeasurements () const
 
const std::vector< bool > & isDuplicateSeeds () const
 
const std::vector< std::size_t > & seedOffsets () const
 
std::size_t numSeeds () const
 
std::size_t nextSeeds () const
 
std::size_t foundSeeds () const
 

Private Attributes

bool m_disabled {false}
 
std::unordered_multimap< const xAOD::UncalibratedMeasurement *, std::size_t > m_seedIndexes {}
 
std::vector< std::size_t > m_nUsedMeasurements {}
 
std::vector< std::size_t > m_nSeedMeasurements {}
 
std::vector< bool > m_isDuplicateSeeds {}
 
std::vector< std::size_t > m_seedOffsets {}
 
std::size_t m_numSeeds {0ul}
 
std::size_t m_nextSeeds {0ul}
 
std::size_t m_foundSeeds {0ul}
 

Detailed Description

Definition at line 19 of file DuplicateSeedDetector.h.

Constructor & Destructor Documentation

◆ DuplicateSeedDetector() [1/3]

ActsTrk::detail::DuplicateSeedDetector::DuplicateSeedDetector ( std::size_t  numSeeds,
bool  enabled 
)

Definition at line 9 of file DuplicateSeedDetector.cxx.

11  : m_disabled(!enabled),
12  m_nUsedMeasurements(enabled ? numSeeds : 0u, 0u),
13  m_nSeedMeasurements(enabled ? numSeeds : 0u, 0u),
14  m_isDuplicateSeeds(enabled ? numSeeds : 0u, false)
15  {
16  if (m_disabled)
17  return;
18  m_seedIndexes.reserve(6 * numSeeds); // 6 hits/seed for strips (3 for pixels)
19  m_seedOffsets.reserve(2);
20  }

◆ DuplicateSeedDetector() [2/3]

ActsTrk::detail::DuplicateSeedDetector::DuplicateSeedDetector ( const DuplicateSeedDetector )
delete

◆ DuplicateSeedDetector() [3/3]

ActsTrk::detail::DuplicateSeedDetector::DuplicateSeedDetector ( DuplicateSeedDetector &&  )
defaultnoexcept

◆ ~DuplicateSeedDetector()

ActsTrk::detail::DuplicateSeedDetector::~DuplicateSeedDetector ( )
default

Member Function Documentation

◆ addMeasurement()

void ActsTrk::detail::DuplicateSeedDetector::addMeasurement ( const ActsTrk::ATLASUncalibSourceLink sl)

Definition at line 56 of file DuplicateSeedDetector.cxx.

56  {
57  if (m_disabled or m_nextSeeds == m_nUsedMeasurements.size()) return;
58 
59  for (auto [iiseed, eiseed] = m_seedIndexes.equal_range(&(ActsTrk::getUncalibratedMeasurement(sl)));
60  iiseed != eiseed; ++iiseed) {
61  std::size_t iseed = iiseed->second;
62  assert(iseed < m_nUsedMeasurements.size());
63 
64  if (iseed < m_nextSeeds or m_isDuplicateSeeds[iseed]) continue;
65 
66  if (++m_nUsedMeasurements[iseed] >= m_nSeedMeasurements[iseed]) {
67  assert(m_nUsedMeasurements[iseed] == m_nSeedMeasurements[iseed]); // shouldn't ever find more
68  m_isDuplicateSeeds[iseed] = true;
69  }
70  ++m_foundSeeds;
71  }
72  }

◆ addSeeds()

void ActsTrk::detail::DuplicateSeedDetector::addSeeds ( std::size_t  typeIndex,
const ActsTrk::SeedContainer seeds 
)

Definition at line 22 of file DuplicateSeedDetector.cxx.

24  {
25  if (m_disabled) return;
26  if (!(typeIndex < m_seedOffsets.size()))
27  m_seedOffsets.resize(typeIndex + 1);
28  m_seedOffsets[typeIndex] = m_numSeeds;
29 
30  for (const ActsTrk::Seed *seed : seeds) {
31  if (!seed) continue;
32 
33  for (const xAOD::SpacePoint *sp : seed->sp()) {
34  const std::vector< const xAOD::UncalibratedMeasurement* > &els = sp->measurements();
35  for (const xAOD::UncalibratedMeasurement *meas : els) {
36  m_seedIndexes.insert({meas, m_numSeeds});
38  }
39  }
40  ++m_numSeeds;
41  }
42  }

◆ foundSeeds()

std::size_t ActsTrk::detail::DuplicateSeedDetector::foundSeeds ( ) const
inline

◆ isDuplicate()

bool ActsTrk::detail::DuplicateSeedDetector::isDuplicate ( std::size_t  typeIndex,
std::size_t  iseed 
)

Definition at line 75 of file DuplicateSeedDetector.cxx.

76  {
77  if (m_disabled) return false;
78 
79  if (typeIndex < m_seedOffsets.size()) {
80  iseed += m_seedOffsets[typeIndex];
81  }
82 
83  assert(iseed < m_isDuplicateSeeds.size());
84  // If iseed not increasing, we will miss some duplicate seeds, but won't exclude needed seeds.
85  if (iseed >= m_nextSeeds) {
86  m_nextSeeds = iseed + 1;
87  }
88 
89  return m_isDuplicateSeeds[iseed];
90  }

◆ isDuplicateSeeds()

const std::vector<bool>& ActsTrk::detail::DuplicateSeedDetector::isDuplicateSeeds ( ) const
inline

◆ isEnabled()

bool ActsTrk::detail::DuplicateSeedDetector::isEnabled ( ) const
inline

◆ newTrajectory()

void ActsTrk::detail::DuplicateSeedDetector::newTrajectory ( )

Definition at line 44 of file DuplicateSeedDetector.cxx.

44  {
45  if (m_disabled or m_foundSeeds == 0 or m_nextSeeds == m_nUsedMeasurements.size())
46  return;
47 
48  auto beg = m_nUsedMeasurements.begin();
49  if (m_nextSeeds < m_nUsedMeasurements.size()) {
50  std::advance(beg, m_nextSeeds);
51  }
52 
54  }

◆ nextSeeds()

std::size_t ActsTrk::detail::DuplicateSeedDetector::nextSeeds ( ) const
inline

◆ nSeedMeasurements()

const std::vector<std::size_t>& ActsTrk::detail::DuplicateSeedDetector::nSeedMeasurements ( ) const
inline

◆ numSeeds()

std::size_t ActsTrk::detail::DuplicateSeedDetector::numSeeds ( ) const
inline

◆ nUsedMeasurements()

const std::vector<std::size_t>& ActsTrk::detail::DuplicateSeedDetector::nUsedMeasurements ( ) const
inline

◆ operator=() [1/2]

DuplicateSeedDetector& ActsTrk::detail::DuplicateSeedDetector::operator= ( const DuplicateSeedDetector )
delete

◆ operator=() [2/2]

DuplicateSeedDetector& ActsTrk::detail::DuplicateSeedDetector::operator= ( DuplicateSeedDetector &&  )
defaultnoexcept

◆ seedIndexes()

const std::unordered_multimap<const xAOD::UncalibratedMeasurement *, std::size_t>& ActsTrk::detail::DuplicateSeedDetector::seedIndexes ( ) const
inline

◆ seedOffsets()

const std::vector<std::size_t>& ActsTrk::detail::DuplicateSeedDetector::seedOffsets ( ) const
inline

Member Data Documentation

◆ m_disabled

bool ActsTrk::detail::DuplicateSeedDetector::m_disabled {false}
private

Definition at line 49 of file DuplicateSeedDetector.h.

◆ m_foundSeeds

std::size_t ActsTrk::detail::DuplicateSeedDetector::m_foundSeeds {0ul}
private

Definition at line 57 of file DuplicateSeedDetector.h.

◆ m_isDuplicateSeeds

std::vector<bool> ActsTrk::detail::DuplicateSeedDetector::m_isDuplicateSeeds {}
private

Definition at line 53 of file DuplicateSeedDetector.h.

◆ m_nextSeeds

std::size_t ActsTrk::detail::DuplicateSeedDetector::m_nextSeeds {0ul}
private

Definition at line 56 of file DuplicateSeedDetector.h.

◆ m_nSeedMeasurements

std::vector<std::size_t> ActsTrk::detail::DuplicateSeedDetector::m_nSeedMeasurements {}
private

Definition at line 52 of file DuplicateSeedDetector.h.

◆ m_numSeeds

std::size_t ActsTrk::detail::DuplicateSeedDetector::m_numSeeds {0ul}
private

Definition at line 55 of file DuplicateSeedDetector.h.

◆ m_nUsedMeasurements

std::vector<std::size_t> ActsTrk::detail::DuplicateSeedDetector::m_nUsedMeasurements {}
private

Definition at line 51 of file DuplicateSeedDetector.h.

◆ m_seedIndexes

std::unordered_multimap<const xAOD::UncalibratedMeasurement *, std::size_t> ActsTrk::detail::DuplicateSeedDetector::m_seedIndexes {}
private

Definition at line 50 of file DuplicateSeedDetector.h.

◆ m_seedOffsets

std::vector<std::size_t> ActsTrk::detail::DuplicateSeedDetector::m_seedOffsets {}
private

Definition at line 54 of file DuplicateSeedDetector.h.


The documentation for this class was generated from the following files:
ActsTrk::detail::DuplicateSeedDetector::m_foundSeeds
std::size_t m_foundSeeds
Definition: DuplicateSeedDetector.h:57
ActsTrk::detail::DuplicateSeedDetector::m_nUsedMeasurements
std::vector< std::size_t > m_nUsedMeasurements
Definition: DuplicateSeedDetector.h:51
xAOD::SpacePoint_v1
Definition: SpacePoint_v1.h:29
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
ActsTrk::detail::DuplicateSeedDetector::m_disabled
bool m_disabled
Definition: DuplicateSeedDetector.h:49
ActsTrk::Seed
Acts::Seed< xAOD::SpacePoint, 3ul > Seed
Definition: Seed.h:12
detail::ul
unsigned long ul
Definition: PrimitiveHelpers.h:46
ActsTrk::detail::DuplicateSeedDetector::m_seedOffsets
std::vector< std::size_t > m_seedOffsets
Definition: DuplicateSeedDetector.h:54
ActsTrk::detail::DuplicateSeedDetector::m_numSeeds
std::size_t m_numSeeds
Definition: DuplicateSeedDetector.h:55
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
ActsTrk::getUncalibratedMeasurement
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
Definition: ATLASSourceLink.h:26
ActsTrk::detail::DuplicateSeedDetector::m_seedIndexes
std::unordered_multimap< const xAOD::UncalibratedMeasurement *, std::size_t > m_seedIndexes
Definition: DuplicateSeedDetector.h:50
ActsTrk::detail::DuplicateSeedDetector::m_isDuplicateSeeds
std::vector< bool > m_isDuplicateSeeds
Definition: DuplicateSeedDetector.h:53
ActsTrk::detail::DuplicateSeedDetector::numSeeds
std::size_t numSeeds() const
ActsTrk::detail::DuplicateSeedDetector::m_nextSeeds
std::size_t m_nextSeeds
Definition: DuplicateSeedDetector.h:56
ActsTrk::detail::DuplicateSeedDetector::m_nSeedMeasurements
std::vector< std::size_t > m_nSeedMeasurements
Definition: DuplicateSeedDetector.h:52