ATLAS Offline Software
Loading...
Searching...
No Matches
L1Muon::L1TGC::FloatingTrackSelector Class Reference

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

#include <FloatingTrackSelector.h>

Collaboration diagram for L1Muon::L1TGC::FloatingTrackSelector:

Public Member Functions

void select (const TgcSLCandidateContainer &candidates, xAOD::L1TGCCandDataContainer &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 15 of file FloatingTrackSelector.h.

Member Function Documentation

◆ select()

void L1Muon::L1TGC::FloatingTrackSelector::select ( const TgcSLCandidateContainer & candidates,
xAOD::L1TGCCandDataContainer & 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 49 of file FloatingTrackSelector.cxx.

50 {
51 std::vector<const TgcSLCandidate *> orderedCandidates;
52 orderedCandidates.reserve(candidates.size());
53 for (const TgcSLCandidate &candidate : candidates) {
54 if (candidate.threshold == 0U)
55 continue;
56 orderedCandidates.emplace_back(&candidate);
57 }
58
59 std::stable_sort(orderedCandidates.begin(), orderedCandidates.end(),
60 [](const TgcSLCandidate *left, const TgcSLCandidate *right) {
61 const CandidateGroup leftGroup = candidateGroup(*left);
62 const CandidateGroup rightGroup = candidateGroup(*right);
63 if (leftGroup != rightGroup)
64 return leftGroup < rightGroup;
65
66 if (left->threshold != right->threshold) {
67 return left->threshold > right->threshold;
68 }
69 const float leftPt = selectionPt(*left);
70 const float rightPt = selectionPt(*right);
71 if (leftPt != rightPt)
72 return leftPt > rightPt;
73 return left->selectorPriority > right->selectorPriority;
74 });
75
76 CandidateGroup currentGroup{};
77 bool haveCurrentGroup{false};
78 std::size_t groupCandidate{0U};
79 for (const TgcSLCandidate *candidate : orderedCandidates) {
80 const CandidateGroup group = candidateGroup(*candidate);
81 if (!haveCurrentGroup || group != currentGroup) {
82 currentGroup = group;
83 haveCurrentGroup = true;
84 groupCandidate = 0U;
85 }
86 if (groupCandidate >= s_maxCandidatesPerSector)
87 continue;
88
89 ++groupCandidate;
90 xAOD::L1TGCCandData *outputCandidate =
91 output.push_back(std::make_unique<xAOD::L1TGCCandData>());
92 fillOutputCandidate(*candidate, static_cast<std::uint8_t>(groupCandidate),
93 *outputCandidate);
94 }
95}
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.
L1TGCCandData_v1 L1TGCCandData

Member Data Documentation

◆ s_maxCandidatesPerSector

std::size_t L1Muon::L1TGC::FloatingTrackSelector::s_maxCandidatesPerSector {6U}
staticconstexprprivate

Definition at line 30 of file FloatingTrackSelector.h.

30{6U};

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