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

156  {
157  size_t packet_size_w = Size(ver);
158 
159  if (std::size(payload) != packet_size_w) {
160  throw std::runtime_error(
161  Muon::nsw::format("Packet vector has size {} instead of expected size {}", std::size(payload), packet_size_w));
162  }
163  auto readPointer = std::size_t{0};
164  const auto packets = std::span{payload.data(), std::size(payload)};
165  auto decode = [&packets](std::size_t& readPointer, const std::size_t size) {
166  return decode_and_advance<std::uint64_t, std::uint32_t>(packets, readPointer, size);
167  };
168 
169  if (ver < 3)
170  {
171  // In the versions prior to version 3, there was a LUT used to merge segments
172  // the versions following 3 use an algorithm that simplifies the merge, and hence the
173  // structure of these data changed
177  }
178  else
179  {
183  }
184 
185  for (std::size_t i = Muon::nsw::STGTPSegments::num_segments; i > 0; --i) {
186  const auto index = i - 1;
194 
195  }
196 
199 
200 
201 }

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

204  {
206  throw std::out_of_range(
207  Muon::nsw::format("Requested segment {} which does not exist (max {})", segment, STGTPSegments::num_segments - 1));
208  }
209  return m_segmentData.at(segment);
210 }

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

136  {
137  size_t packet_size_w = 0;
138  size_t word_size = 32;
139  switch (ver) {
140  case 1:
141  packet_size_w = Muon::nsw::STGTPSegments::size_v1 / word_size;;
142  break;
143  case 2:
144  packet_size_w = Muon::nsw::STGTPSegments::size_v2 / word_size;;
145  break;
146  case 3:
147  packet_size_w = Muon::nsw::STGTPSegments::size_v3 / word_size;
148  break;
149  default:
150  packet_size_w = 0;
151  break;
152  }
153  return packet_size_w;
154 }

◆ 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:105
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:108
Muon::nsw::STGTPSegments::size_v2
constexpr std::size_t size_v2
Definition: NSWSTGTPDecodeBitmaps.h:119
Muon::nsw::STGTPSegments::size_output_segment_phiRes
constexpr int size_output_segment_phiRes
Definition: NSWSTGTPDecodeBitmaps.h:110
Muon::nsw::STGTPSegments::size_v3
constexpr std::size_t size_v3
Definition: NSWSTGTPDecodeBitmaps.h:120
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:111
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:112
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Muon::nsw::STGTPSegments::num_segments
constexpr std::size_t num_segments
Definition: NSWSTGTPDecodeBitmaps.h:99
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:109
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:121
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::nsw::STGTPSegments::size_v1
constexpr std::size_t size_v1
Definition: NSWSTGTPDecodeBitmaps.h:118
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:103
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:117
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:107
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:115
Muon::nsw::STGTPSegments::size_nsw_segment_selector
constexpr int size_nsw_segment_selector
Definition: NSWSTGTPDecodeBitmaps.h:104
Muon::nsw::STGTPSegmentPacket::Size
size_t Size(const int ver)
Definition: STGTPPackets.cxx:136
Muon::nsw::STGTPSegments::size_sectorID
constexpr int size_sectorID
Definition: NSWSTGTPDecodeBitmaps.h:116
Muon::nsw::STGTPSegments::size_output_segment_rIndex
constexpr int size_output_segment_rIndex
Definition: NSWSTGTPDecodeBitmaps.h:113
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5