ATLAS Offline Software
MdtRODReadOut.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MdtRODReadOut.h"
6 
8 
9 
11  // m_dataWord(0),
12  m_subdetId(0),
13  m_mrodId(0),
14  m_lvl1Id(0),
15  m_bcId(0),
16  m_triggerTypeId(0) {}
17 
18 // Decode the ROD header
19 void MdtRODReadOut::decodeHeader(const std::vector<uint32_t>& p) {
20 
21  setZero();
22 
23  if (p[0] != s_RODstart) {
24  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "MdtRODReadOut")
25  << "ROD Start of header marker not found" << endmsg;
26  }
27  if (p[1] != s_RODheadersize) {
28  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "MdtRODReadOut")
29  << "ROD header size doesn't match " << s_RODheadersize << endmsg;
30  }
31 
32  // decode the rest of the header
33  // Subdetector Id and mrodId
34  m_word = p[3];
35  m_subdetId = getBits(getBitsWord(15, 8));
36  m_mrodId = getBits(getBitsWord(7, 0));
37 
38  // Lvl1Id
39  m_word = p[4];
40  m_lvl1Id = getBits(getBitsWord(23, 0));
41 
42  // Bunch crossing identifier
43  m_word = p[5];
44  m_bcId = getBits(getBitsWord(11, 0));
45 
46  // Trigger type Id
47  m_word = p[6];
49 }
50 
51 // Decode the ROD footer
52 void MdtRODReadOut::decodeFooter(const std::vector<uint32_t>& /*p*/) {}
53 
55  uint16_t inputData[4] = {0, 0, subdet, mrod};
56  uint16_t inputPos[4] = {24, 16, 8, 0};
57  uint16_t nData = 4;
58 
59  return setBits(nData, inputData, inputPos);
60 }
61 
62 uint32_t* MdtRODReadOut::encodeFooter() { return nullptr; }
63 
65  m_subdetId = 0;
66  m_mrodId = 0;
67  m_lvl1Id = 0;
68  m_bcId = 0;
69  m_triggerTypeId = 0;
70 }
MdtRODReadOut::m_lvl1Id
uint32_t m_lvl1Id
Definition: MdtRODReadOut.h:23
MdtReadOut::m_word
uint32_t m_word
Definition: MdtReadOut.h:38
MdtRODReadOut::m_triggerTypeId
uint16_t m_triggerTypeId
Definition: MdtRODReadOut.h:25
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
MdtRODReadOut::s_RODheadersize
static constexpr uint32_t s_RODheadersize
Definition: MdtRODReadOut.h:29
MdtRODReadOut::m_subdetId
uint16_t m_subdetId
Definition: MdtRODReadOut.h:21
MdtRODReadOut::makeRODId
uint32_t makeRODId(uint16_t subdet, uint16_t mrod)
Definition: MdtRODReadOut.cxx:54
MdtRODReadOut::MdtRODReadOut
MdtRODReadOut()
Definition: MdtRODReadOut.cxx:10
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MdtRODReadOut::m_mrodId
uint16_t m_mrodId
Definition: MdtRODReadOut.h:22
MdtRODReadOut::m_bcId
uint16_t m_bcId
Definition: MdtRODReadOut.h:24
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:345
errorcheck.h
Helpers for checking error return status codes and reporting errors.
MdtReadOut::setBits
static uint32_t setBits(uint16_t nData, const uint16_t *inputData, const uint16_t *inputPos)
Definition: MdtReadOut.cxx:14
MdtRODReadOut::s_RODstart
static constexpr uint32_t s_RODstart
Definition: MdtRODReadOut.h:28
MdtRODReadOut::encodeFooter
static uint32_t * encodeFooter()
Definition: MdtRODReadOut.cxx:62
MdtRODReadOut::decodeFooter
void decodeFooter(const std::vector< uint32_t > &p)
Definition: MdtRODReadOut.cxx:52
MdtRODReadOut::decodeHeader
void decodeHeader(const std::vector< uint32_t > &p)
Definition: MdtRODReadOut.cxx:19
MdtRODReadOut::setZero
void setZero()
Definition: MdtRODReadOut.cxx:64
MdtReadOut::getBitsWord
constexpr std::pair< uint32_t, uint16_t > getBitsWord(const uint16_t bstart, const uint16_t bstop)
Definition: MdtReadOut.h:20
MdtRODReadOut.h