ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
LVL1BS::PpmByteStreamReadV1V2Tool::BitReader Class Reference
Collaboration diagram for LVL1BS::PpmByteStreamReadV1V2Tool::BitReader:

Public Member Functions

 BitReader (const std::vector< uint32_t > &ppBlock)
 
uint32_t getField (const uint8_t numBits)
 

Private Attributes

uint32_t m_ppPointer
 
uint32_t m_ppMaxBit
 
const std::vector< uint32_t > & m_ppBlock
 

Detailed Description

Definition at line 81 of file PpmByteStreamReadV1V2Tool.h.

Constructor & Destructor Documentation

◆ BitReader()

LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::BitReader ( const std::vector< uint32_t > &  ppBlock)
inline

Definition at line 84 of file PpmByteStreamReadV1V2Tool.h.

85  : m_ppPointer (0),
86  m_ppMaxBit (31 * ppBlock.size()),
87  m_ppBlock (ppBlock)
88  {
89  }

Member Function Documentation

◆ getField()

uint32_t LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::getField ( const uint8_t  numBits)

Definition at line 1091 of file PpmByteStreamReadV1V2Tool.cxx.

1093 {
1094  if ((m_ppPointer + numBits) <= m_ppMaxBit) {
1095  uint32_t iWord = m_ppPointer / 31;
1096  uint8_t iBit = m_ppPointer % 31;
1097  m_ppPointer += numBits;
1098 
1099  uint32_t result;
1100  if ((iBit + numBits) <= 31) {
1101  result = ::bitFieldSize(m_ppBlock[iWord], iBit, numBits);
1102  } else {
1103  uint8_t nb1 = 31 - iBit;
1104  uint8_t nb2 = numBits - nb1;
1105  uint32_t field1 = ::bitFieldSize(m_ppBlock[iWord], iBit, nb1);
1106  uint32_t field2 = ::bitFieldSize(m_ppBlock[iWord + 1], 0, nb2);
1107  result = field1 | (field2 << nb1);
1108  }
1109 
1110  return result;
1111  }
1112 
1113  throw std::out_of_range("Requested too much bits from ppm block");
1114 }

Member Data Documentation

◆ m_ppBlock

const std::vector<uint32_t>& LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::m_ppBlock
private

Definition at line 96 of file PpmByteStreamReadV1V2Tool.h.

◆ m_ppMaxBit

uint32_t LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::m_ppMaxBit
private

Definition at line 95 of file PpmByteStreamReadV1V2Tool.h.

◆ m_ppPointer

uint32_t LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::m_ppPointer
private

Definition at line 94 of file PpmByteStreamReadV1V2Tool.h.


The documentation for this class was generated from the following files:
get_generator_info.result
result
Definition: get_generator_info.py:21
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::m_ppPointer
uint32_t m_ppPointer
Definition: PpmByteStreamReadV1V2Tool.h:94
LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::m_ppMaxBit
uint32_t m_ppMaxBit
Definition: PpmByteStreamReadV1V2Tool.h:95
LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::m_ppBlock
const std::vector< uint32_t > & m_ppBlock
Definition: PpmByteStreamReadV1V2Tool.h:96