ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 }

◆ ~STGTPSegmentPacket()

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

Member Function Documentation

◆ BCID()

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

Definition at line 88 of file STGTPPackets.h.

88 { return m_BCID; };

◆ LUT_ChoiceSelection()

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

Definition at line 81 of file STGTPPackets.h.

81 { return m_lut_choice; }

◆ NSW_SegmentSelector()

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

Definition at line 82 of file STGTPPackets.h.

82 { return m_nsw_segment_selector; }

◆ SectorID()

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

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

Definition at line 216 of file STGTPPackets.cxx.

217  {
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
inline

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 }

◆ ValidSegmentSelector()

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

Definition at line 83 of file STGTPPackets.h.

83 { return m_valid_segment_selector; }

Member Data Documentation

◆ m_BCID

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

Definition at line 98 of file STGTPPackets.h.

◆ m_lut_choice

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

Definition at line 92 of file STGTPPackets.h.

◆ m_nsw_segment_selector

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

Definition at line 93 of file STGTPPackets.h.

◆ m_sectorID

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

Definition at line 99 of file STGTPPackets.h.

◆ m_segmentData

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

Definition at line 96 of file STGTPPackets.h.

◆ m_valid_segment_selector

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

Definition at line 94 of file STGTPPackets.h.


The documentation for this class was generated from the following files:
Muon::nsw::STGTPSegments::size_valid_segment_selector
constexpr int size_valid_segment_selector
Definition: NSWSTGTPDecodeBitmaps.h:107
AtlasMcWeight::decode
double decode(number_type binnedWeight)
Convert weight from unsigned to double.
Definition: AtlasMcWeight.cxx:32
CxxUtils::span
span(T *ptr, std::size_t sz) -> span< T >
A couple needed deduction guides.
Muon::nsw::STGTPSegments::size_output_segment_spare
constexpr int size_output_segment_spare
Definition: NSWSTGTPDecodeBitmaps.h:110
Muon::nsw::STGTPSegments::size_v2
constexpr std::size_t size_v2
Definition: NSWSTGTPDecodeBitmaps.h:121
Muon::nsw::STGTPSegments::size_output_segment_phiRes
constexpr int size_output_segment_phiRes
Definition: NSWSTGTPDecodeBitmaps.h:112
Muon::nsw::STGTPSegments::size_v3
constexpr std::size_t size_v3
Definition: NSWSTGTPDecodeBitmaps.h:122
index
Definition: index.py:1
Muon::nsw::STGTPSegmentPacket::m_lut_choice
std::uint32_t m_lut_choice
Definition: STGTPPackets.h:92
Muon::nsw::STGTPSegments::size_output_segment_dTheta
constexpr int size_output_segment_dTheta
Definition: NSWSTGTPDecodeBitmaps.h:113
Muon::nsw::STGTPSegmentPacket::m_BCID
std::uint32_t m_BCID
Definition: STGTPPackets.h:98
Muon::nsw::STGTPSegments::size_output_segment_phiID
constexpr int size_output_segment_phiID
Definition: NSWSTGTPDecodeBitmaps.h:114
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Muon::nsw::STGTPSegments::num_segments
constexpr std::size_t num_segments
Definition: NSWSTGTPDecodeBitmaps.h:101
Pythia8_A14_NNPDF23LO_Var1Down_Common.ver
ver
Definition: Pythia8_A14_NNPDF23LO_Var1Down_Common.py:26
Muon::nsw::STGTPSegments::size_output_segment_lowRes
constexpr int size_output_segment_lowRes
Definition: NSWSTGTPDecodeBitmaps.h:111
Muon::nsw::STGTPSegmentPacket::m_valid_segment_selector
std::uint32_t m_valid_segment_selector
Definition: STGTPPackets.h:94
Muon::nsw::STGTPSegments::size_valid_segment_v3
constexpr std::size_t size_valid_segment_v3
Definition: NSWSTGTPDecodeBitmaps.h:123
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::nsw::STGTPSegments::size_v1
constexpr std::size_t size_v1
Definition: NSWSTGTPDecodeBitmaps.h:120
Muon::nsw::STGTPSegmentPacket::m_segmentData
std::array< SegmentData, STGTPSegments::num_segments > m_segmentData
Definition: STGTPPackets.h:96
Muon::nsw::STGTPSegments::size_lut_choice_selection
constexpr int size_lut_choice_selection
Definition: NSWSTGTPDecodeBitmaps.h:105
Muon::nsw::STGTPSegmentPacket::m_nsw_segment_selector
std::uint32_t m_nsw_segment_selector
Definition: STGTPPackets.h:93
Muon::nsw::STGTPSegments::size_v3_padding
constexpr int size_v3_padding
Definition: NSWSTGTPDecodeBitmaps.h:119
Muon::nsw::format
std::string format(const std::string &str, const T &arg)
Definition: NSWDecodeHelper.h:43
Muon::nsw::STGTPSegments::size_output_segment_monitor
constexpr int size_output_segment_monitor
Definition: NSWSTGTPDecodeBitmaps.h:109
Muon::nsw::STGTPSegmentPacket::m_sectorID
std::uint32_t m_sectorID
Definition: STGTPPackets.h:99
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
Muon::nsw::STGTPSegments::size_bcid
constexpr int size_bcid
Definition: NSWSTGTPDecodeBitmaps.h:117
Muon::nsw::STGTPSegments::size_nsw_segment_selector
constexpr int size_nsw_segment_selector
Definition: NSWSTGTPDecodeBitmaps.h:106
Muon::nsw::STGTPSegmentPacket::Size
size_t Size(const int ver)
Definition: STGTPPackets.cxx:149
Muon::nsw::STGTPSegments::size_sectorID
constexpr int size_sectorID
Definition: NSWSTGTPDecodeBitmaps.h:118
Muon::nsw::STGTPSegments::size_output_segment_rIndex
constexpr int size_output_segment_rIndex
Definition: NSWSTGTPDecodeBitmaps.h:115
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5