ATLAS Offline Software
ALFA_RawDataContainerReadOut.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 
9 
11  m_wordMarker(0),
12  m_subdetId(0),
13  m_mrodId(0),
14  m_lvl1Id(0),
15  m_ecrId(0),
16  m_bcId(0),
17  m_runNum(0),
18  m_runType(0),
19  m_triggerTypeId(0),
20  m_DetEventType(0),
21  m_timestamp(0),
22  m_BCId(0)
23 { }
24 
25 
27 {
28  m_wordMarker = dataWord;
29 }
30 
31 void ALFA_RawDataContainerReadOut::decodeHeaderFull(std::vector<uint32_t>& vDataFull)
32 {
33 
34  setZeroFull();
35 
36 
37  if (vDataFull[0] == s_FullEVmarker)
38  {
39  // cout << "Full HEADER found : vDataFull[0] "<< std::hex << vDataFull[0] << std::dec <<endl;
40 
41  }
42 
43  m_word = vDataFull[8];
45  // cout << " vDataFull[8] " << std::hex << vDataFull[8] << " m_timestamp " << std::hex << m_timestamp <<std::dec<<endl;
46 
47  m_word = vDataFull[15];
48  m_BCId = getBits(getBitsWord(31,0));
49  // cout << " vDataFull[15] " << std::hex << vDataFull[15] << " m_BCId " << std::hex << m_BCId <<std::dec<<endl;
50 
51 }
52 
53 
54 // Decode the ROD header
55 void ALFA_RawDataContainerReadOut::decodeHeader(std::vector<uint32_t>& vData)
56 {
57  setZero();
58 
59  if (vData[0] != s_RODmarker)
60  {
61  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "ALFA_RawDataContainerReadOut")
62  << "ROD Start of header marker not found" << endmsg;
63  }
64  if (vData[1] != s_RODheadersize)
65  {
66  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "ALFA_RawDataContainerReadOut")
67  << "ROD header size doesn't match " << endmsg;
68  }
69 
70  // decode the rest of the header
71  // Subdetector Id and mrodId
72  m_word = vData[3];
73  m_subdetId = getBits(getBitsWord(31,16));
74  m_mrodId = getBits(getBitsWord(15,0));
75 
76 
77  // Run number
78  m_word = vData[4];
79  m_runNum = getBits(getBitsWord(23,0));
80  m_runType = getBits(getBitsWord(31,24));
81 
82 
83  // Lvl1Id :counting events
84  m_word = vData[5];
85  m_lvl1Id = getBits(getBitsWord(23,0));
86  m_ecrId = getBits(getBitsWord(31,24));
87 
88 
89  // Bunch crossing identifier
90  m_word = vData[6];
91  m_bcId = getBits(getBitsWord(11,0));
92 
93 
94  // Trigger type Id
95  m_word = vData[7];
97 
98  // Detector event type
99  m_word = vData[8];
101 }
102 
103 
104 
105 
107 {
108  m_subdetId = 0;
109  m_mrodId = 0;
110  m_runNum = 0;
111  m_runType = 0;
112  m_lvl1Id = 0;
113  m_ecrId = 0;
114  m_bcId = 0;
115  m_triggerTypeId = 0;
116  m_DetEventType = 0;
117 }
118 
120 {
121  m_timestamp = 0;
122  m_BCId = 0;
123 }
124 
ALFA_RawDataContainerReadOut::m_subdetId
uint16_t m_subdetId
Definition: ALFA_RawDataContainerReadOut.h:40
ALFA_RawDataContainerReadOut::m_bcId
uint16_t m_bcId
Definition: ALFA_RawDataContainerReadOut.h:44
ALFA_RawDataContainerReadOut::s_RODheadersize
static constexpr uint32_t s_RODheadersize
Definition: ALFA_RawDataContainerReadOut.h:64
ALFA_RawDataContainerReadOut::m_mrodId
uint16_t m_mrodId
Definition: ALFA_RawDataContainerReadOut.h:41
ALFA_RawDataContainerReadOut::m_BCId
uint32_t m_BCId
Definition: ALFA_RawDataContainerReadOut.h:52
ALFA_RawDataContainerReadOut::decodeWord
void decodeWord(uint32_t dataWord)
Definition: ALFA_RawDataContainerReadOut.cxx:26
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ALFA_RawDataContainerReadOut::s_RODmarker
static constexpr uint32_t s_RODmarker
Definition: ALFA_RawDataContainerReadOut.h:62
ALFA_RawDataContainerReadOut::m_triggerTypeId
uint16_t m_triggerTypeId
Definition: ALFA_RawDataContainerReadOut.h:47
ALFA_RawDataContainerReadOut::setZero
void setZero()
Definition: ALFA_RawDataContainerReadOut.cxx:106
ALFA_RawDataContainerReadOut::m_runNum
uint32_t m_runNum
Definition: ALFA_RawDataContainerReadOut.h:45
ALFA_RawDataContainerReadOut::m_DetEventType
uint32_t m_DetEventType
Definition: ALFA_RawDataContainerReadOut.h:48
ALFA_RawDataContainerReadOut::m_runType
uint16_t m_runType
Definition: ALFA_RawDataContainerReadOut.h:46
ALFA_ReadOut::m_word
uint32_t m_word
Definition: ALFA_ReadOut.h:40
ALFA_RawDataContainerReadOut::m_timestamp
uint32_t m_timestamp
Definition: ALFA_RawDataContainerReadOut.h:51
ALFA_RawDataContainerReadOut::m_wordMarker
uint32_t m_wordMarker
Definition: ALFA_RawDataContainerReadOut.h:37
ALFA_RawDataContainerReadOut::decodeHeader
void decodeHeader(std::vector< uint32_t > &vData)
Definition: ALFA_RawDataContainerReadOut.cxx:55
ALFA_RawDataContainerReadOut::decodeHeaderFull
void decodeHeaderFull(std::vector< uint32_t > &)
Definition: ALFA_RawDataContainerReadOut.cxx:31
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ALFA_RawDataContainerReadOut::ALFA_RawDataContainerReadOut
ALFA_RawDataContainerReadOut()
Definition: ALFA_RawDataContainerReadOut.cxx:10
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
ALFA_RawDataContainerReadOut.h
errorcheck.h
Helpers for checking error return status codes and reporting errors.
ALFA_RawDataContainerReadOut::s_FullEVmarker
static constexpr uint32_t s_FullEVmarker
Definition: ALFA_RawDataContainerReadOut.h:58
ALFA_RawDataContainerReadOut::m_ecrId
uint16_t m_ecrId
Definition: ALFA_RawDataContainerReadOut.h:43
ALFA_RawDataContainerReadOut::setZeroFull
void setZeroFull()
Definition: ALFA_RawDataContainerReadOut.cxx:119
ALFA_ReadOut::getBitsWord
constexpr std::pair< uint32_t, uint16_t > getBitsWord(const uint16_t bstart, const uint16_t bstop)
Definition: ALFA_ReadOut.h:21
ALFA_ReadOut::getBits
uint32_t getBits(std::pair< uint32_t, uint16_t > in)
Definition: ALFA_ReadOut.h:29
ALFA_RawDataContainerReadOut::m_lvl1Id
uint32_t m_lvl1Id
Definition: ALFA_RawDataContainerReadOut.h:42