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

#include <STGTPPackets.h>

Collaboration diagram for Muon::nsw::STGTPMMPacket:

Classes

struct  MMSegmentData
 

Public Member Functions

 STGTPMMPacket (const std::vector< std::uint32_t > &payload, const int ver)
 
virtual ~STGTPMMPacket ()=default
 
size_t Size (const int ver)
 
const std::array< MMSegmentData, STGTPMMData::num_mm > & Segments () const
 
const MMSegmentDataSegment (std::size_t segment) const
 
std::uint32_t BCID () const
 

Private Attributes

std::array< MMSegmentData, STGTPMMData::num_mmm_segmentData {}
 
std::uint32_t m_BCID {}
 

Detailed Description

Definition at line 18 of file STGTPPackets.h.

Constructor & Destructor Documentation

◆ STGTPMMPacket()

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

Definition at line 38 of file STGTPPackets.cxx.

38  {
39 
40  if (ver < 3){
41  // This section did not exist before v3
42  return;
43  }
44 
45  size_t packet_size_w = Size(ver);
46 
47  if (std::size(payload) != packet_size_w) {
48  throw std::runtime_error(
49  Muon::nsw::format("Packet vector has size {} instead of expected size {}", std::size(payload), packet_size_w));
50  }
51 
52  const auto packets = std::span{payload.data(), std::size(payload)};
53  auto readPointer = std::size_t{0};
54  auto decode = [&packets](std::size_t& readPointer, const std::size_t size) {
55  return decode_and_advance<std::uint64_t, std::uint32_t>(packets, readPointer, size);
56  };
57 
58 
60  for (std::size_t i = Muon::nsw::STGTPMMData::num_mm; i > 0; --i) {
61  const auto index = i - 1;
69  }
71 
72 }

◆ ~STGTPMMPacket()

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

Member Function Documentation

◆ BCID()

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

Definition at line 38 of file STGTPPackets.h.

38 { return m_BCID; };

◆ Segment()

const Muon::nsw::STGTPMMPacket::MMSegmentData & Muon::nsw::STGTPMMPacket::Segment ( std::size_t  segment) const

Definition at line 74 of file STGTPPackets.cxx.

75  {
77  throw std::out_of_range(
78  Muon::nsw::format("Requested segment {} which does not exist (max {})", segment, STGTPMMData::num_mm - 1));
79  }
80  return m_segmentData.at(segment);
81 }

◆ Segments()

const std::array<MMSegmentData, STGTPMMData::num_mm>& Muon::nsw::STGTPMMPacket::Segments ( ) const
inline

Definition at line 35 of file STGTPPackets.h.

35 { return m_segmentData; }

◆ Size()

size_t Muon::nsw::STGTPMMPacket::Size ( const int  ver)

Definition at line 19 of file STGTPPackets.cxx.

19  {
20  size_t packet_size_w = 0;
21  size_t word_size = 32;
22  switch (ver) {
23  case 1:
24  packet_size_w = Muon::nsw::STGTPMMData::size_v1 / word_size;
25  break;
26  case 2:
27  packet_size_w = Muon::nsw::STGTPMMData::size_v2 / word_size;
28  break;
29  case 3:
30  packet_size_w = Muon::nsw::STGTPMMData::size_v3 / word_size;
31  break;
32  default:
33  packet_size_w = 0;
34  break;
35  }
36  return packet_size_w;
37 }

Member Data Documentation

◆ m_BCID

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

Definition at line 42 of file STGTPPackets.h.

◆ m_segmentData

std::array<MMSegmentData, STGTPMMData::num_mm> Muon::nsw::STGTPMMPacket::m_segmentData {}
private

Definition at line 41 of file STGTPPackets.h.


The documentation for this class was generated from the following files:
Muon::nsw::STGTPMMData::size_v3_padding
constexpr int size_v3_padding
Definition: NSWSTGTPDecodeBitmaps.h:90
Muon::nsw::STGTPMMData::size_output_mm_monitor
constexpr int size_output_mm_monitor
Definition: NSWSTGTPDecodeBitmaps.h:81
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::STGTPMMData::size_output_mm_dTheta
constexpr int size_output_mm_dTheta
Definition: NSWSTGTPDecodeBitmaps.h:85
Muon::nsw::STGTPMMData::size_v1
constexpr std::size_t size_v1
Definition: NSWSTGTPDecodeBitmaps.h:92
index
Definition: index.py:1
Muon::nsw::STGTPMMData::size_output_mm_phiRes
constexpr int size_output_mm_phiRes
Definition: NSWSTGTPDecodeBitmaps.h:84
Muon::nsw::STGTPMMData::size_output_mm_spare
constexpr int size_output_mm_spare
Definition: NSWSTGTPDecodeBitmaps.h:82
Muon::nsw::STGTPMMData::size_output_mm_phiID
constexpr int size_output_mm_phiID
Definition: NSWSTGTPDecodeBitmaps.h:86
Muon::nsw::STGTPMMData::size_v2
constexpr std::size_t size_v2
Definition: NSWSTGTPDecodeBitmaps.h:93
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::STGTPMMData::size_output_mm_lowRes
constexpr int size_output_mm_lowRes
Definition: NSWSTGTPDecodeBitmaps.h:83
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::nsw::STGTPMMData::num_mm
constexpr std::size_t num_mm
Definition: NSWSTGTPDecodeBitmaps.h:79
Muon::nsw::STGTPMMPacket::Size
size_t Size(const int ver)
Definition: STGTPPackets.cxx:19
Muon::nsw::format
std::string format(const std::string &str, const T &arg)
Definition: NSWDecodeHelper.h:43
Muon::nsw::STGTPMMData::size_v3
constexpr std::size_t size_v3
Definition: NSWSTGTPDecodeBitmaps.h:94
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
Muon::nsw::STGTPMMData::size_bcid
constexpr int size_bcid
Definition: NSWSTGTPDecodeBitmaps.h:89
Muon::nsw::STGTPMMPacket::m_BCID
std::uint32_t m_BCID
Definition: STGTPPackets.h:42
Muon::nsw::STGTPMMData::size_output_mm_rIndex
constexpr int size_output_mm_rIndex
Definition: NSWSTGTPDecodeBitmaps.h:87
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
Muon::nsw::STGTPMMPacket::m_segmentData
std::array< MMSegmentData, STGTPMMData::num_mm > m_segmentData
Definition: STGTPPackets.h:41