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
MdtHptdcReadOut Class Reference

#include <MdtHptdcReadOut.h>

Inheritance diagram for MdtHptdcReadOut:
Collaboration diagram for MdtHptdcReadOut:

Public Member Functions

 MdtHptdcReadOut ()
 
 ~MdtHptdcReadOut ()=default
 
void decodeWord (uint32_t dataWord)
 
void encodeWord (uint16_t headerVal)
 
bool is_BOT () const
 
bool is_EOT () const
 
bool is_TSM () const
 
bool is_TCM () const
 
bool is_TES () const
 
uint16_t tdcId () const
 
uint16_t ecnt () const
 
uint16_t bcId () const
 
uint16_t channel () const
 
uint16_t coarse () const
 
uint16_t fine () const
 
uint16_t width () const
 
bool errflag () const
 
bool isLeading () const
 
uint32_t makeBOT (uint16_t tdcId, uint16_t ecnt, uint16_t bcid)
 
uint32_t makeEOT (uint16_t tdcId, uint16_t ecnt, uint16_t wcnt)
 
uint32_t makeTSM (uint16_t tdcId, uint16_t channel, bool leading, uint16_t coarse, uint16_t fine)
 
uint32_t makeTCM (uint16_t tdcId, uint16_t channel, uint16_t width, uint16_t coarse, uint16_t fine)
 

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
 
uint16_t m_tdcId
 
uint16_t m_ecnt
 
uint16_t m_bcId
 
uint16_t m_wcnt
 
uint16_t m_channel
 
uint16_t m_coarse
 
uint16_t m_fine
 
uint16_t m_width
 
bool m_errflag
 
bool m_leading
 

Static Private Attributes

static constexpr uint16_t HEADERPOS = 28
 
static constexpr uint16_t HEADERBITS = 0xf
 
static constexpr uint16_t BOTVALUE1 = 0xa
 
static constexpr uint16_t BOTVALUE2 = 0xb
 
static constexpr uint16_t EOTVALUE = 0xc
 
static constexpr uint16_t TSMVALUE_LEAD = 0x4
 
static constexpr uint16_t TSMVALUE_TAIL = 0x5
 
static constexpr uint16_t TCMVALUE = 0x9
 
static constexpr uint16_t TESVALUE = 0x6
 

Detailed Description

Definition at line 15 of file MdtHptdcReadOut.h.

Constructor & Destructor Documentation

◆ MdtHptdcReadOut()

MdtHptdcReadOut::MdtHptdcReadOut ( )

Definition at line 7 of file MdtHptdcReadOut.cxx.

7  :
8  m_dataWord(0),
9  m_wordHeader(0),
10  m_tdcId(0),
11  m_ecnt(0),
12  m_bcId(0),
13  m_wcnt(0),
14  m_channel(0),
15  m_coarse(0),
16  m_fine(0),
17  m_width(0),
18  m_errflag(0),
19  m_leading(false) {}

◆ ~MdtHptdcReadOut()

MdtHptdcReadOut::~MdtHptdcReadOut ( )
default

Member Function Documentation

◆ bcId()

uint16_t MdtHptdcReadOut::bcId ( ) const
inline

Definition at line 88 of file MdtHptdcReadOut.h.

88 { return m_bcId; }

◆ channel()

uint16_t MdtHptdcReadOut::channel ( ) const
inline

Definition at line 90 of file MdtHptdcReadOut.h.

90 { return m_channel; }

◆ coarse()

uint16_t MdtHptdcReadOut::coarse ( ) const
inline

Definition at line 91 of file MdtHptdcReadOut.h.

91 { return m_coarse; }

◆ decodeWord()

void MdtHptdcReadOut::decodeWord ( uint32_t  dataWord)

Definition at line 21 of file MdtHptdcReadOut.cxx.

21  {
22  // Zero all the decoded quantities
23  setZero();
24  m_dataWord = dataWord;
25  m_word = dataWord;
26  m_wordHeader = (dataWord >> HEADERPOS) & HEADERBITS;
27 
28  if (is_TSM()) // TDC single measurement
29  {
30  m_leading = !((bool)getBits(getBitsWord(28, 28)));
31  m_tdcId = getBits(getBitsWord(27, 24));
32  m_channel = getBits(getBitsWord(23, 19));
33  m_coarse = getBits(getBitsWord(18, 5));
34  m_fine = getBits(getBitsWord(4, 0));
35  } else if (is_TCM()) // TDC combined measurement
36  {
37  m_tdcId = getBits(getBitsWord(27, 24));
38  m_channel = getBits(getBitsWord(23, 19));
39  m_width = getBits(getBitsWord(18, 12));
40  m_coarse = getBits(getBitsWord(11, 5));
41  m_fine = getBits(getBitsWord(4, 0));
42  } else if (is_BOT()) // Beginning of TDC
43  {
44  // One header bit is used for TDC numbers > 15
45  m_tdcId = getBits(getBitsWord(28, 24));
46  m_ecnt = getBits(getBitsWord(23, 12));
47  m_bcId = getBits(getBitsWord(11, 0));
48  } else if (is_EOT()) // End of TDC
49  {
50  m_tdcId = getBits(getBitsWord(27, 24));
51  m_ecnt = getBits(getBitsWord(23, 12));
52  m_wcnt = getBits(getBitsWord(11, 0));
53  } else if (is_TES()) // TDC error status
54  {
55  m_tdcId = getBits(getBitsWord(27, 24));
56  m_errflag = getBits(getBitsWord(14, 0));
57  }
58 }

◆ ecnt()

uint16_t MdtHptdcReadOut::ecnt ( ) const
inline

Definition at line 87 of file MdtHptdcReadOut.h.

87 { return m_ecnt; }

◆ encodeWord()

void MdtHptdcReadOut::encodeWord ( uint16_t  headerVal)

◆ errflag()

bool MdtHptdcReadOut::errflag ( ) const
inline

Definition at line 94 of file MdtHptdcReadOut.h.

94 { return m_errflag; }

◆ fine()

uint16_t MdtHptdcReadOut::fine ( ) const
inline

Definition at line 92 of file MdtHptdcReadOut.h.

92 { return m_fine; }

◆ 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_BOT()

bool MdtHptdcReadOut::is_BOT ( ) const
inline

Definition at line 75 of file MdtHptdcReadOut.h.

75 { return ((m_wordHeader == BOTVALUE1) || (m_wordHeader == BOTVALUE2)); };

◆ is_EOT()

bool MdtHptdcReadOut::is_EOT ( ) const
inline

Definition at line 77 of file MdtHptdcReadOut.h.

77 { return (m_wordHeader == EOTVALUE); };

◆ is_TCM()

bool MdtHptdcReadOut::is_TCM ( ) const
inline

Definition at line 81 of file MdtHptdcReadOut.h.

81 { return (m_wordHeader == TCMVALUE); };

◆ is_TES()

bool MdtHptdcReadOut::is_TES ( ) const
inline

Definition at line 83 of file MdtHptdcReadOut.h.

83 { return (m_wordHeader == TESVALUE); };

◆ is_TSM()

bool MdtHptdcReadOut::is_TSM ( ) const
inline

Definition at line 79 of file MdtHptdcReadOut.h.

79 { return ((m_wordHeader == TSMVALUE_LEAD) || (m_wordHeader == TSMVALUE_TAIL)); };

◆ isLeading()

bool MdtHptdcReadOut::isLeading ( ) const
inline

Definition at line 95 of file MdtHptdcReadOut.h.

95 { return m_leading; }

◆ makeBOT()

uint32_t MdtHptdcReadOut::makeBOT ( uint16_t  tdcId,
uint16_t  ecnt,
uint16_t  bcid 
)

Definition at line 75 of file MdtHptdcReadOut.cxx.

75  {
76  uint16_t inputData[4];
77  constexpr uint16_t inputPos[4] = {HEADERPOS, 24, 12, 0};
78  uint16_t nData = 4;
79 
80  if (tdcId < 16) {
81  inputData[0] = BOTVALUE1;
82  } else {
83  inputData[0] = BOTVALUE2;
84  tdcId -= 16;
85  }
86 
87  inputData[1] = tdcId;
88  inputData[2] = ecnt;
89  inputData[3] = bcid;
90 
91  return setBits(nData, inputData, inputPos);
92 }

◆ makeEOT()

uint32_t MdtHptdcReadOut::makeEOT ( uint16_t  tdcId,
uint16_t  ecnt,
uint16_t  wcnt 
)

Definition at line 95 of file MdtHptdcReadOut.cxx.

95  {
96  uint16_t inputData[4] = {EOTVALUE, tdcId, ecnt, wcnt};
97  constexpr uint16_t inputPos[4] = {HEADERPOS, 24, 12, 0};
98  uint16_t nData = 4;
99 
100  return setBits(nData, inputData, inputPos);
101 }

◆ makeTCM()

uint32_t MdtHptdcReadOut::makeTCM ( uint16_t  tdcId,
uint16_t  channel,
uint16_t  width,
uint16_t  coarse,
uint16_t  fine 
)

Definition at line 116 of file MdtHptdcReadOut.cxx.

116  {
117  uint16_t inputData[5] = {TCMVALUE, static_cast<uint16_t>(tdcId & 0xf), static_cast<uint16_t>(channel & 0x1f),
118  static_cast<uint16_t>(width & 0x7f), static_cast<uint16_t>(coarse & 0xfff)};
119  constexpr uint16_t inputPos[5] = {HEADERPOS, 24, 19, 12, 0};
120  uint16_t nData = 5;
121 
122  return setBits(nData, inputData, inputPos);
123 }

◆ makeTSM()

uint32_t MdtHptdcReadOut::makeTSM ( uint16_t  tdcId,
uint16_t  channel,
bool  leading,
uint16_t  coarse,
uint16_t  fine 
)

Definition at line 104 of file MdtHptdcReadOut.cxx.

104  {
105  uint16_t TSMvalue = leading ? TSMVALUE_LEAD : TSMVALUE_TAIL;
106 
107  uint16_t inputData[4] = {TSMvalue, static_cast<uint16_t>(tdcId & 0xf), static_cast<uint16_t>(channel & 0x1f),
108  static_cast<uint16_t>(coarse & 0x7ffff)};
109  constexpr uint16_t inputPos[4] = {HEADERPOS, 24, 19, 0};
110  uint16_t nData = 4;
111 
112  return setBits(nData, inputData, inputPos);
113 }

◆ 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 MdtHptdcReadOut::setZero ( )
private

Definition at line 60 of file MdtHptdcReadOut.cxx.

60  {
61  m_tdcId = 0;
62  m_ecnt = 0;
63  m_bcId = 0;
64  m_wcnt = 0;
65  m_channel = 0;
66  m_coarse = 0;
67  m_fine = 0;
68  m_width = 0;
69  m_errflag = 0;
70  m_leading = false;
71 }

◆ tdcId()

uint16_t MdtHptdcReadOut::tdcId ( ) const
inline

Definition at line 86 of file MdtHptdcReadOut.h.

86 { return m_tdcId; }

◆ width()

uint16_t MdtHptdcReadOut::width ( ) const
inline

Definition at line 93 of file MdtHptdcReadOut.h.

93 { return m_width; }

Member Data Documentation

◆ BOTVALUE1

constexpr uint16_t MdtHptdcReadOut::BOTVALUE1 = 0xa
staticconstexprprivate

Definition at line 48 of file MdtHptdcReadOut.h.

◆ BOTVALUE2

constexpr uint16_t MdtHptdcReadOut::BOTVALUE2 = 0xb
staticconstexprprivate

Definition at line 49 of file MdtHptdcReadOut.h.

◆ EOTVALUE

constexpr uint16_t MdtHptdcReadOut::EOTVALUE = 0xc
staticconstexprprivate

Definition at line 52 of file MdtHptdcReadOut.h.

◆ HEADERBITS

constexpr uint16_t MdtHptdcReadOut::HEADERBITS = 0xf
staticconstexprprivate

Definition at line 44 of file MdtHptdcReadOut.h.

◆ HEADERPOS

constexpr uint16_t MdtHptdcReadOut::HEADERPOS = 28
staticconstexprprivate

Definition at line 43 of file MdtHptdcReadOut.h.

◆ m_bcId

uint16_t MdtHptdcReadOut::m_bcId
private

Definition at line 25 of file MdtHptdcReadOut.h.

◆ m_channel

uint16_t MdtHptdcReadOut::m_channel
private

Definition at line 31 of file MdtHptdcReadOut.h.

◆ m_coarse

uint16_t MdtHptdcReadOut::m_coarse
private

Definition at line 32 of file MdtHptdcReadOut.h.

◆ m_dataWord

uint32_t MdtHptdcReadOut::m_dataWord
private

Definition at line 18 of file MdtHptdcReadOut.h.

◆ m_ecnt

uint16_t MdtHptdcReadOut::m_ecnt
private

Definition at line 24 of file MdtHptdcReadOut.h.

◆ m_errflag

bool MdtHptdcReadOut::m_errflag
private

Definition at line 35 of file MdtHptdcReadOut.h.

◆ m_fine

uint16_t MdtHptdcReadOut::m_fine
private

Definition at line 33 of file MdtHptdcReadOut.h.

◆ m_leading

bool MdtHptdcReadOut::m_leading
private

Definition at line 37 of file MdtHptdcReadOut.h.

◆ m_tdcId

uint16_t MdtHptdcReadOut::m_tdcId
private

Definition at line 23 of file MdtHptdcReadOut.h.

◆ m_wcnt

uint16_t MdtHptdcReadOut::m_wcnt
private

Definition at line 28 of file MdtHptdcReadOut.h.

◆ m_width

uint16_t MdtHptdcReadOut::m_width
private

Definition at line 34 of file MdtHptdcReadOut.h.

◆ m_word

uint32_t MdtReadOut::m_word
protectedinherited

Definition at line 38 of file MdtReadOut.h.

◆ m_wordHeader

uint16_t MdtHptdcReadOut::m_wordHeader
private

Definition at line 20 of file MdtHptdcReadOut.h.

◆ TCMVALUE

constexpr uint16_t MdtHptdcReadOut::TCMVALUE = 0x9
staticconstexprprivate

Definition at line 59 of file MdtHptdcReadOut.h.

◆ TESVALUE

constexpr uint16_t MdtHptdcReadOut::TESVALUE = 0x6
staticconstexprprivate

Definition at line 62 of file MdtHptdcReadOut.h.

◆ TSMVALUE_LEAD

constexpr uint16_t MdtHptdcReadOut::TSMVALUE_LEAD = 0x4
staticconstexprprivate

Definition at line 55 of file MdtHptdcReadOut.h.

◆ TSMVALUE_TAIL

constexpr uint16_t MdtHptdcReadOut::TSMVALUE_TAIL = 0x5
staticconstexprprivate

Definition at line 56 of file MdtHptdcReadOut.h.


The documentation for this class was generated from the following files:
MdtHptdcReadOut::TCMVALUE
static constexpr uint16_t TCMVALUE
Definition: MdtHptdcReadOut.h:59
MdtHptdcReadOut::m_bcId
uint16_t m_bcId
Definition: MdtHptdcReadOut.h:25
MdtHptdcReadOut::m_fine
uint16_t m_fine
Definition: MdtHptdcReadOut.h:33
MdtHptdcReadOut::is_TSM
bool is_TSM() const
Definition: MdtHptdcReadOut.h:79
MdtHptdcReadOut::m_dataWord
uint32_t m_dataWord
Definition: MdtHptdcReadOut.h:18
get_generator_info.result
result
Definition: get_generator_info.py:21
MdtHptdcReadOut::m_wordHeader
uint16_t m_wordHeader
Definition: MdtHptdcReadOut.h:20
MdtReadOut::m_word
uint32_t m_word
Definition: MdtReadOut.h:38
MdtHptdcReadOut::m_width
uint16_t m_width
Definition: MdtHptdcReadOut.h:34
MdtHptdcReadOut::m_tdcId
uint16_t m_tdcId
Definition: MdtHptdcReadOut.h:23
MdtHptdcReadOut::coarse
uint16_t coarse() const
Definition: MdtHptdcReadOut.h:91
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
MdtHptdcReadOut::m_errflag
bool m_errflag
Definition: MdtHptdcReadOut.h:35
MdtReadOut::getBits
uint32_t getBits(std::pair< uint32_t, uint16_t > wordbstop) const
Definition: MdtReadOut.h:27
MdtHptdcReadOut::width
uint16_t width() const
Definition: MdtHptdcReadOut.h:93
MdtHptdcReadOut::EOTVALUE
static constexpr uint16_t EOTVALUE
Definition: MdtHptdcReadOut.h:52
MdtHptdcReadOut::m_channel
uint16_t m_channel
Definition: MdtHptdcReadOut.h:31
MdtHptdcReadOut::is_BOT
bool is_BOT() const
Definition: MdtHptdcReadOut.h:75
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
MdtHptdcReadOut::m_leading
bool m_leading
Definition: MdtHptdcReadOut.h:37
MdtHptdcReadOut::is_EOT
bool is_EOT() const
Definition: MdtHptdcReadOut.h:77
MdtHptdcReadOut::is_TCM
bool is_TCM() const
Definition: MdtHptdcReadOut.h:81
lumiFormat.i
int i
Definition: lumiFormat.py:85
MdtHptdcReadOut::tdcId
uint16_t tdcId() const
Definition: MdtHptdcReadOut.h:86
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
MdtHptdcReadOut::BOTVALUE1
static constexpr uint16_t BOTVALUE1
Definition: MdtHptdcReadOut.h:48
MdtHptdcReadOut::BOTVALUE2
static constexpr uint16_t BOTVALUE2
Definition: MdtHptdcReadOut.h:49
MdtHptdcReadOut::TESVALUE
static constexpr uint16_t TESVALUE
Definition: MdtHptdcReadOut.h:62
MdtReadOut::setBits
static uint32_t setBits(uint16_t nData, const uint16_t *inputData, const uint16_t *inputPos)
Definition: MdtReadOut.cxx:14
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
MdtHptdcReadOut::m_ecnt
uint16_t m_ecnt
Definition: MdtHptdcReadOut.h:24
MdtHptdcReadOut::TSMVALUE_LEAD
static constexpr uint16_t TSMVALUE_LEAD
Definition: MdtHptdcReadOut.h:55
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MdtHptdcReadOut::m_coarse
uint16_t m_coarse
Definition: MdtHptdcReadOut.h:32
MdtHptdcReadOut::TSMVALUE_TAIL
static constexpr uint16_t TSMVALUE_TAIL
Definition: MdtHptdcReadOut.h:56
MdtHptdcReadOut::m_wcnt
uint16_t m_wcnt
Definition: MdtHptdcReadOut.h:28
MdtHptdcReadOut::HEADERPOS
static constexpr uint16_t HEADERPOS
Definition: MdtHptdcReadOut.h:43
MdtHptdcReadOut::is_TES
bool is_TES() const
Definition: MdtHptdcReadOut.h:83
MdtHptdcReadOut::HEADERBITS
static constexpr uint16_t HEADERBITS
Definition: MdtHptdcReadOut.h:44
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
MdtHptdcReadOut::ecnt
uint16_t ecnt() const
Definition: MdtHptdcReadOut.h:87
MdtReadOut::getBitsWord
constexpr std::pair< uint32_t, uint16_t > getBitsWord(const uint16_t bstart, const uint16_t bstop)
Definition: MdtReadOut.h:20
MdtHptdcReadOut::setZero
void setZero()
Definition: MdtHptdcReadOut.cxx:60
MdtHptdcReadOut::channel
uint16_t channel() const
Definition: MdtHptdcReadOut.h:90