ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::nsw::STGTPSegmentPacket Class Reference

#include <STGTPPackets.h>

Collaboration diagram for Muon::nsw::STGTPSegmentPacket:

Classes

struct  SegmentData

Public Member Functions

 STGTPSegmentPacket (const std::vector< std::uint32_t > &payload, const int ver)
virtual ~STGTPSegmentPacket ()=default
std::uint32_t LUT_ChoiceSelection () const
std::uint32_t NSW_SegmentSelector () const
std::uint32_t ValidSegmentSelector () const
const std::array< SegmentData, STGTPSegments::num_segments > & Segments () const
const SegmentDataSegment (std::size_t segment) const
std::uint32_t BCID () const
std::uint32_t SectorID () const

Private Member Functions

size_t Size (const int ver)

Private Attributes

std::uint32_t m_lut_choice {}
std::uint32_t m_nsw_segment_selector {}
std::uint32_t m_valid_segment_selector {}
std::array< SegmentData, STGTPSegments::num_segmentsm_segmentData {}
std::uint32_t m_BCID {}
std::uint32_t m_sectorID {}

Detailed Description

Definition at line 66 of file STGTPPackets.h.

Constructor & Destructor Documentation

◆ STGTPSegmentPacket()

Muon::nsw::STGTPSegmentPacket::STGTPSegmentPacket ( const std::vector< std::uint32_t > & payload,
const int ver )
explicit

Definition at line 171 of file STGTPPackets.cxx.

171 {
172 size_t packet_size_w = Size(ver);
173
174 if (std::size(payload) != packet_size_w) {
175 throw std::runtime_error(
176 Muon::nsw::format("Packet vector has size {} instead of expected size {}", std::size(payload), packet_size_w));
177 }
178 auto readPointer = std::size_t{0};
179 const auto packets = std::span{payload.data(), std::size(payload)};
180 auto decode = [&packets](std::size_t& readPointer, const std::size_t size) {
181 return decode_and_advance<std::uint64_t, std::uint32_t>(packets, readPointer, size);
182 };
183
184 if (ver < 3)
185 {
186 // In the versions prior to version 3, there was a LUT used to merge segments
187 // the versions following 3 use an algorithm that simplifies the merge, and hence the
188 // structure of these data changed
192 }
193 else
194 {
198 }
199
200 for (std::size_t i = Muon::nsw::STGTPSegments::num_segments; i > 0; --i) {
201 const auto index = i - 1;
209
210 }
211
214
215
216}
size_t size() const
Number of registered mappings.
size_t Size(const int ver)
std::uint32_t m_valid_segment_selector
std::array< SegmentData, STGTPSegments::num_segments > m_segmentData
std::uint32_t m_nsw_segment_selector
double decode(number_type binnedWeight)
Convert weight from unsigned to double.
str index
Definition DeMoScan.py:362
constexpr std::size_t num_segments
constexpr std::size_t size_valid_segment_v3
std::string format(const std::string &str, const T &arg)
constexpr Target decode_and_advance(const std::span< const Source > words, std::size_t &start, const std::size_t size)
Decode bits from data of words and advance the read pointer.

◆ ~STGTPSegmentPacket()

virtual Muon::nsw::STGTPSegmentPacket::~STGTPSegmentPacket ( )
virtualdefault

Member Function Documentation

◆ BCID()

std::uint32_t Muon::nsw::STGTPSegmentPacket::BCID ( ) const
inlinenodiscard

Definition at line 88 of file STGTPPackets.h.

88{ return m_BCID; };

◆ LUT_ChoiceSelection()

std::uint32_t Muon::nsw::STGTPSegmentPacket::LUT_ChoiceSelection ( ) const
inlinenodiscard

Definition at line 81 of file STGTPPackets.h.

81{ return m_lut_choice; }

◆ NSW_SegmentSelector()

std::uint32_t Muon::nsw::STGTPSegmentPacket::NSW_SegmentSelector ( ) const
inlinenodiscard

Definition at line 82 of file STGTPPackets.h.

82{ return m_nsw_segment_selector; }

◆ SectorID()

std::uint32_t Muon::nsw::STGTPSegmentPacket::SectorID ( ) const
inlinenodiscard

Definition at line 89 of file STGTPPackets.h.

89{ return m_sectorID; }

◆ Segment()

const Muon::nsw::STGTPSegmentPacket::SegmentData & Muon::nsw::STGTPSegmentPacket::Segment ( std::size_t segment) const
nodiscard

Definition at line 218 of file STGTPPackets.cxx.

219 {
220 if (segment >= STGTPSegments::num_segments) {
221 throw std::out_of_range(
222 Muon::nsw::format("Requested segment {} which does not exist (max {})", segment, STGTPSegments::num_segments - 1));
223 }
224 return m_segmentData.at(segment);
225}

◆ Segments()

const std::array< SegmentData, STGTPSegments::num_segments > & Muon::nsw::STGTPSegmentPacket::Segments ( ) const
inlinenodiscard

Definition at line 85 of file STGTPPackets.h.

85{ return m_segmentData; }

◆ Size()

size_t Muon::nsw::STGTPSegmentPacket::Size ( const int ver)
private

Definition at line 151 of file STGTPPackets.cxx.

151 {
152 size_t packet_size_w = 0;
153 size_t word_size = 32;
154 switch (ver) {
155 case 1:
156 packet_size_w = Muon::nsw::STGTPSegments::size_v1 / word_size;;
157 break;
158 case 2:
159 packet_size_w = Muon::nsw::STGTPSegments::size_v2 / word_size;;
160 break;
161 case 3:
162 packet_size_w = Muon::nsw::STGTPSegments::size_v3 / word_size;
163 break;
164 default:
165 packet_size_w = 0;
166 break;
167 }
168 return packet_size_w;
169}
constexpr std::size_t size_v3
constexpr std::size_t size_v2
constexpr std::size_t size_v1

◆ ValidSegmentSelector()

std::uint32_t Muon::nsw::STGTPSegmentPacket::ValidSegmentSelector ( ) const
inlinenodiscard

Definition at line 83 of file STGTPPackets.h.

Member Data Documentation

◆ m_BCID

std::uint32_t Muon::nsw::STGTPSegmentPacket::m_BCID {}
private

Definition at line 98 of file STGTPPackets.h.

98{};

◆ m_lut_choice

std::uint32_t Muon::nsw::STGTPSegmentPacket::m_lut_choice {}
private

Definition at line 92 of file STGTPPackets.h.

92{};

◆ m_nsw_segment_selector

std::uint32_t Muon::nsw::STGTPSegmentPacket::m_nsw_segment_selector {}
private

Definition at line 93 of file STGTPPackets.h.

93{};

◆ m_sectorID

std::uint32_t Muon::nsw::STGTPSegmentPacket::m_sectorID {}
private

Definition at line 99 of file STGTPPackets.h.

99{};

◆ m_segmentData

std::array<SegmentData, STGTPSegments::num_segments> Muon::nsw::STGTPSegmentPacket::m_segmentData {}
private

Definition at line 96 of file STGTPPackets.h.

96{};

◆ m_valid_segment_selector

std::uint32_t Muon::nsw::STGTPSegmentPacket::m_valid_segment_selector {}
private

Definition at line 94 of file STGTPPackets.h.

94{};

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