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

#include <MdtCsmReadOut.h>

Inheritance diagram for MdtCsmReadOut:
Collaboration diagram for MdtCsmReadOut:

Public Member Functions

 MdtCsmReadOut ()
 
 ~MdtCsmReadOut ()=default
 
void decodeWord (uint32_t dataWord)
 
bool is_BOB () const
 
bool is_LWC () const
 
bool is_BOL () const
 
bool is_TLP () const
 
bool is_TWC () const
 
bool is_EOB () const
 
uint32_t lvl1Id () const
 
uint32_t clwc () const
 
uint16_t ftyp () const
 
uint32_t flags () const
 
uint16_t ecnt () const
 
uint16_t ctwc () const
 
uint16_t mrodId () const
 
uint16_t csmId () const
 
uint32_t makeBOB (uint32_t lvl1Id)
 
uint32_t makeLWC (uint32_t clwc)
 
uint32_t makeBOL (uint16_t mrodId, uint16_t csmId)
 
uint32_t makeTLP (uint32_t flags)
 
uint32_t makeTWC (uint16_t ecnt, uint16_t ctwc)
 
uint32_t makeEOB (uint32_t wcnt)
 

Protected Member Functions

constexpr std::pair< uint32_t, uint16_t > getBitsWord (const uint16_t bstart, const uint16_t bstop)
 
uint32_t getBits (std::pair< uint32_t, uint16_t > wordbstop) const
 

Static Protected Member Functions

static uint32_t setBits (uint16_t nData, const uint16_t *inputData, const uint16_t *inputPos)
 
static uint32_t setBits (uint16_t nData, const uint32_t *inputData, const uint16_t *inputPos)
 

Protected Attributes

uint32_t m_word
 

Private Member Functions

void setZero ()
 

Private Attributes

uint32_t m_dataWord
 
uint16_t m_wordHeader
 
uint32_t m_lvl1Id
 
uint32_t m_clwc
 
uint16_t m_ftyp
 
uint32_t m_flags
 
uint16_t m_ecnt
 
uint16_t m_ctwc
 
uint16_t m_mrodId
 
uint16_t m_csmId
 
bool m_error
 
bool m_zeroSupp
 

Static Private Attributes

static constexpr uint16_t s_headerPos = 24
 
static constexpr uint16_t s_headerBits = 0xff
 
static constexpr uint16_t s_BOBvalue = 0x80
 
static constexpr uint16_t s_LWCvalue = 0x81
 
static constexpr uint16_t s_BOLvalue = 0x18
 
static constexpr uint16_t s_TLPvalue = 0x89
 
static constexpr uint16_t s_TWCvalue = 0x8a
 
static constexpr uint16_t s_EOBvalue = 0xf0
 

Detailed Description

Definition at line 15 of file MdtCsmReadOut.h.

Constructor & Destructor Documentation

◆ MdtCsmReadOut()

MdtCsmReadOut::MdtCsmReadOut ( )

Definition at line 12 of file MdtCsmReadOut.cxx.

12  :
13  m_dataWord(0),
14  m_wordHeader(0),
15  m_lvl1Id(0),
16  m_clwc(0),
17  m_ftyp(0),
18  m_flags(0),
19  m_ecnt(0),
20  m_ctwc(0),
21  m_mrodId(0),
22  m_csmId(0),
23  m_error(0),
24  m_zeroSupp(0) {}

◆ ~MdtCsmReadOut()

MdtCsmReadOut::~MdtCsmReadOut ( )
default

Member Function Documentation

◆ clwc()

uint32_t MdtCsmReadOut::clwc ( ) const
inline

Definition at line 68 of file MdtCsmReadOut.h.

68 { return m_clwc; }

◆ csmId()

uint16_t MdtCsmReadOut::csmId ( ) const
inline

Definition at line 74 of file MdtCsmReadOut.h.

74 { return m_csmId; }

◆ ctwc()

uint16_t MdtCsmReadOut::ctwc ( ) const
inline

Definition at line 72 of file MdtCsmReadOut.h.

72 { return m_ctwc; }

◆ decodeWord()

void MdtCsmReadOut::decodeWord ( uint32_t  dataWord)

Definition at line 26 of file MdtCsmReadOut.cxx.

26  {
27  setZero();
28 
29  m_dataWord = dataWord;
30  m_word = dataWord;
31  m_wordHeader = (dataWord >> s_headerPos) & s_headerBits;
32 
33  if (is_BOB()) {
34  m_lvl1Id = getBits(getBitsWord(23, 0));
35  } else if (is_LWC()) {
36  m_ftyp = getBits(getBitsWord(23, 20));
37  m_clwc = getBits(getBitsWord(19, 0));
38  } else if (is_BOL()) {
39  m_error = (bool)getBits(getBitsWord(20, 20));
40  m_zeroSupp = (bool)getBits(getBitsWord(16, 16));
41  m_mrodId = getBits(getBitsWord(15, 4));
42  m_csmId = getBits(getBitsWord(3, 0));
43  } else if (is_TLP()) {
44  m_flags = getBits(getBitsWord(17, 0));
45  } else if (is_TWC()) {
46  m_ecnt = getBits(getBitsWord(23, 12));
47  m_ctwc = getBits(getBitsWord(11, 0));
48  }
49 }

◆ ecnt()

uint16_t MdtCsmReadOut::ecnt ( ) const
inline

Definition at line 71 of file MdtCsmReadOut.h.

71 { return m_ecnt; }

◆ flags()

uint32_t MdtCsmReadOut::flags ( ) const
inline

Definition at line 70 of file MdtCsmReadOut.h.

70 { return m_flags; }

◆ ftyp()

uint16_t MdtCsmReadOut::ftyp ( ) const
inline

Definition at line 69 of file MdtCsmReadOut.h.

69 { return m_ftyp; }

◆ getBits()

uint32_t MdtReadOut::getBits ( std::pair< uint32_t, uint16_t >  wordbstop) const
inlineprotectedinherited

Definition at line 27 of file MdtReadOut.h.

27  {
28  uint32_t result = (m_word >> wordbstop.second) & (wordbstop.first | 1);
29  return result;
30  }

◆ getBitsWord()

constexpr std::pair<uint32_t, uint16_t> MdtReadOut::getBitsWord ( const uint16_t  bstart,
const uint16_t  bstop 
)
inlineconstexprprotectedinherited

Definition at line 20 of file MdtReadOut.h.

20  {
21  uint32_t word = 0;
22  for (uint16_t i = bstop; i < bstart; i++) word = ((word | 1) << 1);
23  return std::make_pair(word, bstop);
24  }

◆ is_BOB()

bool MdtCsmReadOut::is_BOB ( ) const
inline

Definition at line 59 of file MdtCsmReadOut.h.

59 { return m_wordHeader == s_BOBvalue; };

◆ is_BOL()

bool MdtCsmReadOut::is_BOL ( ) const
inline

Definition at line 61 of file MdtCsmReadOut.h.

61 { return m_wordHeader == s_BOLvalue; };

◆ is_EOB()

bool MdtCsmReadOut::is_EOB ( ) const
inline

Definition at line 64 of file MdtCsmReadOut.h.

64 { return m_wordHeader == s_EOBvalue; };

◆ is_LWC()

bool MdtCsmReadOut::is_LWC ( ) const
inline

Definition at line 60 of file MdtCsmReadOut.h.

60 { return m_wordHeader == s_LWCvalue; };

◆ is_TLP()

bool MdtCsmReadOut::is_TLP ( ) const
inline

Definition at line 62 of file MdtCsmReadOut.h.

62 { return m_wordHeader == s_TLPvalue; };

◆ is_TWC()

bool MdtCsmReadOut::is_TWC ( ) const
inline

Definition at line 63 of file MdtCsmReadOut.h.

63 { return m_wordHeader == s_TWCvalue; };

◆ lvl1Id()

uint32_t MdtCsmReadOut::lvl1Id ( ) const
inline

Definition at line 67 of file MdtCsmReadOut.h.

67 { return m_lvl1Id; }

◆ makeBOB()

uint32_t MdtCsmReadOut::makeBOB ( uint32_t  lvl1Id)

Definition at line 51 of file MdtCsmReadOut.cxx.

51  {
52  uint16_t nData = 2;
53  uint32_t inputData[2] = {s_BOBvalue, lvl1Id};
54  uint16_t inputPos[2] = {s_headerPos, 0};
55 
56  return setBits(nData, inputData, inputPos);
57 }

◆ makeBOL()

uint32_t MdtCsmReadOut::makeBOL ( uint16_t  mrodId,
uint16_t  csmId 
)

Definition at line 67 of file MdtCsmReadOut.cxx.

67  {
68  uint16_t nData = 5;
69  // Error and Zero-suppression bits are by now set to 0 (no error)
70  // and 1 (Zero-suppression activated)
71  uint32_t inputData[5] = {s_BOLvalue, 0, 1, mrodId, csmId};
72  uint16_t inputPos[5] = {s_headerPos, 20, 16, 4, 0};
73 
74  return setBits(nData, inputData, inputPos);
75 }

◆ makeEOB()

uint32_t MdtCsmReadOut::makeEOB ( uint32_t  wcnt)

Definition at line 93 of file MdtCsmReadOut.cxx.

93  {
94  uint16_t nData = 2;
95  uint32_t inputData[2] = {s_EOBvalue, wcnt};
96  uint16_t inputPos[2] = {s_headerPos, 0};
97 
98  return setBits(nData, inputData, inputPos);
99 }

◆ makeLWC()

uint32_t MdtCsmReadOut::makeLWC ( uint32_t  clwc)

Definition at line 59 of file MdtCsmReadOut.cxx.

59  {
60  uint16_t nData = 3;
61  uint32_t inputData[3] = {s_LWCvalue, 0, clwc};
62  uint16_t inputPos[3] = {s_headerPos, 20, 0};
63 
64  return setBits(nData, inputData, inputPos);
65 }

◆ makeTLP()

uint32_t MdtCsmReadOut::makeTLP ( uint32_t  flags)

Definition at line 77 of file MdtCsmReadOut.cxx.

77  {
78  uint16_t nData = 4;
79  uint32_t inputData[4] = {s_TLPvalue, 0, 0, flags};
80  uint16_t inputPos[4] = {s_headerPos, 20, 18, 0};
81 
82  return setBits(nData, inputData, inputPos);
83 }

◆ makeTWC()

uint32_t MdtCsmReadOut::makeTWC ( uint16_t  ecnt,
uint16_t  ctwc 
)

Definition at line 85 of file MdtCsmReadOut.cxx.

85  {
86  uint16_t nData = 3;
87  uint16_t inputData[3] = {s_TWCvalue, ecnt, ctwc};
88  uint16_t inputPos[3] = {s_headerPos, 12, 0};
89 
90  return setBits(nData, inputData, inputPos);
91 }

◆ mrodId()

uint16_t MdtCsmReadOut::mrodId ( ) const
inline

Definition at line 73 of file MdtCsmReadOut.h.

73 { return m_mrodId; }

◆ setBits() [1/2]

uint32_t MdtReadOut::setBits ( uint16_t  nData,
const uint16_t *  inputData,
const uint16_t *  inputPos 
)
staticprotectedinherited

Definition at line 14 of file MdtReadOut.cxx.

14  {
15  uint32_t result = 0;
16  uint32_t input = 0;
17  uint16_t pos = 0;
18  for (uint16_t i = 0; i < nData; i++) {
19  input = *(inputData + i);
20  pos = *(inputPos + i);
21  result = result | (input << pos);
22  }
23  return result;
24 }

◆ setBits() [2/2]

uint32_t MdtReadOut::setBits ( uint16_t  nData,
const uint32_t *  inputData,
const uint16_t *  inputPos 
)
staticprotectedinherited

Definition at line 27 of file MdtReadOut.cxx.

27  {
28  uint32_t result = 0;
29  uint32_t input = 0;
30  uint16_t pos = 0;
31  for (uint16_t i = 0; i < nData; i++) {
32  input = *(inputData + i);
33  pos = *(inputPos + i);
34  result = result | (input << pos);
35  }
36  return result;
37 }

◆ setZero()

void MdtCsmReadOut::setZero ( )
private

Definition at line 101 of file MdtCsmReadOut.cxx.

101  {
102  m_lvl1Id = 0; // Lvl1 Id
103  m_clwc = 0; // Link word count
104  m_ftyp = 0; // flag type
105  m_flags = 0; // flags
106 
107  m_ecnt = 0; // Event counter
108  m_ctwc = 0; // Trailer word count
109 
110  m_mrodId = 0; // MROD number
111  m_csmId = 0; // CSM Link number
112  m_error = false; // Error flag
113  m_zeroSupp = false; // TDC zero-suppressed flag
114 }

Member Data Documentation

◆ m_clwc

uint32_t MdtCsmReadOut::m_clwc
private

Definition at line 23 of file MdtCsmReadOut.h.

◆ m_csmId

uint16_t MdtCsmReadOut::m_csmId
private

Definition at line 31 of file MdtCsmReadOut.h.

◆ m_ctwc

uint16_t MdtCsmReadOut::m_ctwc
private

Definition at line 28 of file MdtCsmReadOut.h.

◆ m_dataWord

uint32_t MdtCsmReadOut::m_dataWord
private

Definition at line 18 of file MdtCsmReadOut.h.

◆ m_ecnt

uint16_t MdtCsmReadOut::m_ecnt
private

Definition at line 27 of file MdtCsmReadOut.h.

◆ m_error

bool MdtCsmReadOut::m_error
private

Definition at line 32 of file MdtCsmReadOut.h.

◆ m_flags

uint32_t MdtCsmReadOut::m_flags
private

Definition at line 25 of file MdtCsmReadOut.h.

◆ m_ftyp

uint16_t MdtCsmReadOut::m_ftyp
private

Definition at line 24 of file MdtCsmReadOut.h.

◆ m_lvl1Id

uint32_t MdtCsmReadOut::m_lvl1Id
private

Definition at line 22 of file MdtCsmReadOut.h.

◆ m_mrodId

uint16_t MdtCsmReadOut::m_mrodId
private

Definition at line 30 of file MdtCsmReadOut.h.

◆ m_word

uint32_t MdtReadOut::m_word
protectedinherited

Definition at line 38 of file MdtReadOut.h.

◆ m_wordHeader

uint16_t MdtCsmReadOut::m_wordHeader
private

Definition at line 19 of file MdtCsmReadOut.h.

◆ m_zeroSupp

bool MdtCsmReadOut::m_zeroSupp
private

Definition at line 33 of file MdtCsmReadOut.h.

◆ s_BOBvalue

constexpr uint16_t MdtCsmReadOut::s_BOBvalue = 0x80
staticconstexprprivate

Definition at line 41 of file MdtCsmReadOut.h.

◆ s_BOLvalue

constexpr uint16_t MdtCsmReadOut::s_BOLvalue = 0x18
staticconstexprprivate

Definition at line 45 of file MdtCsmReadOut.h.

◆ s_EOBvalue

constexpr uint16_t MdtCsmReadOut::s_EOBvalue = 0xf0
staticconstexprprivate

Definition at line 51 of file MdtCsmReadOut.h.

◆ s_headerBits

constexpr uint16_t MdtCsmReadOut::s_headerBits = 0xff
staticconstexprprivate

Definition at line 38 of file MdtCsmReadOut.h.

◆ s_headerPos

constexpr uint16_t MdtCsmReadOut::s_headerPos = 24
staticconstexprprivate

Definition at line 37 of file MdtCsmReadOut.h.

◆ s_LWCvalue

constexpr uint16_t MdtCsmReadOut::s_LWCvalue = 0x81
staticconstexprprivate

Definition at line 43 of file MdtCsmReadOut.h.

◆ s_TLPvalue

constexpr uint16_t MdtCsmReadOut::s_TLPvalue = 0x89
staticconstexprprivate

Definition at line 47 of file MdtCsmReadOut.h.

◆ s_TWCvalue

constexpr uint16_t MdtCsmReadOut::s_TWCvalue = 0x8a
staticconstexprprivate

Definition at line 49 of file MdtCsmReadOut.h.


The documentation for this class was generated from the following files:
MdtCsmReadOut::ecnt
uint16_t ecnt() const
Definition: MdtCsmReadOut.h:71
MdtCsmReadOut::is_TWC
bool is_TWC() const
Definition: MdtCsmReadOut.h:63
MdtCsmReadOut::s_BOBvalue
static constexpr uint16_t s_BOBvalue
Definition: MdtCsmReadOut.h:41
get_generator_info.result
result
Definition: get_generator_info.py:21
MdtReadOut::m_word
uint32_t m_word
Definition: MdtReadOut.h:38
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
MdtReadOut::getBits
uint32_t getBits(std::pair< uint32_t, uint16_t > wordbstop) const
Definition: MdtReadOut.h:27
MdtCsmReadOut::setZero
void setZero()
Definition: MdtCsmReadOut.cxx:101
MdtCsmReadOut::m_ctwc
uint16_t m_ctwc
Definition: MdtCsmReadOut.h:28
MdtCsmReadOut::clwc
uint32_t clwc() const
Definition: MdtCsmReadOut.h:68
MdtCsmReadOut::ctwc
uint16_t ctwc() const
Definition: MdtCsmReadOut.h:72
MdtCsmReadOut::is_TLP
bool is_TLP() const
Definition: MdtCsmReadOut.h:62
MdtCsmReadOut::m_csmId
uint16_t m_csmId
Definition: MdtCsmReadOut.h:31
MdtCsmReadOut::is_LWC
bool is_LWC() const
Definition: MdtCsmReadOut.h:60
MdtCsmReadOut::is_BOL
bool is_BOL() const
Definition: MdtCsmReadOut.h:61
MdtCsmReadOut::csmId
uint16_t csmId() const
Definition: MdtCsmReadOut.h:74
MdtCsmReadOut::m_zeroSupp
bool m_zeroSupp
Definition: MdtCsmReadOut.h:33
MdtCsmReadOut::lvl1Id
uint32_t lvl1Id() const
Definition: MdtCsmReadOut.h:67
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
MdtCsmReadOut::s_TLPvalue
static constexpr uint16_t s_TLPvalue
Definition: MdtCsmReadOut.h:47
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
MdtCsmReadOut::m_ftyp
uint16_t m_ftyp
Definition: MdtCsmReadOut.h:24
MdtCsmReadOut::m_lvl1Id
uint32_t m_lvl1Id
Definition: MdtCsmReadOut.h:22
MdtCsmReadOut::m_flags
uint32_t m_flags
Definition: MdtCsmReadOut.h:25
MdtCsmReadOut::is_BOB
bool is_BOB() const
Definition: MdtCsmReadOut.h:59
MdtReadOut::setBits
static uint32_t setBits(uint16_t nData, const uint16_t *inputData, const uint16_t *inputPos)
Definition: MdtReadOut.cxx:14
MdtCsmReadOut::s_LWCvalue
static constexpr uint16_t s_LWCvalue
Definition: MdtCsmReadOut.h:43
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MdtCsmReadOut::s_headerPos
static constexpr uint16_t s_headerPos
Definition: MdtCsmReadOut.h:37
MdtCsmReadOut::mrodId
uint16_t mrodId() const
Definition: MdtCsmReadOut.h:73
MdtCsmReadOut::m_clwc
uint32_t m_clwc
Definition: MdtCsmReadOut.h:23
MdtCsmReadOut::m_dataWord
uint32_t m_dataWord
Definition: MdtCsmReadOut.h:18
MdtCsmReadOut::m_wordHeader
uint16_t m_wordHeader
Definition: MdtCsmReadOut.h:19
MdtCsmReadOut::s_TWCvalue
static constexpr uint16_t s_TWCvalue
Definition: MdtCsmReadOut.h:49
MdtCsmReadOut::s_BOLvalue
static constexpr uint16_t s_BOLvalue
Definition: MdtCsmReadOut.h:45
MdtCsmReadOut::m_error
bool m_error
Definition: MdtCsmReadOut.h:32
MdtCsmReadOut::flags
uint32_t flags() const
Definition: MdtCsmReadOut.h:70
MdtCsmReadOut::s_EOBvalue
static constexpr uint16_t s_EOBvalue
Definition: MdtCsmReadOut.h:51
MdtCsmReadOut::m_mrodId
uint16_t m_mrodId
Definition: MdtCsmReadOut.h:30
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
MdtCsmReadOut::s_headerBits
static constexpr uint16_t s_headerBits
Definition: MdtCsmReadOut.h:38
MdtReadOut::getBitsWord
constexpr std::pair< uint32_t, uint16_t > getBitsWord(const uint16_t bstart, const uint16_t bstop)
Definition: MdtReadOut.h:20
MdtCsmReadOut::m_ecnt
uint16_t m_ecnt
Definition: MdtCsmReadOut.h:27