ATLAS Offline Software
Loading...
Searching...
No Matches
MdtRODReadOut Class Reference

#include <MdtRODReadOut.h>

Inheritance diagram for MdtRODReadOut:
Collaboration diagram for MdtRODReadOut:

Public Member Functions

 MdtRODReadOut ()
 ~MdtRODReadOut ()=default
void decodeHeader (const std::vector< uint32_t > &p)
void decodeFooter (const std::vector< uint32_t > &p)
constexpr uint32_t makeHeaderMarker ()
constexpr uint32_t makeHeaderSize ()
constexpr uint32_t makeFormatVersion ()
uint32_t makeRODId (uint16_t subdet, uint16_t mrod)
uint16_t subdetId () const
uint16_t mrodId () const
uint32_t lvl1Id () const
uint16_t bcId () const
uint16_t trigtypeId () const

Static Public Member Functions

static uint32_t * encodeFooter ()

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

uint16_t m_subdetId
uint16_t m_mrodId
uint32_t m_lvl1Id
uint16_t m_bcId
uint16_t m_triggerTypeId

Static Private Attributes

static constexpr uint32_t s_RODstart = 0xee1234ee
static constexpr uint32_t s_RODheadersize = 0x8
static constexpr uint32_t s_RODversion = 0

Detailed Description

Definition at line 17 of file MdtRODReadOut.h.

Constructor & Destructor Documentation

◆ MdtRODReadOut()

MdtRODReadOut::MdtRODReadOut ( )

Definition at line 10 of file MdtRODReadOut.cxx.

10 :
11 // m_dataWord(0),
12 m_subdetId(0),
13 m_mrodId(0),
14 m_lvl1Id(0),
15 m_bcId(0),
16 m_triggerTypeId(0) {}
uint16_t m_mrodId
uint16_t m_triggerTypeId
uint16_t m_subdetId
uint16_t m_bcId
uint32_t m_lvl1Id

◆ ~MdtRODReadOut()

MdtRODReadOut::~MdtRODReadOut ( )
default

Member Function Documentation

◆ bcId()

uint16_t MdtRODReadOut::bcId ( ) const
inline

Definition at line 51 of file MdtRODReadOut.h.

51{ return m_bcId; }

◆ decodeFooter()

void MdtRODReadOut::decodeFooter ( const std::vector< uint32_t > & p)

Definition at line 52 of file MdtRODReadOut.cxx.

52{}

◆ decodeHeader()

void MdtRODReadOut::decodeHeader ( const std::vector< uint32_t > & p)

Definition at line 19 of file MdtRODReadOut.cxx.

19 {
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}
#define endmsg
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
static constexpr uint32_t s_RODstart
static constexpr uint32_t s_RODheadersize
uint32_t getBits(std::pair< uint32_t, uint16_t > wordbstop) const
Definition MdtReadOut.h:27
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

◆ encodeFooter()

uint32_t * MdtRODReadOut::encodeFooter ( )
static

Definition at line 62 of file MdtRODReadOut.cxx.

62{ return nullptr; }

◆ 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 }
setEventNumber uint32_t

◆ getBitsWord()

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 }

◆ lvl1Id()

uint32_t MdtRODReadOut::lvl1Id ( ) const
inline

Definition at line 50 of file MdtRODReadOut.h.

50{ return m_lvl1Id; }

◆ makeFormatVersion()

uint32_t MdtRODReadOut::makeFormatVersion ( )
inlineconstexpr

Definition at line 44 of file MdtRODReadOut.h.

44{ return s_RODversion; }
static constexpr uint32_t s_RODversion

◆ makeHeaderMarker()

uint32_t MdtRODReadOut::makeHeaderMarker ( )
inlineconstexpr

Definition at line 42 of file MdtRODReadOut.h.

42{ return s_RODstart; }

◆ makeHeaderSize()

uint32_t MdtRODReadOut::makeHeaderSize ( )
inlineconstexpr

Definition at line 43 of file MdtRODReadOut.h.

43{ return s_RODheadersize; }

◆ makeRODId()

uint32_t MdtRODReadOut::makeRODId ( uint16_t subdet,
uint16_t mrod )

Definition at line 54 of file MdtRODReadOut.cxx.

54 {
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}
static uint32_t setBits(uint16_t nData, const uint16_t *inputData, const uint16_t *inputPos)
setWord1 uint16_t

◆ mrodId()

uint16_t MdtRODReadOut::mrodId ( ) const
inline

Definition at line 49 of file MdtRODReadOut.h.

49{ 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 MdtRODReadOut::setZero ( )
private

Definition at line 64 of file MdtRODReadOut.cxx.

64 {
65 m_subdetId = 0;
66 m_mrodId = 0;
67 m_lvl1Id = 0;
68 m_bcId = 0;
70}

◆ subdetId()

uint16_t MdtRODReadOut::subdetId ( ) const
inline

Definition at line 48 of file MdtRODReadOut.h.

48{ return m_subdetId; }

◆ trigtypeId()

uint16_t MdtRODReadOut::trigtypeId ( ) const
inline

Definition at line 52 of file MdtRODReadOut.h.

52{ return m_triggerTypeId; }

Member Data Documentation

◆ m_bcId

uint16_t MdtRODReadOut::m_bcId
private

Definition at line 24 of file MdtRODReadOut.h.

◆ m_lvl1Id

uint32_t MdtRODReadOut::m_lvl1Id
private

Definition at line 23 of file MdtRODReadOut.h.

◆ m_mrodId

uint16_t MdtRODReadOut::m_mrodId
private

Definition at line 22 of file MdtRODReadOut.h.

◆ m_subdetId

uint16_t MdtRODReadOut::m_subdetId
private

Definition at line 21 of file MdtRODReadOut.h.

◆ m_triggerTypeId

uint16_t MdtRODReadOut::m_triggerTypeId
private

Definition at line 25 of file MdtRODReadOut.h.

◆ m_word

uint32_t MdtReadOut::m_word
protectedinherited

Definition at line 38 of file MdtReadOut.h.

◆ s_RODheadersize

uint32_t MdtRODReadOut::s_RODheadersize = 0x8
staticconstexprprivate

Definition at line 29 of file MdtRODReadOut.h.

◆ s_RODstart

uint32_t MdtRODReadOut::s_RODstart = 0xee1234ee
staticconstexprprivate

Definition at line 28 of file MdtRODReadOut.h.

◆ s_RODversion

uint32_t MdtRODReadOut::s_RODversion = 0
staticconstexprprivate

Definition at line 30 of file MdtRODReadOut.h.


The documentation for this class was generated from the following files: