ATLAS Offline Software
Loading...
Searching...
No Matches
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
19void 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];
37
38 // Lvl1Id
39 m_word = p[4];
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
52void MdtRODReadOut::decodeFooter(const std::vector<uint32_t>& /*p*/) {}
53
54uint32_t MdtRODReadOut::makeRODId(uint16_t subdet, uint16_t mrod) {
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
62uint32_t* MdtRODReadOut::encodeFooter() { return nullptr; }
63
65 m_subdetId = 0;
66 m_mrodId = 0;
67 m_lvl1Id = 0;
68 m_bcId = 0;
70}
#define endmsg
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
uint32_t makeRODId(uint16_t subdet, uint16_t mrod)
uint16_t m_mrodId
void decodeHeader(const std::vector< uint32_t > &p)
static constexpr uint32_t s_RODstart
uint16_t m_triggerTypeId
void decodeFooter(const std::vector< uint32_t > &p)
uint16_t m_subdetId
uint16_t m_bcId
static uint32_t * encodeFooter()
uint32_t m_lvl1Id
static constexpr uint32_t s_RODheadersize
uint32_t getBits(std::pair< uint32_t, uint16_t > wordbstop) const
Definition MdtReadOut.h:27
static uint32_t setBits(uint16_t nData, const uint16_t *inputData, const uint16_t *inputPos)
uint32_t m_word
Definition MdtReadOut.h:38
constexpr std::pair< uint32_t, uint16_t > getBitsWord(const uint16_t bstart, const uint16_t bstop)
Definition MdtReadOut.h:20