ATLAS Offline Software
Loading...
Searching...
No Matches
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 }
void addSeeds(std::size_t typeIndex, const ActsTrk::SeedContainer &seeds, const MeasurementIndex &measurementIndex)

◆ 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 std::size_t nSP = 0;
48 bool useTopSp = useTopSpFun(seed);
49 const auto& sps = seed.sp();
50 for (std::size_t isp : spacePointIndicesFun(sps.size())) {
51 const xAOD::SpacePoint *sp = sps.at(useTopSp ? sps.size() - isp - 1 : isp);
52 const std::vector<const xAOD::UncalibratedMeasurement *> &els = sp->measurements();
53 for (const xAOD::UncalibratedMeasurement *meas : els) {
54 std::size_t hitIndex = measurementIndex.index(*meas);
55 if (!(hitIndex < m_seedIndex.size())) {
56 // std::cout << "ERROR hit index " << hitIndex << " past end of " << m_seedIndex.size() << " hit indices\n";
57 continue;
58 }
59 m_seedIndex[hitIndex].push_back(m_numSeeds);
61 }
62 ++nSP;
63 if (nSP >= 3) break;
64 }
65 ++m_numSeeds;
66 }
67 }
std::vector< boost::container::small_vector< index_t, 2 > > m_seedIndex
const std::vector< const xAOD::UncalibratedMeasurement * > & measurements() const
Returns the index of the measurements.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.

◆ 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

◆ 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.

47{false};

◆ m_foundSeeds

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

Definition at line 56 of file DuplicateSeedDetector.h.

56{0u}; // count of found seeds for this/last trajectory
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77

◆ 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.

48{0u}; // if a seed has N hits, only N - m_measOffset are needed to mark it as duplicate

◆ m_nextSeed

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

Definition at line 55 of file DuplicateSeedDetector.h.

55{0ul}; // index of next seed expected with isDuplicate()
unsigned long ul

◆ 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.

54{0u}; // count of number of seeds so-far added with addSeeds()

◆ 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: