ATLAS Offline Software
Loading...
Searching...
No Matches
L0Muon::TgcL0Floating::TrackSelector Class Reference

Select and convert floating-point TGC candidates. More...

#include <TgcL0TrackSelector.h>

Collaboration diagram for L0Muon::TgcL0Floating::TrackSelector:

Public Member Functions

void select (const TgcL0CandidateContainer &candidates, xAOD::TGCCandDataContainer &output) const
 Fill the xAOD output with the six highest-threshold candidates per sector for one BC processing chain.

Static Private Attributes

static constexpr std::size_t s_maxCandidatesPerSector {6U}

Detailed Description

Select and convert floating-point TGC candidates.

Definition at line 16 of file TgcL0TrackSelector.h.

Member Function Documentation

◆ select()

void TrackSelector::select ( const TgcL0CandidateContainer & candidates,
xAOD::TGCCandDataContainer & output ) const

Fill the xAOD output with the six highest-threshold candidates per sector for one BC processing chain.

Parameters
candidatesInput candidates after Inner Coincidence and BC-chain selection.
outputOutput TGC candidate container.

Definition at line 52 of file TgcL0TrackSelector.cxx.

53 {
54 std::vector<const TgcL0Candidate *> orderedCandidates;
55 orderedCandidates.reserve(candidates.size());
56 for (const TgcL0Candidate &candidate : candidates) {
57 if (candidate.threshold == 0U)
58 continue;
59 orderedCandidates.emplace_back(&candidate);
60 }
61
62 std::stable_sort(orderedCandidates.begin(), orderedCandidates.end(),
63 [](const TgcL0Candidate *left, const TgcL0Candidate *right) {
64 const CandidateGroup leftGroup = candidateGroup(*left);
65 const CandidateGroup rightGroup = candidateGroup(*right);
66 if (leftGroup != rightGroup)
67 return leftGroup < rightGroup;
68
69 if (left->threshold != right->threshold) {
70 return left->threshold > right->threshold;
71 }
72 const float leftPt = selectionPt(*left);
73 const float rightPt = selectionPt(*right);
74 if (leftPt != rightPt)
75 return leftPt > rightPt;
76 return left->selectorPriority > right->selectorPriority;
77 });
78
79 CandidateGroup currentGroup{};
80 bool haveCurrentGroup{false};
81 std::size_t groupCandidate{0U};
82 for (const TgcL0Candidate *candidate : orderedCandidates) {
83 const CandidateGroup group = candidateGroup(*candidate);
84 if (!haveCurrentGroup || group != currentGroup) {
85 currentGroup = group;
86 haveCurrentGroup = true;
87 groupCandidate = 0U;
88 }
89 if (groupCandidate >= s_maxCandidatesPerSector)
90 continue;
91
92 ++groupCandidate;
93 xAOD::TGCCandData *outputCandidate =
94 output.push_back(std::make_unique<xAOD::TGCCandData>());
95 fillOutputCandidate(*candidate, static_cast<std::uint8_t>(groupCandidate),
96 *outputCandidate);
97 }
98}
static constexpr std::size_t s_maxCandidatesPerSector
output
Definition merge.py:16
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.

Member Data Documentation

◆ s_maxCandidatesPerSector

std::size_t L0Muon::TgcL0Floating::TrackSelector::s_maxCandidatesPerSector {6U}
staticconstexprprivate

Definition at line 31 of file TgcL0TrackSelector.h.

31{6U};

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