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

#include <DuplicateSeedDetector.h>

Collaboration diagram for ActsTrk::detail::DuplicateSeedDetector:

Public Types

using index_t = unsigned int
 
using SpacePointIndicesFun_t = std::function< std::array< std::size_t, 3 >(std::size_t)>
 
using UseTopSpFun_t = std::function< bool(const ActsTrk::Seed &)>
 

Public Member Functions

 DuplicateSeedDetector (std::size_t numSeeds, index_t measOffset, 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, const MeasurementIndex &measurementIndex)
 
void addSeeds (std::size_t typeIndex, const ActsTrk::SeedContainer &seeds, const MeasurementIndex &measurementIndex, SpacePointIndicesFun_t spacePointIndicesFun, UseTopSpFun_t useTopSpFun)
 
void newTrajectory ()
 
void addMeasurement (const ActsTrk::ATLASUncalibSourceLink &sl, const MeasurementIndex &measurementIndex)
 
bool isDuplicate (std::size_t typeIndex, index_t iseed)
 

Private Attributes

bool m_disabled {false}
 
index_t m_measOffset {0u}
 
std::vector< boost::container::small_vector< index_t, 2 > > m_seedIndex
 
std::vector< index_tm_nUsedMeasurements
 
std::vector< index_tm_nSeedMeasurements
 
std::vector< bool > m_isDuplicateSeed
 
std::vector< index_tm_seedOffset
 
index_t m_numSeeds {0u}
 
std::size_t m_nextSeed {0ul}
 
index_t m_foundSeeds {0u}
 

Friends

struct DuplicateSeedDetectorTest
 

Detailed Description

Definition at line 21 of file DuplicateSeedDetector.h.

Member Typedef Documentation

◆ index_t

Definition at line 23 of file DuplicateSeedDetector.h.

◆ SpacePointIndicesFun_t

using ActsTrk::detail::DuplicateSeedDetector::SpacePointIndicesFun_t = std::function<std::array<std::size_t, 3>(std::size_t)>

Definition at line 24 of file DuplicateSeedDetector.h.

◆ UseTopSpFun_t

Definition at line 25 of file DuplicateSeedDetector.h.

Constructor & Destructor Documentation

◆ DuplicateSeedDetector() [1/3]

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

Definition at line 13 of file DuplicateSeedDetector.cxx.

16  : m_disabled(!enabled),
17  m_measOffset(measOffset),
18  m_nUsedMeasurements(enabled ? numSeeds : 0ul, 0u),
19  m_nSeedMeasurements(enabled ? numSeeds : 0ul, 0u),
20  m_isDuplicateSeed(enabled ? numSeeds : 0ul, false) {
21  if (m_disabled)
22  return;
23  m_seedOffset.reserve(2ul);
24  }

◆ 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,
const MeasurementIndex measurementIndex 
)
inline

◆ addSeeds() [1/2]

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

Definition at line 26 of file DuplicateSeedDetector.cxx.

28  {
29  addSeeds(typeIndex, seeds, measurementIndex,
30  [](std::size_t) -> std::array<std::size_t, 3> { return {0, 1, 2}; },
31  [](const ActsTrk::Seed&) -> bool { return false; });
32  }

◆ addSeeds() [2/2]

void ActsTrk::detail::DuplicateSeedDetector::addSeeds ( std::size_t  typeIndex,
const ActsTrk::SeedContainer seeds,
const MeasurementIndex measurementIndex,
SpacePointIndicesFun_t  spacePointIndicesFun,
UseTopSpFun_t  useTopSpFun 
)

Definition at line 34 of file DuplicateSeedDetector.cxx.

38  {
39  if (m_disabled)
40  return;
41  if (!(typeIndex < m_seedOffset.size()))
42  m_seedOffset.resize(typeIndex + 1);
43  m_seedOffset[typeIndex] = m_numSeeds;
44  m_seedIndex.resize(measurementIndex.size()); // will resize for each seed container, but always with the same space
45 
46  for (const ActsTrk::Seed *seed : seeds) {
47  if (!seed)
48  continue;
49 
50  std::size_t nSP = 0;
51  bool useTopSp = useTopSpFun(*seed);
52  const auto& sps = seed->sp();
53  for (std::size_t isp : spacePointIndicesFun(sps.size())) {
54  const xAOD::SpacePoint *sp = sps.at(useTopSp ? sps.size() - isp - 1 : isp);
55  const std::vector<const xAOD::UncalibratedMeasurement *> &els = sp->measurements();
56  for (const xAOD::UncalibratedMeasurement *meas : els) {
57  std::size_t hitIndex = measurementIndex.index(*meas);
58  if (!(hitIndex < m_seedIndex.size())) {
59  // std::cout << "ERROR hit index " << hitIndex << " past end of " << m_seedIndex.size() << " hit indices\n";
60  continue;
61  }
62  m_seedIndex[hitIndex].push_back(m_numSeeds);
64  }
65  ++nSP;
66  if (nSP >= 3) break;
67  }
68  ++m_numSeeds;
69  }
70  }

◆ isDuplicate()

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

◆ newTrajectory()

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Friends And Related Function Documentation

◆ DuplicateSeedDetectorTest

friend struct DuplicateSeedDetectorTest
friend

Definition at line 45 of file DuplicateSeedDetector.h.

Member Data Documentation

◆ m_disabled

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

Definition at line 47 of file DuplicateSeedDetector.h.

◆ m_foundSeeds

index_t ActsTrk::detail::DuplicateSeedDetector::m_foundSeeds {0u}
private

Definition at line 56 of file DuplicateSeedDetector.h.

◆ m_isDuplicateSeed

std::vector<bool> ActsTrk::detail::DuplicateSeedDetector::m_isDuplicateSeed
private

Definition at line 52 of file DuplicateSeedDetector.h.

◆ m_measOffset

index_t ActsTrk::detail::DuplicateSeedDetector::m_measOffset {0u}
private

Definition at line 48 of file DuplicateSeedDetector.h.

◆ m_nextSeed

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

Definition at line 55 of file DuplicateSeedDetector.h.

◆ m_nSeedMeasurements

std::vector<index_t> ActsTrk::detail::DuplicateSeedDetector::m_nSeedMeasurements
private

Definition at line 51 of file DuplicateSeedDetector.h.

◆ m_numSeeds

index_t ActsTrk::detail::DuplicateSeedDetector::m_numSeeds {0u}
private

Definition at line 54 of file DuplicateSeedDetector.h.

◆ m_nUsedMeasurements

std::vector<index_t> ActsTrk::detail::DuplicateSeedDetector::m_nUsedMeasurements
private

Definition at line 50 of file DuplicateSeedDetector.h.

◆ m_seedIndex

std::vector<boost::container::small_vector<index_t, 2> > ActsTrk::detail::DuplicateSeedDetector::m_seedIndex
private

Definition at line 49 of file DuplicateSeedDetector.h.

◆ m_seedOffset

std::vector<index_t> ActsTrk::detail::DuplicateSeedDetector::m_seedOffset
private

Definition at line 53 of file DuplicateSeedDetector.h.


The documentation for this class was generated from the following files:
ActsTrk::detail::DuplicateSeedDetector::m_numSeeds
index_t m_numSeeds
Definition: DuplicateSeedDetector.h:54
ActsTrk::detail::DuplicateSeedDetector::addSeeds
void addSeeds(std::size_t typeIndex, const ActsTrk::SeedContainer &seeds, const MeasurementIndex &measurementIndex)
Definition: DuplicateSeedDetector.cxx:26
xAOD::SpacePoint_v1
Definition: SpacePoint_v1.h:29
ActsTrk::detail::DuplicateSeedDetector::m_nUsedMeasurements
std::vector< index_t > m_nUsedMeasurements
Definition: DuplicateSeedDetector.h:50
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
ActsTrk::detail::DuplicateSeedDetector::m_measOffset
index_t m_measOffset
Definition: DuplicateSeedDetector.h:48
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
ActsTrk::detail::DuplicateSeedDetector::m_isDuplicateSeed
std::vector< bool > m_isDuplicateSeed
Definition: DuplicateSeedDetector.h:52
ActsTrk::detail::DuplicateSeedDetector::m_disabled
bool m_disabled
Definition: DuplicateSeedDetector.h:47
detail::ul
unsigned long ul
Definition: PrimitiveHelpers.h:46
xAOD::SpacePoint_v1::measurements
const std::vector< const xAOD::UncalibratedMeasurement * > & measurements() const
Returns the index of the measurements.
ActsTrk::detail::DuplicateSeedDetector::m_seedIndex
std::vector< boost::container::small_vector< index_t, 2 > > m_seedIndex
Definition: DuplicateSeedDetector.h:49
ActsTrk::ActsSeed
Definition: Seed.h:18
ActsTrk::detail::DuplicateSeedDetector::m_nSeedMeasurements
std::vector< index_t > m_nSeedMeasurements
Definition: DuplicateSeedDetector.h:51
ActsTrk::detail::DuplicateSeedDetector::m_seedOffset
std::vector< index_t > m_seedOffset
Definition: DuplicateSeedDetector.h:53