ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RpcByteStreamEncoder Class Reference

#include <RpcByteStreamEncoder.h>

Collaboration diagram for RpcByteStreamEncoder:

Public Member Functions

 RpcByteStreamEncoder (const RpcPadContainer *padContainer)
 
 ~RpcByteStreamEncoder ()
 
StatusCode encodeByteStream ()
 
RpcByteStreamgetByteStream ()
 

Private Member Functions

void addRx ()
 
void addPad (const RpcPad *pad)
 
void addMatrix (const RpcCoinMatrix *matrix)
 
void addFiredChannel (const RpcFiredChannel *firedChannel)
 
void addWord (ubit16 dataWord)
 

Private Attributes

const RpcPadContainerm_padContainer
 
RpcByteStreamm_byteStream
 
unsigned int m_byteStreamWord
 
bool m_highest
 

Detailed Description

Definition at line 25 of file RpcByteStreamEncoder.h.

Constructor & Destructor Documentation

◆ RpcByteStreamEncoder()

RpcByteStreamEncoder::RpcByteStreamEncoder ( const RpcPadContainer padContainer)

Definition at line 7 of file RpcByteStreamEncoder.cxx.

7  :
8  m_padContainer(padContainer), m_byteStream(), m_byteStreamWord(0), m_highest(true) {}

◆ ~RpcByteStreamEncoder()

RpcByteStreamEncoder::~RpcByteStreamEncoder ( )
default

Member Function Documentation

◆ addFiredChannel()

void RpcByteStreamEncoder::addFiredChannel ( const RpcFiredChannel firedChannel)
private

Definition at line 69 of file RpcByteStreamEncoder.cxx.

69  {
71  ubit16 dataWord;
72  ubit16 inputData[5];
73 
74  // Add the fired channel
75  inputData[0] = 0;
76  inputData[1] = firedChannel->bcid();
77  inputData[2] = firedChannel->time();
78  inputData[3] = firedChannel->ijk();
79  inputData[4] = firedChannel->channel();
80 
81  dataWord = mros.makeBody(inputData);
82  addWord(dataWord);
83 }

◆ addMatrix()

void RpcByteStreamEncoder::addMatrix ( const RpcCoinMatrix matrix)
private

Definition at line 45 of file RpcByteStreamEncoder.cxx.

45  {
47  ubit16 dataWord;
48 
49  // Add the matrix header
50  ubit16 inputData[3] = {0, matrix->onlineId(), matrix->fel1Id()};
51  dataWord = mros.makeHeader(inputData);
52  addWord(dataWord);
53 
54  // Add the matrix subheader
55  dataWord = mros.makeSubHeader();
56  addWord(dataWord);
57 
58  // Matrix Body
60  for (chan_it = matrix->begin(); chan_it != matrix->end(); ++chan_it) {
61  const RpcFiredChannel* newchan = (*chan_it);
62  addFiredChannel(newchan);
63  }
64  // Add the matrix footer
65  dataWord = mros.makeFooter(matrix->crc());
66  addWord(dataWord);
67 }

◆ addPad()

void RpcByteStreamEncoder::addPad ( const RpcPad pad)
private

Definition at line 26 of file RpcByteStreamEncoder.cxx.

26  {
27  // Add the pad header
29  ubit16 inputData[3] = {0, pad->onlineId(), pad->status()};
30  ubit16 padHeader = pros.makeHeader(inputData);
31  addWord(padHeader);
32 
33  // Iterate on the matrices and add them to the bytestream
35  for (cma_it = pad->begin(); cma_it != pad->end(); ++cma_it) {
36  const RpcCoinMatrix* newcma = (*cma_it);
37  addMatrix(newcma);
38  }
39  // Add the pad footer
40  ubit16 errorCode = pad->errorCode();
41  ubit16 padFooter = pros.makeFooter(errorCode);
42  addWord(padFooter);
43 }

◆ addRx()

void RpcByteStreamEncoder::addRx ( )
private

Definition at line 24 of file RpcByteStreamEncoder.cxx.

24 {}

◆ addWord()

void RpcByteStreamEncoder::addWord ( ubit16  dataWord)
private

Definition at line 85 of file RpcByteStreamEncoder.cxx.

85  {
86  unsigned int dataWord32 = (unsigned int)dataWord;
87  if (m_highest) {
88  m_byteStreamWord = (dataWord32 << 16);
89  m_highest = false;
90  } else {
91  m_byteStreamWord = m_byteStreamWord | dataWord32;
92  m_byteStream->push_back(m_byteStreamWord);
93  m_byteStreamWord = 0;
94  m_highest = true;
95  }
96 }

◆ encodeByteStream()

StatusCode RpcByteStreamEncoder::encodeByteStream ( )

Definition at line 12 of file RpcByteStreamEncoder.cxx.

12  {
13  StatusCode sc;
14  // Iterate on the pads and add them to the bytestream
16  for (pad_it = m_padContainer->begin(); pad_it != m_padContainer->end(); ++pad_it) {
17  const RpcPad* newpad = (*pad_it);
18  addPad(newpad);
19  sc = StatusCode::SUCCESS;
20  }
21  return sc;
22 }

◆ getByteStream()

RpcByteStream* RpcByteStreamEncoder::getByteStream ( )
inline

Definition at line 33 of file RpcByteStreamEncoder.h.

33 { return m_byteStream; };

Member Data Documentation

◆ m_byteStream

RpcByteStream* RpcByteStreamEncoder::m_byteStream
private

Definition at line 47 of file RpcByteStreamEncoder.h.

◆ m_byteStreamWord

unsigned int RpcByteStreamEncoder::m_byteStreamWord
private

Definition at line 48 of file RpcByteStreamEncoder.h.

◆ m_highest

bool RpcByteStreamEncoder::m_highest
private

Definition at line 49 of file RpcByteStreamEncoder.h.

◆ m_padContainer

const RpcPadContainer* RpcByteStreamEncoder::m_padContainer
private

Definition at line 46 of file RpcByteStreamEncoder.h.


The documentation for this class was generated from the following files:
MatrixReadOutStructure::makeBody
ubit16 makeBody(ubit16 *inputData)
Definition: MatrixReadOutStructure.cxx:83
RpcByteStreamEncoder::m_highest
bool m_highest
Definition: RpcByteStreamEncoder.h:49
RpcFiredChannel::ijk
ubit16 ijk() const
Definition: RpcFiredChannel.h:56
RpcFiredChannel::time
ubit16 time() const
Definition: RpcFiredChannel.h:54
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
MatrixReadOutStructure::makeSubHeader
ubit16 makeSubHeader()
Definition: MatrixReadOutStructure.cxx:76
PadReadOutStructure::makeHeader
ubit16 makeHeader(ubit16 *inputData)
Definition: PadReadOutStructure.cxx:74
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
RpcFiredChannel::channel
ubit16 channel() const
Definition: RpcFiredChannel.h:58
PadReadOutStructure
Definition: PadReadOutStructure.h:13
RpcByteStreamEncoder::m_byteStreamWord
unsigned int m_byteStreamWord
Definition: RpcByteStreamEncoder.h:48
RpcByteStreamEncoder::addPad
void addPad(const RpcPad *pad)
Definition: RpcByteStreamEncoder.cxx:26
RpcPad::status
ubit16 status() const
Definition: RpcPad.h:105
RpcCoinMatrix
Definition: RpcCoinMatrix.h:20
RpcFiredChannel
Definition: RpcFiredChannel.h:20
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
RpcByteStreamEncoder::addWord
void addWord(ubit16 dataWord)
Definition: RpcByteStreamEncoder.cxx:85
RpcPad::errorCode
ubit16 errorCode() const
Definition: RpcPad.h:106
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PadReadOutStructure::makeFooter
ubit16 makeFooter(ubit16 errorCode)
Definition: PadReadOutStructure.h:25
MatrixReadOutStructure::makeFooter
ubit16 makeFooter(ubit16 inputData)
Definition: MatrixReadOutStructure.cxx:100
RpcByteStreamEncoder::m_padContainer
const RpcPadContainer * m_padContainer
Definition: RpcByteStreamEncoder.h:46
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:239
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:79
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:233
RpcPad::onlineId
ubit16 onlineId() const
Definition: RpcPad.h:107
RpcByteStreamEncoder::addFiredChannel
void addFiredChannel(const RpcFiredChannel *firedChannel)
Definition: RpcByteStreamEncoder.cxx:69
MatrixReadOutStructure::makeHeader
ubit16 makeHeader(ubit16 *inputData)
Definition: MatrixReadOutStructure.cxx:68
MatrixReadOutStructure
Definition: MatrixReadOutStructure.h:13
RpcPad
Definition: RpcPad.h:21
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
RpcFiredChannel::bcid
ubit16 bcid() const
Definition: RpcFiredChannel.h:52
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
RpcByteStreamEncoder::m_byteStream
RpcByteStream * m_byteStream
Definition: RpcByteStreamEncoder.h:47
RpcByteStreamEncoder::addMatrix
void addMatrix(const RpcCoinMatrix *matrix)
Definition: RpcByteStreamEncoder.cxx:45
ubit16
unsigned short int ubit16
Definition: RpcByteStreamEncoder.h:20
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.