ATLAS Offline Software
Loading...
Searching...
No Matches
RpcByteStreamEncoder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
9
11
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}
23
25
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}
44
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}
68
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}
84
86 unsigned int dataWord32 = (unsigned int)dataWord;
87 if (m_highest) {
88 m_byteStreamWord = (dataWord32 << 16);
89 m_highest = false;
90 } else {
94 m_highest = true;
95 }
96}
static Double_t sc
unsigned short int ubit16
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
ubit16 makeBody(ubit16 *inputData)
ubit16 makeHeader(ubit16 *inputData)
ubit16 makeFooter(ubit16 inputData)
ubit16 makeFooter(ubit16 errorCode)
ubit16 makeHeader(ubit16 *inputData)
void addMatrix(const RpcCoinMatrix *matrix)
void addFiredChannel(const RpcFiredChannel *firedChannel)
const RpcPadContainer * m_padContainer
void addPad(const RpcPad *pad)
void addWord(ubit16 dataWord)
RpcByteStreamEncoder(const RpcPadContainer *padContainer)
ubit16 bcid() const
ubit16 channel() const
ubit16 ijk() const
ubit16 time() const
Use IdentifiableContainer with RpcPad.
ubit16 onlineId() const
Definition RpcPad.h:107
ubit16 errorCode() const
Definition RpcPad.h:106
ubit16 status() const
Definition RpcPad.h:105