ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | Static Private Attributes | List of all members
SectorLogicReadOutStructure Class Reference

#include <SectorLogicReadOutStructure.h>

Inheritance diagram for SectorLogicReadOutStructure:
Collaboration diagram for SectorLogicReadOutStructure:

Public Member Functions

 SectorLogicReadOutStructure ()
 
 SectorLogicReadOutStructure (ubit16 inputData)
 
 ~SectorLogicReadOutStructure ()=default
 
void setInit ()
 
ubit16 makeHeader (ubit16 *inputData)
 
ubit16 makeSubHeader ()
 
ubit16 makeBody (ubit16 *inputData)
 
ubit16 makeFooter (ubit16 errorCode)
 
ubit16 makeFooter (ubit16 *errorCode)
 
ubit16 decodeFragment (ubit16 inputWord, char &field)
 
bool isHeader ()
 
bool isBody ()
 
bool isFooter ()
 
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_secid {0}
 
ubit16 m_footer {0}
 

Static Private Attributes

static constexpr ubit16 s_headerNum = 2
 
static constexpr std::array< ubit16, s_headerNums_headerPos {12, 0}
 
static constexpr std::array< ubit16, s_headerNums_headerLen {4, 12}
 
static constexpr ubit16 s_headerVal = 0x000d
 
static constexpr ubit16 s_footerNum = 2
 
static constexpr std::array< ubit16, s_footerNums_footerPos {12, 0}
 
static constexpr std::array< ubit16, s_footerNums_footerLen {4, 12}
 
static constexpr ubit16 s_footerVal = 0x000f
 

Detailed Description

Definition at line 11 of file SectorLogicReadOutStructure.h.

Constructor & Destructor Documentation

◆ SectorLogicReadOutStructure() [1/2]

SectorLogicReadOutStructure::SectorLogicReadOutStructure ( )

Definition at line 12 of file SectorLogicReadOutStructure.cxx.

12  {
13  //
14  // Constructor used by the simulation program
15  //
16  setInit();
17 }

◆ SectorLogicReadOutStructure() [2/2]

SectorLogicReadOutStructure::SectorLogicReadOutStructure ( ubit16  inputData)

Definition at line 19 of file SectorLogicReadOutStructure.cxx.

19  {
20  //
21  // Constructor used by the simulation program
22  //
23  decodeFragment(inputData, m_field);
24 }

◆ ~SectorLogicReadOutStructure()

SectorLogicReadOutStructure::~SectorLogicReadOutStructure ( )
default

Member Function Documentation

◆ decodeFragment()

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

Definition at line 39 of file SectorLogicReadOutStructure.cxx.

39  {
40  // bool last=false;
41  // Remove errorCode because it is not used
42  // ubit16 errorCode=0;
43  setInit();
44  m_word = inputWord;
45  // errorCode=0;
46  if (isHeader()) {
47  m_field = 'H';
48  m_secid = get16Bits(inputWord, s_headerPos[1], s_headerLen[1]);
49  } else if (isFooter()) {
50  m_field = 'F';
51  m_footer = get16Bits(inputWord, s_footerPos[1], s_footerLen[1]);
52  } else {
53  m_field = 'B';
54  }
55  field = m_field;
56  return 0; // temporary: force return to 0
57 }

◆ field()

char RPCReadOut::field ( ) const
inlineinherited

Definition at line 19 of file RPCReadOut.h.

19 { return m_field; };

◆ 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

◆ getWord()

ubit16 RPCReadOut::getWord ( ) const
inlineinherited

Definition at line 18 of file RPCReadOut.h.

18 { return m_word; };

◆ isBody()

bool SectorLogicReadOutStructure::isBody ( )

Definition at line 60 of file SectorLogicReadOutStructure.cxx.

60  {
61  ubit16 theword = (m_word & 0xf000) >> 12;
62  if ((theword != s_headerVal) && (theword != s_footerVal)) return true;
63  return false;
64 }

◆ isFooter()

bool SectorLogicReadOutStructure::isFooter ( )

Definition at line 74 of file SectorLogicReadOutStructure.cxx.

74  {
75  bool status = false;
76  ubit16 theFooter[s_footerNum] = {s_footerVal};
77  if ((m_word & s_last4bitsON) == set16Bits(1, s_footerPos.data(), theFooter)) status = true;
78  return status;
79 }

◆ isHeader()

bool SectorLogicReadOutStructure::isHeader ( )

Definition at line 66 of file SectorLogicReadOutStructure.cxx.

66  {
67  bool status = false;
68  ubit16 theHeader[s_headerNum] = {s_headerVal};
69  if ((m_word & s_last4bitsON) == set16Bits(1, s_headerPos.data(), theHeader)) status = true;
70  return status;
71 }

◆ makeBody()

ubit16 SectorLogicReadOutStructure::makeBody ( ubit16 inputData)
inline

Definition at line 21 of file SectorLogicReadOutStructure.h.

21 { return (*inputData) & 0x0; };

◆ makeFooter() [1/2]

ubit16 SectorLogicReadOutStructure::makeFooter ( ubit16 errorCode)

Definition at line 34 of file SectorLogicReadOutStructure.cxx.

34  {
35  m_word = set16Bits(s_footerNum, s_footerPos.data(), inputData);
36  return m_word;
37 }

◆ makeFooter() [2/2]

ubit16 SectorLogicReadOutStructure::makeFooter ( ubit16  errorCode)
inline

Definition at line 22 of file SectorLogicReadOutStructure.h.

22 { return errorCode & 0x0; };

◆ makeHeader()

ubit16 SectorLogicReadOutStructure::makeHeader ( ubit16 inputData)

Definition at line 29 of file SectorLogicReadOutStructure.cxx.

29  {
30  m_word = set16Bits(s_headerNum, s_headerPos.data(), inputData); // theHeader);
31  return m_word;
32 }

◆ makeSubHeader()

ubit16 SectorLogicReadOutStructure::makeSubHeader ( )
inline

Definition at line 20 of file SectorLogicReadOutStructure.h.

20 { return 0; };

◆ 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 SectorLogicReadOutStructure::setInit ( )

Definition at line 26 of file SectorLogicReadOutStructure.cxx.

26 { m_field = 'U'; }

Member Data Documentation

◆ m_field

char RPCReadOut::m_field {0}
protectedinherited

Definition at line 28 of file RPCReadOut.h.

◆ m_footer

ubit16 SectorLogicReadOutStructure::m_footer {0}
private

Definition at line 39 of file SectorLogicReadOutStructure.h.

◆ m_secid

ubit16 SectorLogicReadOutStructure::m_secid {0}
private

Definition at line 37 of file SectorLogicReadOutStructure.h.

◆ m_word

ubit16 RPCReadOut::m_word {0xffff}
protectedinherited

Definition at line 27 of file RPCReadOut.h.

◆ s_first8bitsON

constexpr ubit16 RPCReadOut::s_first8bitsON {0}
staticconstexprprotectedinherited

Definition at line 57 of file RPCReadOut.h.

◆ s_footerLen

constexpr std::array<ubit16, s_footerNum> SectorLogicReadOutStructure::s_footerLen {4, 12}
staticconstexprprivate

Definition at line 54 of file SectorLogicReadOutStructure.h.

◆ s_footerNum

constexpr ubit16 SectorLogicReadOutStructure::s_footerNum = 2
staticconstexprprivate

Definition at line 52 of file SectorLogicReadOutStructure.h.

◆ s_footerPos

constexpr std::array<ubit16, s_footerNum> SectorLogicReadOutStructure::s_footerPos {12, 0}
staticconstexprprivate

Definition at line 53 of file SectorLogicReadOutStructure.h.

◆ s_footerVal

constexpr ubit16 SectorLogicReadOutStructure::s_footerVal = 0x000f
staticconstexprprivate

Definition at line 55 of file SectorLogicReadOutStructure.h.

◆ s_headerLen

constexpr std::array<ubit16, s_headerNum> SectorLogicReadOutStructure::s_headerLen {4, 12}
staticconstexprprivate

Definition at line 49 of file SectorLogicReadOutStructure.h.

◆ s_headerNum

constexpr ubit16 SectorLogicReadOutStructure::s_headerNum = 2
staticconstexprprivate

Definition at line 47 of file SectorLogicReadOutStructure.h.

◆ s_headerPos

constexpr std::array<ubit16, s_headerNum> SectorLogicReadOutStructure::s_headerPos {12, 0}
staticconstexprprivate

Definition at line 48 of file SectorLogicReadOutStructure.h.

◆ s_headerVal

constexpr ubit16 SectorLogicReadOutStructure::s_headerVal = 0x000d
staticconstexprprivate

Definition at line 50 of file SectorLogicReadOutStructure.h.

◆ s_last2bitsON

constexpr ubit16 RPCReadOut::s_last2bitsON {0xc000}
staticconstexprprotectedinherited

Definition at line 55 of file RPCReadOut.h.

◆ s_last4bitsON

constexpr ubit16 RPCReadOut::s_last4bitsON {0xf000}
staticconstexprprotectedinherited

Definition at line 56 of file RPCReadOut.h.


The documentation for this class was generated from the following files:
SectorLogicReadOutStructure::decodeFragment
ubit16 decodeFragment(ubit16 inputWord, char &field)
Definition: SectorLogicReadOutStructure.cxx:39
RPCReadOut::s_last4bitsON
static constexpr ubit16 s_last4bitsON
Definition: RPCReadOut.h:56
SectorLogicReadOutStructure::setInit
void setInit()
Definition: SectorLogicReadOutStructure.cxx:26
SectorLogicReadOutStructure::s_headerLen
static constexpr std::array< ubit16, s_headerNum > s_headerLen
Definition: SectorLogicReadOutStructure.h:49
SectorLogicReadOutStructure::m_footer
ubit16 m_footer
Definition: SectorLogicReadOutStructure.h:39
RPCReadOut::get16Bits
ubit16 get16Bits(const ubit16 input, const ubit16 position, const ubit16 length) const
Definition: RPCReadOut.h:47
SectorLogicReadOutStructure::isFooter
bool isFooter()
Definition: SectorLogicReadOutStructure.cxx:74
SectorLogicReadOutStructure::s_footerNum
static constexpr ubit16 s_footerNum
Definition: SectorLogicReadOutStructure.h:52
SectorLogicReadOutStructure::s_headerVal
static constexpr ubit16 s_headerVal
Definition: SectorLogicReadOutStructure.h:50
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
SectorLogicReadOutStructure::isHeader
bool isHeader()
Definition: SectorLogicReadOutStructure.cxx:66
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
SectorLogicReadOutStructure::s_headerNum
static constexpr ubit16 s_headerNum
Definition: SectorLogicReadOutStructure.h:47
SectorLogicReadOutStructure::s_footerPos
static constexpr std::array< ubit16, s_footerNum > s_footerPos
Definition: SectorLogicReadOutStructure.h:53
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
RPCReadOut::m_field
char m_field
Definition: RPCReadOut.h:28
RPCReadOut::field
char field() const
Definition: RPCReadOut.h:19
SectorLogicReadOutStructure::m_secid
ubit16 m_secid
Definition: SectorLogicReadOutStructure.h:37
merge.output
output
Definition: merge.py:17
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.PyAthena.v
v
Definition: PyAthena.py:154
RPCReadOut::set16Bits
ubit16 set16Bits(const ubit16 n, const ubit16 *pos, const ubit16 *val) const
Definition: RPCReadOut.h:30
SectorLogicReadOutStructure::s_footerLen
static constexpr std::array< ubit16, s_footerNum > s_footerLen
Definition: SectorLogicReadOutStructure.h:54
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
merge.status
status
Definition: merge.py:17
SectorLogicReadOutStructure::s_headerPos
static constexpr std::array< ubit16, s_headerNum > s_headerPos
Definition: SectorLogicReadOutStructure.h:48
ubit16
unsigned short int ubit16
Definition: RpcByteStreamEncoder.h:20
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
SectorLogicReadOutStructure::s_footerVal
static constexpr ubit16 s_footerVal
Definition: SectorLogicReadOutStructure.h:55
RPCReadOut::m_word
ubit16 m_word
Definition: RPCReadOut.h:27