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>(const ActsTrk::SpacePointRange&)>

Public Member Functions

 DuplicateSeedDetector (std::size_t numSeeds, index_t measOffset, bool enabled)
 DuplicateSeedDetector (const DuplicateSeedDetector &)=delete
DuplicateSeedDetector & operator= (const DuplicateSeedDetector &)=delete
 DuplicateSeedDetector (DuplicateSeedDetector &&) noexcept=default
DuplicateSeedDetector & operator= (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)
void newTrajectory ()
void addMeasurement (const xAOD::UncalibratedMeasurement *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_t > m_nUsedMeasurements
std::vector< index_t > m_nSeedMeasurements
std::vector< bool > m_isDuplicateSeed
std::vector< index_t > m_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 20 of file DuplicateSeedDetector.h.

Member Typedef Documentation

◆ index_t

Definition at line 22 of file DuplicateSeedDetector.h.

◆ SpacePointIndicesFun_t

Definition at line 23 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 xAOD::UncalibratedMeasurement * 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 [](const ActsTrk::SpacePointRange&) -> std::array<std::size_t, 3> { return {0, 1, 2}; });
31 }
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 )

Definition at line 33 of file DuplicateSeedDetector.cxx.

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

Member Data Documentation

◆ m_disabled

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

Definition at line 45 of file DuplicateSeedDetector.h.

45{false};

◆ m_foundSeeds

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

Definition at line 54 of file DuplicateSeedDetector.h.

54{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 50 of file DuplicateSeedDetector.h.

◆ m_measOffset

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

Definition at line 46 of file DuplicateSeedDetector.h.

46{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 53 of file DuplicateSeedDetector.h.

53{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 49 of file DuplicateSeedDetector.h.

◆ m_numSeeds

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

Definition at line 52 of file DuplicateSeedDetector.h.

52{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 48 of file DuplicateSeedDetector.h.

◆ m_seedIndex

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

Definition at line 47 of file DuplicateSeedDetector.h.

◆ m_seedOffset

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

Definition at line 51 of file DuplicateSeedDetector.h.


The documentation for this class was generated from the following files: