Class Acts::CandidatesForMiddleSp

template<typename external_space_point_t>
class CandidatesForMiddleSp

The CandidatesForMiddleSp collects the triplet candidates given a fixed middle spacepoint.

It internally stores the triplet candidates keeping only those with the higher quality.

Template Parameters

external_space_point_t – The external spacepoint type.

Public Types

using value_type = TripletCandidate<external_space_point_t>

Public Functions

CandidatesForMiddleSp() = default

constructor

~CandidatesForMiddleSp() = default

Destructor.

void clear()

Clear the internal storage.

bool push(external_space_point_t &SpB, external_space_point_t &SpM, external_space_point_t &SpT, float weight, float zOrigin, bool isQuality)

Adding a new triplet candidate to the collection, should it satisfy the selection criteria.

Parameters
  • SpB – Bottom space point

  • SpM – Medium space point

  • SpT – Top space point

  • weight – The quality of the triplet candidate

  • zOrigin – The z-coordinate of the origin

  • isQuality – Whether the triplet candidate is high or low quality

Returns

whether the triplet candidate has been added or not to the collection

void setMaxElements(std::size_t n_low, std::size_t n_high)

Setting maximum number of candidates to keep.

Parameters
  • n_low – Maximum number of candidates in the low-quality collection

  • n_high – Maximum number of candidates in the high-quality collection

std::vector<value_type> storage()

Retrieve the triplet candidates, the resulting vector is already sorted, elements with higher quality first.

Returns

Vector of triplet candidates

Public Static Functions

static bool ascendingByQuality(const value_type &i1, const value_type &i2)

A function for sorting the triplet candidates from lower to higher quality.

Parameters
  • i1 – First triplet candidate

  • i2 – Second triplet candidate

Returns

The comparison result

static bool descendingByQuality(const value_type &i1, const value_type &i2)

A function for sorting the triplet candidates from higher to lower quality.

Parameters
  • i1 – First triplet candidate

  • i2 – Second triplet candidate

Returns

The comparison result