ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Muon::nsw::STGTPStripPacket Class Reference

#include <STGTPPackets.h>

Collaboration diagram for Muon::nsw::STGTPStripPacket:

Public Member Functions

 STGTPStripPacket (const std::vector< std::uint32_t > &payload, const int ver)
 
virtual ~STGTPStripPacket ()=default
 
const std::array< std::uint32_t, STGTPStrips::num_strips > & Strips () const
 
std::uint32_t Strip (std::size_t strip) const
 
const std::array< std::uint32_t, STGTPStrips::num_offsets > & Offsets () const
 
std::uint32_t Offset (std::size_t offset) const
 
std::uint32_t PhiIdValue () const
 
std::uint32_t PhiIdSign () const
 
std::uint32_t BandId () const
 
std::uint32_t BCID () const
 

Private Member Functions

size_t Size (const int ver)
 

Private Attributes

std::array< std::uint32_t, STGTPStrips::num_stripsm_stripData {}
 
std::array< std::uint32_t, STGTPStrips::num_offsetsm_offsets {}
 
std::uint32_t m_phiIdValue {}
 
std::uint32_t m_phiIdSign {}
 
std::uint32_t m_bandId {}
 
std::uint32_t m_BCID {}
 

Detailed Description

Definition at line 103 of file STGTPPackets.h.

Constructor & Destructor Documentation

◆ STGTPStripPacket()

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

Definition at line 245 of file STGTPPackets.cxx.

245  {
246  size_t packet_size_w = Size(ver);
247 
248  if (std::size(payload) != packet_size_w) {
249  throw std::runtime_error(
250  Muon::nsw::format("Strip packet vector has size {} instead of expected size {}", std::size(payload), packet_size_w));
251  }
252 
253  const auto packets = std::span{payload.data(), std::size(payload)};
254  auto readPointer = std::size_t{0};
255  auto decode = [&packets](std::size_t& readPointer, const std::size_t size) {
256  return decode_and_advance<std::uint64_t, std::uint32_t>(packets, readPointer, size);
257  };
258 
259  // Skip padding (70 bits)
261 
262  // Decode 112 strips (6 bits each)
263  for (std::size_t i = Muon::nsw::STGTPStrips::num_strips; i > 0; --i) {
264  const auto index = i - 1;
266  }
267 
268  // Decode 8 offsets (16 bits each)
269  for (std::size_t i = Muon::nsw::STGTPStrips::num_offsets; i > 0; --i) {
270  const auto index = i - 1;
272  }
273 
274  // Decode remaining fields
279 }

◆ ~STGTPStripPacket()

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

Member Function Documentation

◆ BandId()

std::uint32_t Muon::nsw::STGTPStripPacket::BandId ( ) const
inline

Definition at line 116 of file STGTPPackets.h.

116 { return m_bandId; }

◆ BCID()

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

Definition at line 117 of file STGTPPackets.h.

117 { return m_BCID; }

◆ Offset()

std::uint32_t Muon::nsw::STGTPStripPacket::Offset ( std::size_t  offset) const

Definition at line 289 of file STGTPPackets.cxx.

289  {
291  throw std::out_of_range(
292  Muon::nsw::format("Requested offset {} which does not exist (max {})", offset, STGTPStrips::num_offsets - 1));
293  }
294  return m_offsets.at(offset);
295 }

◆ Offsets()

const std::array<std::uint32_t, STGTPStrips::num_offsets>& Muon::nsw::STGTPStripPacket::Offsets ( ) const
inline

Definition at line 111 of file STGTPPackets.h.

111 { return m_offsets; }

◆ PhiIdSign()

std::uint32_t Muon::nsw::STGTPStripPacket::PhiIdSign ( ) const
inline

Definition at line 115 of file STGTPPackets.h.

115 { return m_phiIdSign; }

◆ PhiIdValue()

std::uint32_t Muon::nsw::STGTPStripPacket::PhiIdValue ( ) const
inline

Definition at line 114 of file STGTPPackets.h.

114 { return m_phiIdValue; }

◆ Size()

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

Definition at line 225 of file STGTPPackets.cxx.

225  {
226  size_t packet_size_w = 0;
227  size_t word_size = 32;
228  switch (ver) {
229  case 1:
230  packet_size_w = Muon::nsw::STGTPStrips::size_v1 / word_size;
231  break;
232  case 2:
233  packet_size_w = Muon::nsw::STGTPStrips::size_v2 / word_size;
234  break;
235  case 3:
236  packet_size_w = Muon::nsw::STGTPStrips::size_v3 / word_size;
237  break;
238  default:
239  packet_size_w = 0;
240  break;
241  }
242  return packet_size_w;
243 }

◆ Strip()

std::uint32_t Muon::nsw::STGTPStripPacket::Strip ( std::size_t  strip) const

Definition at line 281 of file STGTPPackets.cxx.

281  {
282  if (strip >= STGTPStrips::num_strips) {
283  throw std::out_of_range(
284  Muon::nsw::format("Requested strip {} which does not exist (max {})", strip, STGTPStrips::num_strips - 1));
285  }
286  return m_stripData.at(strip);
287 }

◆ Strips()

const std::array<std::uint32_t, STGTPStrips::num_strips>& Muon::nsw::STGTPStripPacket::Strips ( ) const
inline

Definition at line 109 of file STGTPPackets.h.

109 { return m_stripData; }

Member Data Documentation

◆ m_bandId

std::uint32_t Muon::nsw::STGTPStripPacket::m_bandId {}
private

Definition at line 124 of file STGTPPackets.h.

◆ m_BCID

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

Definition at line 125 of file STGTPPackets.h.

◆ m_offsets

std::array<std::uint32_t, STGTPStrips::num_offsets> Muon::nsw::STGTPStripPacket::m_offsets {}
private

Definition at line 121 of file STGTPPackets.h.

◆ m_phiIdSign

std::uint32_t Muon::nsw::STGTPStripPacket::m_phiIdSign {}
private

Definition at line 123 of file STGTPPackets.h.

◆ m_phiIdValue

std::uint32_t Muon::nsw::STGTPStripPacket::m_phiIdValue {}
private

Definition at line 122 of file STGTPPackets.h.

◆ m_stripData

std::array<std::uint32_t, STGTPStrips::num_strips> Muon::nsw::STGTPStripPacket::m_stripData {}
private

Definition at line 120 of file STGTPPackets.h.


The documentation for this class was generated from the following files:
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.
index
Definition: index.py:1
Muon::nsw::STGTPStripPacket::m_phiIdValue
std::uint32_t m_phiIdValue
Definition: STGTPPackets.h:122
Muon::nsw::STGTPStrips::size_band_id
constexpr int size_band_id
Definition: NSWSTGTPDecodeBitmaps.h:197
Muon::nsw::STGTPStrips::size_v1
constexpr std::size_t size_v1
Definition: NSWSTGTPDecodeBitmaps.h:200
Muon::nsw::STGTPStrips::size_v2
constexpr std::size_t size_v2
Definition: NSWSTGTPDecodeBitmaps.h:201
Muon::nsw::STGTPStripPacket::Size
size_t Size(const int ver)
Definition: STGTPPackets.cxx:225
Muon::nsw::STGTPStripPacket::m_BCID
std::uint32_t m_BCID
Definition: STGTPPackets.h:125
Muon::nsw::STGTPStrips::size_phi_id_sign
constexpr int size_phi_id_sign
Definition: NSWSTGTPDecodeBitmaps.h:196
Muon::nsw::STGTPStrips::size_padding
constexpr int size_padding
Definition: NSWSTGTPDecodeBitmaps.h:192
Muon::nsw::STGTPStripPacket::m_stripData
std::array< std::uint32_t, STGTPStrips::num_strips > m_stripData
Definition: STGTPPackets.h:120
Muon::nsw::STGTPStripPacket::m_phiIdSign
std::uint32_t m_phiIdSign
Definition: STGTPPackets.h:123
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Pythia8_A14_NNPDF23LO_Var1Down_Common.ver
ver
Definition: Pythia8_A14_NNPDF23LO_Var1Down_Common.py:26
Muon::nsw::STGTPStrips::size_v3
constexpr std::size_t size_v3
Definition: NSWSTGTPDecodeBitmaps.h:202
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::nsw::STGTPStrips::size_offset
constexpr int size_offset
Definition: NSWSTGTPDecodeBitmaps.h:194
Muon::nsw::STGTPStrips::num_offsets
constexpr std::size_t num_offsets
Definition: NSWSTGTPDecodeBitmaps.h:189
Muon::nsw::STGTPStrips::size_phi_id_value
constexpr int size_phi_id_value
Definition: NSWSTGTPDecodeBitmaps.h:195
Muon::nsw::format
std::string format(const std::string &str, const T &arg)
Definition: NSWDecodeHelper.h:43
Muon::nsw::STGTPStripPacket::m_bandId
std::uint32_t m_bandId
Definition: STGTPPackets.h:124
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
Muon::nsw::STGTPStrips::num_strips
constexpr std::size_t num_strips
Definition: NSWSTGTPDecodeBitmaps.h:188
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
Muon::nsw::STGTPStrips::size_strip_adc
constexpr int size_strip_adc
Definition: NSWSTGTPDecodeBitmaps.h:193
Muon::nsw::STGTPStrips::size_bcid
constexpr int size_bcid
Definition: NSWSTGTPDecodeBitmaps.h:198
Muon::nsw::STGTPStripPacket::m_offsets
std::array< std::uint32_t, STGTPStrips::num_offsets > m_offsets
Definition: STGTPPackets.h:121