ATLAS Offline Software
Loading...
Searching...
No Matches
PadReadOutStructure Class Reference

#include <PadReadOutStructure.h>

Inheritance diagram for PadReadOutStructure:
Collaboration diagram for PadReadOutStructure:

Public Member Functions

 PadReadOutStructure ()
 PadReadOutStructure (ubit16 inputData)
 ~PadReadOutStructure ()=default
void setInit ()
ubit16 makeHeader (ubit16 *inputData)
ubit16 makeBody (ubit16 *inputData)
ubit16 makeSubHeader ()
ubit16 makeFooter (ubit16 errorCode)
ubit16 makeFooter (ubit16 *errorCode)
ubit16 decodeFragment (ubit16 inputWord, char &field)
ubit16 padid () const
ubit16 status () const
ubit16 errorCode () const
ubit16 l1id () const
ubit16 bcid () const
ubit16 fifoCM () const
ubit16 fifoOR () const
ubit16 fifoL1 () const
ubit16 fifoPAD () const
ubit16 errorSH () const
ubit16 errorL1 () const
ubit16 errorH () const
ubit16 errorCM () const
ubit16 errorCMID () const
bool isHeader ()
bool isBody ()
bool isFooter ()
bool isPreFooter ()
bool isSubHeader ()
ubit16 getWord () const
char field () const

Protected Member Functions

ubit16 set16Bits (const ubit16 n, const ubit16 *pos, const ubit16 *val) const
template<size_t n>
ubit16 set16Bits (const std::array< ubit16, n > &pos, const std::array< ubit16, n > &val) const
ubit16 get16Bits (const ubit16 input, const ubit16 position, const ubit16 length) const

Protected Attributes

ubit16 m_word {0xffff}
char m_field {0}

Static Protected Attributes

static constexpr ubit16 s_last2bitsON {0xc000}
static constexpr ubit16 s_last4bitsON {0xf000}
static constexpr ubit16 s_first8bitsON {0}

Private Attributes

ubit16 m_padid
ubit16 m_l1id
ubit16 m_bcid
ubit16 m_fifoCM
ubit16 m_fifoOR
ubit16 m_fifoL1
ubit16 m_fifoPAD
ubit16 m_status
ubit16 m_errorSH
ubit16 m_errorL1
ubit16 m_errorH
ubit16 m_errorCM
ubit16 m_errorCMID
ubit16 m_errorCode
MatrixReadOutStructure m_MRS
MatrixReadOut m_MR
ubit16m_vectorStruct

Static Private Attributes

static const ubit16 s_headerNum = 3
static const ubit16 s_headerPos [s_headerNum] = {12, 9, 0}
static const ubit16 s_headerLen [s_headerNum] = {4, 3, 9}
static const ubit16 s_headerVal = 0x0005
static const ubit16 s_subHeaderNum = 2
static const ubit16 s_subHeaderPos [s_subHeaderNum] = {12, 0}
static const ubit16 s_subHeaderLen [s_subHeaderNum] = {4, 12}
static const ubit16 s_subHeaderVal = 0x0006
static const ubit16 s_prefooterNum = 5
static const ubit16 s_prefooterPos [s_prefooterNum] = {12, 3, 2, 1, 0}
static const ubit16 s_prefooterLen [s_prefooterNum] = {4, 1, 1, 1, 1}
static const ubit16 s_prefooterVal = 0x000a
static const ubit16 s_footerNum = 6
static const ubit16 s_footerPos [s_footerNum] = {12, 11, 10, 9, 8, 0}
static const ubit16 s_footerLen [s_footerNum] = {4, 1, 1, 1, 1, 8}
static const ubit16 s_footerVal = 0x0007

Detailed Description

Definition at line 13 of file PadReadOutStructure.h.

Constructor & Destructor Documentation

◆ PadReadOutStructure() [1/2]

PadReadOutStructure::PadReadOutStructure ( )

Definition at line 33 of file PadReadOutStructure.cxx.

33 {
34 //
35 // Constructor used by the simulation program
36 //
37 m_padid = 0xffff;
38 m_l1id = 0xffff;
39 m_bcid = 0xffff;
40 m_fifoCM = 0xffff;
41 m_fifoOR = 0xffff;
42 m_fifoL1 = 0xffff;
43 m_fifoPAD = 0xffff;
44 m_status = 0xffff;
45 m_errorSH = 0xffff;
46 m_errorL1 = 0xffff;
47 m_errorH = 0xffff;
48 m_errorCM = 0xffff;
49 m_errorCMID = 0xffff;
50 m_errorCode = 0xffff;
52 setInit();
53}

◆ PadReadOutStructure() [2/2]

PadReadOutStructure::PadReadOutStructure ( ubit16 inputData)

Definition at line 55 of file PadReadOutStructure.cxx.

55 {
56 //
57 // Constructor used by the simulation program
58 //
60 decodeFragment(inputData, m_field);
61}
ubit16 decodeFragment(ubit16 inputWord, char &field)
char m_field
Definition RPCReadOut.h:28

◆ ~PadReadOutStructure()

PadReadOutStructure::~PadReadOutStructure ( )
default

Member Function Documentation

◆ bcid()

ubit16 PadReadOutStructure::bcid ( ) const
inline

Definition at line 36 of file PadReadOutStructure.h.

36{ return m_bcid; };

◆ decodeFragment()

ubit16 PadReadOutStructure::decodeFragment ( ubit16 inputWord,
char & field )

Definition at line 118 of file PadReadOutStructure.cxx.

118 {
119 // Removed last because it is not used
120 // bool last=false;
121 ubit16 errorCode = 0;
122 setInit();
123 m_word = inputWord;
124 errorCode = 0;
125 if (isHeader()) {
126 m_field = 'H';
127 m_padid = get16Bits(inputWord, s_headerPos[1], s_headerLen[1]);
128 m_l1id = get16Bits(inputWord, s_headerPos[2], s_headerLen[2]);
129 } else if (isSubHeader()) {
130 m_field = 'S';
131 m_bcid = get16Bits(inputWord, s_subHeaderPos[1], s_subHeaderLen[1]);
132 } else if (isPreFooter()) {
133 m_field = 'P';
134 m_fifoCM = get16Bits(inputWord, s_prefooterPos[1], s_prefooterLen[1]);
135 m_fifoOR = get16Bits(inputWord, s_prefooterPos[2], s_prefooterLen[2]);
136 m_fifoL1 = get16Bits(inputWord, s_prefooterPos[3], s_prefooterLen[3]);
138 m_status = inputWord & 0x0fff;
139 } else if (isFooter()) {
140 m_field = 'F';
141 m_errorSH = get16Bits(inputWord, s_footerPos[1], s_footerLen[1]);
142 m_errorL1 = get16Bits(inputWord, s_footerPos[2], s_footerLen[2]);
143 m_errorH = get16Bits(inputWord, s_footerPos[3], s_footerLen[3]);
144 m_errorCM = get16Bits(inputWord, s_footerPos[4], s_footerLen[4]);
145 m_errorCMID = get16Bits(inputWord, s_footerPos[5], s_footerLen[5]);
146 m_errorCode = inputWord & 0x0fff;
147 } else {
148 m_field = 'B';
149 if ((m_word & 0xf000) == (m_MRS.getFooterVal() << 12)) {
150 /* last=true; */
151 } else {
152 /* last=false; */
153 }
154 }
155 field = m_field;
156 return errorCode; // temporary: force return to 0
157}
unsigned short int ubit16
static const ubit16 s_prefooterLen[s_prefooterNum]
static const ubit16 s_subHeaderLen[s_subHeaderNum]
static const ubit16 s_footerLen[s_footerNum]
static const ubit16 s_prefooterPos[s_prefooterNum]
static const ubit16 s_footerPos[s_footerNum]
static const ubit16 s_subHeaderPos[s_subHeaderNum]
MatrixReadOutStructure m_MRS
static const ubit16 s_headerLen[s_headerNum]
static const ubit16 s_headerPos[s_headerNum]
char field() const
Definition RPCReadOut.h:19
ubit16 get16Bits(const ubit16 input, const ubit16 position, const ubit16 length) const
Definition RPCReadOut.h:47
ubit16 m_word
Definition RPCReadOut.h:27

◆ errorCM()

ubit16 PadReadOutStructure::errorCM ( ) const
inline

Definition at line 44 of file PadReadOutStructure.h.

44{ return m_errorCM; };

◆ errorCMID()

ubit16 PadReadOutStructure::errorCMID ( ) const
inline

Definition at line 45 of file PadReadOutStructure.h.

45{ return m_errorCMID; };

◆ errorCode()

ubit16 PadReadOutStructure::errorCode ( ) const
inline

Definition at line 34 of file PadReadOutStructure.h.

34{ return m_errorCode; };

◆ errorH()

ubit16 PadReadOutStructure::errorH ( ) const
inline

Definition at line 43 of file PadReadOutStructure.h.

43{ return m_errorH; };

◆ errorL1()

ubit16 PadReadOutStructure::errorL1 ( ) const
inline

Definition at line 42 of file PadReadOutStructure.h.

42{ return m_errorL1; };

◆ errorSH()

ubit16 PadReadOutStructure::errorSH ( ) const
inline

Definition at line 41 of file PadReadOutStructure.h.

41{ return m_errorSH; };

◆ field()

char RPCReadOut::field ( ) const
inlineinherited

Definition at line 19 of file RPCReadOut.h.

19{ return m_field; };

◆ fifoCM()

ubit16 PadReadOutStructure::fifoCM ( ) const
inline

Definition at line 37 of file PadReadOutStructure.h.

37{ return m_fifoCM; };

◆ fifoL1()

ubit16 PadReadOutStructure::fifoL1 ( ) const
inline

Definition at line 39 of file PadReadOutStructure.h.

39{ return m_fifoL1; };

◆ fifoOR()

ubit16 PadReadOutStructure::fifoOR ( ) const
inline

Definition at line 38 of file PadReadOutStructure.h.

38{ return m_fifoOR; };

◆ fifoPAD()

ubit16 PadReadOutStructure::fifoPAD ( ) const
inline

Definition at line 40 of file PadReadOutStructure.h.

40{ return m_fifoPAD; };

◆ get16Bits()

ubit16 RPCReadOut::get16Bits ( const ubit16 input,
const ubit16 position,
const ubit16 length ) const
inlineprotectedinherited

Definition at line 47 of file RPCReadOut.h.

47 {
48 ubit16 output = 0;
49 ubit16 CMfield = 0;
50 for (ubit16 i = 0; i < length; i++) { CMfield = CMfield | 1 << (position + i); }
51 output = (input & CMfield) >> position;
52 return output;
53 } // end-of-MatrixReadOutStructure::get16Bits
double length(const pvec &v)
output
Definition merge.py:16

◆ getWord()

ubit16 RPCReadOut::getWord ( ) const
inlineinherited

Definition at line 18 of file RPCReadOut.h.

18{ return m_word; };

◆ isBody()

bool PadReadOutStructure::isBody ( )

Definition at line 160 of file PadReadOutStructure.cxx.

160 {
161 ubit16 theword = (m_word & 0xf000) >> 12;
162 if ((theword != s_headerVal) && (theword != s_subHeaderVal) && (theword != s_prefooterVal) && (theword != s_footerVal)) return true;
163 return false;
164}
static const ubit16 s_subHeaderVal
static const ubit16 s_headerVal
static const ubit16 s_prefooterVal
static const ubit16 s_footerVal

◆ isFooter()

bool PadReadOutStructure::isFooter ( )

Definition at line 190 of file PadReadOutStructure.cxx.

190 {
191 bool status = false;
192 ubit16 theFooter[s_footerNum] = {s_footerVal};
193 if ((m_word & s_last4bitsON) == set16Bits(1, s_footerPos, theFooter)) status = true;
194 return status;
195}
static const ubit16 s_footerNum
static constexpr ubit16 s_last4bitsON
Definition RPCReadOut.h:56
ubit16 set16Bits(const ubit16 n, const ubit16 *pos, const ubit16 *val) const
Definition RPCReadOut.h:30

◆ isHeader()

bool PadReadOutStructure::isHeader ( )

Definition at line 166 of file PadReadOutStructure.cxx.

166 {
167 bool status = false;
168 ubit16 theHeader[s_headerNum] = {s_headerVal};
169 if ((m_word & s_last4bitsON) == set16Bits(1, s_headerPos, theHeader)) status = true;
170 return status;
171}
static const ubit16 s_headerNum

◆ isPreFooter()

bool PadReadOutStructure::isPreFooter ( )

Definition at line 182 of file PadReadOutStructure.cxx.

182 {
183 bool status = false;
184 ubit16 thepreFooter[s_prefooterNum] = {s_prefooterVal};
185 if ((m_word & s_last4bitsON) == set16Bits(1, s_prefooterPos, thepreFooter)) status = true;
186 return status;
187}
static const ubit16 s_prefooterNum

◆ isSubHeader()

bool PadReadOutStructure::isSubHeader ( )

Definition at line 174 of file PadReadOutStructure.cxx.

174 {
175 bool status = false;
176 ubit16 theSubHeader[s_subHeaderNum] = {s_subHeaderVal};
177 if ((m_word & s_last4bitsON) == set16Bits(1, s_subHeaderPos, theSubHeader)) status = true;
178 return status;
179}
static const ubit16 s_subHeaderNum

◆ l1id()

ubit16 PadReadOutStructure::l1id ( ) const
inline

Definition at line 35 of file PadReadOutStructure.h.

35{ return m_l1id; };

◆ makeBody()

ubit16 PadReadOutStructure::makeBody ( ubit16 * inputData)
inline

Definition at line 22 of file PadReadOutStructure.h.

22{ return *inputData; };

◆ makeFooter() [1/2]

ubit16 PadReadOutStructure::makeFooter ( ubit16 * errorCode)

Definition at line 103 of file PadReadOutStructure.cxx.

103 {
104 // m_errorCode= *inputData;
105 m_errorSH = *(inputData + 1);
106 m_errorL1 = *(inputData + 2);
107 m_errorH = *(inputData + 3);
108 m_errorCM = *(inputData + 4);
109 m_errorCMID = *(inputData + 5);
110 m_vectorStruct = inputData;
112 // ubit16 theFooter[s_footerNum]={s_footerVal};
113 // for(int i=1;i<5;i++) *(theFooter+i) = *(inputData+i);
115 return m_word;
116}

◆ makeFooter() [2/2]

ubit16 PadReadOutStructure::makeFooter ( ubit16 errorCode)
inline

Definition at line 25 of file PadReadOutStructure.h.

25{ return errorCode; };

◆ makeHeader()

ubit16 PadReadOutStructure::makeHeader ( ubit16 * inputData)

Definition at line 74 of file PadReadOutStructure.cxx.

74 {
75 // m_status = *(inputData+2);
76 m_padid = *(inputData + 1);
77 m_l1id = *(inputData + 2);
78 // ubit16 theHeader[s_headerNum] = *inputData;
79 //={s_headerVal,*(inputData+1),*(inputData+2)};
80 m_vectorStruct = inputData;
83 return m_word;
84}

◆ makeSubHeader()

ubit16 PadReadOutStructure::makeSubHeader ( )
inline

Definition at line 24 of file PadReadOutStructure.h.

24{ return 0; };

◆ padid()

ubit16 PadReadOutStructure::padid ( ) const
inline

Definition at line 32 of file PadReadOutStructure.h.

32{ return m_padid; };

◆ set16Bits() [1/2]

template<size_t n>
ubit16 RPCReadOut::set16Bits ( const std::array< ubit16, n > & pos,
const std::array< ubit16, n > & val ) const
inlineprotectedinherited

Definition at line 40 of file RPCReadOut.h.

40 {
41 ubit16 output = 0;
42 for (size_t i = 0; i < n; ++i) { output |= (val[i] << pos[i]); }
43 return output;
44 }

◆ set16Bits() [2/2]

ubit16 RPCReadOut::set16Bits ( const ubit16 n,
const ubit16 * pos,
const ubit16 * val ) const
inlineprotectedinherited

Definition at line 30 of file RPCReadOut.h.

30 {
31 ubit16 output = 0;
32 ubit16 p = 0, v = 0;
33 for (ubit16 i = 0; i < n; i++) {
34 v = *(val + i);
35 p = *(pos + i);
36 output = output | (v << p);
37 } // end-of-for
38 return output;
39 } // end-of-MatrixReadOutStructure::set16Bits

◆ setInit()

void PadReadOutStructure::setInit ( )

Definition at line 64 of file PadReadOutStructure.cxx.

64 {
65 m_field = 'U';
66 // m_word =0xffff;
67 // m_padid =0xffff;
68 // m_status =0xffff;
69 // m_errorCode =0xffff;
70}

◆ status()

ubit16 PadReadOutStructure::status ( ) const
inline

Definition at line 33 of file PadReadOutStructure.h.

33{ return m_status; };

Member Data Documentation

◆ m_bcid

ubit16 PadReadOutStructure::m_bcid
private

Definition at line 61 of file PadReadOutStructure.h.

◆ m_errorCM

ubit16 PadReadOutStructure::m_errorCM
private

Definition at line 74 of file PadReadOutStructure.h.

◆ m_errorCMID

ubit16 PadReadOutStructure::m_errorCMID
private

Definition at line 75 of file PadReadOutStructure.h.

◆ m_errorCode

ubit16 PadReadOutStructure::m_errorCode
private

Definition at line 76 of file PadReadOutStructure.h.

◆ m_errorH

ubit16 PadReadOutStructure::m_errorH
private

Definition at line 73 of file PadReadOutStructure.h.

◆ m_errorL1

ubit16 PadReadOutStructure::m_errorL1
private

Definition at line 72 of file PadReadOutStructure.h.

◆ m_errorSH

ubit16 PadReadOutStructure::m_errorSH
private

Definition at line 71 of file PadReadOutStructure.h.

◆ m_field

char RPCReadOut::m_field {0}
protectedinherited

Definition at line 28 of file RPCReadOut.h.

28{0};

◆ m_fifoCM

ubit16 PadReadOutStructure::m_fifoCM
private

Definition at line 64 of file PadReadOutStructure.h.

◆ m_fifoL1

ubit16 PadReadOutStructure::m_fifoL1
private

Definition at line 66 of file PadReadOutStructure.h.

◆ m_fifoOR

ubit16 PadReadOutStructure::m_fifoOR
private

Definition at line 65 of file PadReadOutStructure.h.

◆ m_fifoPAD

ubit16 PadReadOutStructure::m_fifoPAD
private

Definition at line 67 of file PadReadOutStructure.h.

◆ m_l1id

ubit16 PadReadOutStructure::m_l1id
private

Definition at line 59 of file PadReadOutStructure.h.

◆ m_MR

MatrixReadOut PadReadOutStructure::m_MR
private

Definition at line 81 of file PadReadOutStructure.h.

◆ m_MRS

MatrixReadOutStructure PadReadOutStructure::m_MRS
private

Definition at line 80 of file PadReadOutStructure.h.

◆ m_padid

ubit16 PadReadOutStructure::m_padid
private

Definition at line 58 of file PadReadOutStructure.h.

◆ m_status

ubit16 PadReadOutStructure::m_status
private

Definition at line 68 of file PadReadOutStructure.h.

◆ m_vectorStruct

ubit16* PadReadOutStructure::m_vectorStruct
private

Definition at line 105 of file PadReadOutStructure.h.

◆ m_word

ubit16 RPCReadOut::m_word {0xffff}
protectedinherited

Definition at line 27 of file RPCReadOut.h.

27{0xffff};

◆ s_first8bitsON

ubit16 RPCReadOut::s_first8bitsON {0}
staticconstexprprotectedinherited

Definition at line 57 of file RPCReadOut.h.

57{0};

◆ s_footerLen

const ubit16 PadReadOutStructure::s_footerLen = {4, 1, 1, 1, 1, 8}
staticprivate

Definition at line 28 of file PadReadOutStructure.h.

◆ s_footerNum

const ubit16 PadReadOutStructure::s_footerNum = 6
staticprivate

Definition at line 98 of file PadReadOutStructure.h.

◆ s_footerPos

const ubit16 PadReadOutStructure::s_footerPos = {12, 11, 10, 9, 8, 0}
staticprivate

Definition at line 26 of file PadReadOutStructure.h.

◆ s_footerVal

const ubit16 PadReadOutStructure::s_footerVal = 0x0007
staticprivate

Definition at line 101 of file PadReadOutStructure.h.

◆ s_headerLen

const ubit16 PadReadOutStructure::s_headerLen = {4, 3, 9}
staticprivate

Definition at line 14 of file PadReadOutStructure.h.

14:
15

◆ s_headerNum

const ubit16 PadReadOutStructure::s_headerNum = 3
staticprivate

Definition at line 86 of file PadReadOutStructure.h.

◆ s_headerPos

const ubit16 PadReadOutStructure::s_headerPos = {12, 9, 0}
staticprivate

Definition at line 12 of file PadReadOutStructure.h.

◆ s_headerVal

const ubit16 PadReadOutStructure::s_headerVal = 0x0005
staticprivate

Definition at line 89 of file PadReadOutStructure.h.

◆ s_last2bitsON

ubit16 RPCReadOut::s_last2bitsON {0xc000}
staticconstexprprotectedinherited

Definition at line 55 of file RPCReadOut.h.

55{0xc000};

◆ s_last4bitsON

ubit16 RPCReadOut::s_last4bitsON {0xf000}
staticconstexprprotectedinherited

Definition at line 56 of file RPCReadOut.h.

56{0xf000};

◆ s_prefooterLen

const ubit16 PadReadOutStructure::s_prefooterLen = {4, 1, 1, 1, 1}
staticprivate

Definition at line 23 of file PadReadOutStructure.h.

◆ s_prefooterNum

const ubit16 PadReadOutStructure::s_prefooterNum = 5
staticprivate

Definition at line 94 of file PadReadOutStructure.h.

◆ s_prefooterPos

const ubit16 PadReadOutStructure::s_prefooterPos = {12, 3, 2, 1, 0}
staticprivate

Definition at line 22 of file PadReadOutStructure.h.

22{ return *inputData; };

◆ s_prefooterVal

const ubit16 PadReadOutStructure::s_prefooterVal = 0x000a
staticprivate

Definition at line 97 of file PadReadOutStructure.h.

◆ s_subHeaderLen

const ubit16 PadReadOutStructure::s_subHeaderLen = {4, 12}
staticprivate

Definition at line 19 of file PadReadOutStructure.h.

◆ s_subHeaderNum

const ubit16 PadReadOutStructure::s_subHeaderNum = 2
staticprivate

Definition at line 90 of file PadReadOutStructure.h.

◆ s_subHeaderPos

const ubit16 PadReadOutStructure::s_subHeaderPos = {12, 0}
staticprivate

Definition at line 18 of file PadReadOutStructure.h.

◆ s_subHeaderVal

const ubit16 PadReadOutStructure::s_subHeaderVal = 0x0006
staticprivate

Definition at line 93 of file PadReadOutStructure.h.


The documentation for this class was generated from the following files: