ATLAS Offline Software
Loading...
Searching...
No Matches
TgcL0SegmentBuilder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <algorithm>
8#include <limits>
9
10namespace L0Muon {
11namespace TgcL0Floating {
12
13StatusCode SegmentBuilder::build(const HitGroups& hitGroups,
14 SegmentContainer& segments) const {
15 segments.clear();
16 segments.reserve(hitGroups.size());
17
18 for (const auto& [key, hits] : hitGroups) {
19 if (hits.empty()) {
20 continue;
21 }
22
23 std::uint16_t firstChannel = std::numeric_limits<std::uint16_t>::max();
24 std::uint16_t lastChannel = 0;
25 for (const Hit& hit : hits) {
26 firstChannel = std::min(firstChannel, hit.channel);
27 lastChannel = std::max(lastChannel, hit.channel);
28 }
29
30 segments.emplace_back(key, firstChannel, lastChannel, hits.size());
31 }
32 return StatusCode::SUCCESS;
33}
34
35} // namespace TgcL0Floating
36} // namespace L0Muon
StatusCode build(const HitGroups &hitGroups, SegmentContainer &segments) const
std::vector< Segment > SegmentContainer
std::map< HitGroupKey, HitContainer > HitGroups