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 169 of file STGTPPackets.cxx.

169 {
170 size_t packet_size_w = Size(ver);
171
172 if (std::size(payload) != packet_size_w) {
173 throw std::runtime_error(
174 Muon::nsw::format("Packet vector has size {} instead of expected size {}", std::size(payload), packet_size_w));
175 }
176 auto readPointer = std::size_t{0};
177 const auto packets = std::span{payload.data(), std::size(payload)};
178 auto decode = [&packets](std::size_t& readPointer, const std::size_t size) {
179 return decode_and_advance<std::uint64_t, std::uint32_t>(packets, readPointer, size);
180 };
181
182 if (ver < 3)
183 {
184 // In the versions prior to version 3, there was a LUT used to merge segments
185 // the versions following 3 use an algorithm that simplifies the merge, and hence the
186 // structure of these data changed
190 }
191 else
192 {
196 }
197
198 for (std::size_t i = Muon::nsw::STGTPSegments::num_segments; i > 0; --i) {
199 const auto index = i - 1;
207
208 }
209
212
213
214}
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 216 of file STGTPPackets.cxx.

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

◆ 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 149 of file STGTPPackets.cxx.

149 {
150 size_t packet_size_w = 0;
151 size_t word_size = 32;
152 switch (ver) {
153 case 1:
154 packet_size_w = Muon::nsw::STGTPSegments::size_v1 / word_size;;
155 break;
156 case 2:
157 packet_size_w = Muon::nsw::STGTPSegments::size_v2 / word_size;;
158 break;
159 case 3:
160 packet_size_w = Muon::nsw::STGTPSegments::size_v3 / word_size;
161 break;
162 default:
163 packet_size_w = 0;
164 break;
165 }
166 return packet_size_w;
167}
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: