ATLAS Offline Software
MdtCsmReadOut.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MdtCsmReadOut.h"
6 
7 //#include "GaudiKernel/ISvcLocator.h"
8 //#include "GaudiKernel/Bootstrap.h"
9 //#include "GaudiKernel/MsgStream.h"
10 //#include "GaudiKernel/IMessageSvc.h"
11 
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) {}
25 
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 }
50 
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 }
58 
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 }
66 
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 }
76 
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 }
84 
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 }
92 
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 }
100 
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 }
MdtCsmReadOut::ecnt
uint16_t ecnt() const
Definition: MdtCsmReadOut.h:71
MdtCsmReadOut::is_TWC
bool is_TWC() const
Definition: MdtCsmReadOut.h:63
MdtCsmReadOut::decodeWord
void decodeWord(uint32_t dataWord)
Definition: MdtCsmReadOut.cxx:26
MdtCsmReadOut::s_BOBvalue
static constexpr uint16_t s_BOBvalue
Definition: MdtCsmReadOut.h:41
MdtReadOut::m_word
uint32_t m_word
Definition: MdtReadOut.h:38
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
MdtCsmReadOut::makeBOL
uint32_t makeBOL(uint16_t mrodId, uint16_t csmId)
Definition: MdtCsmReadOut.cxx:67
MdtCsmReadOut.h
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
MdtCsmReadOut::s_TLPvalue
static constexpr uint16_t s_TLPvalue
Definition: MdtCsmReadOut.h:47
MdtCsmReadOut::m_ftyp
uint16_t m_ftyp
Definition: MdtCsmReadOut.h:24
MdtCsmReadOut::makeLWC
uint32_t makeLWC(uint32_t clwc)
Definition: MdtCsmReadOut.cxx:59
MdtCsmReadOut::MdtCsmReadOut
MdtCsmReadOut()
Definition: MdtCsmReadOut.cxx:12
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
MdtCsmReadOut::makeBOB
uint32_t makeBOB(uint32_t lvl1Id)
Definition: MdtCsmReadOut.cxx:51
MdtCsmReadOut::makeEOB
uint32_t makeEOB(uint32_t wcnt)
Definition: MdtCsmReadOut.cxx:93
MdtReadOut::setBits
static uint32_t setBits(uint16_t nData, const uint16_t *inputData, const uint16_t *inputPos)
Definition: MdtReadOut.cxx:14
MdtCsmReadOut::makeTLP
uint32_t makeTLP(uint32_t flags)
Definition: MdtCsmReadOut.cxx:77
MdtCsmReadOut::s_LWCvalue
static constexpr uint16_t s_LWCvalue
Definition: MdtCsmReadOut.h:43
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::makeTWC
uint32_t makeTWC(uint16_t ecnt, uint16_t ctwc)
Definition: MdtCsmReadOut.cxx:85
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