ATLAS Offline Software
MdtRODReadOut.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MdtRODReadOut.h"
6 
7 #include <cassert>
8 
9 #include "GaudiKernel/Bootstrap.h"
10 #include "GaudiKernel/IMessageSvc.h"
11 #include "GaudiKernel/ISvcLocator.h"
12 #include "GaudiKernel/MsgStream.h"
13 
15  // m_dataWord(0),
16  m_subdetId(0),
17  m_mrodId(0),
18  m_lvl1Id(0),
19  m_bcId(0),
20  m_triggerTypeId(0) {}
21 
22 // Decode the ROD header
23 void MdtRODReadOut::decodeHeader(const std::vector<uint32_t>& p) {
24 #ifndef NDEBUG
25  IMessageSvc* msgSvc = 0;
26  ISvcLocator* svcLocator = Gaudi::svcLocator();
27  svcLocator->service("MessageSvc", msgSvc).ignore();
28  MsgStream log(msgSvc, "MdtRODReadOut::decodeHeader");
29 #endif
30 
31  setZero();
32 
33  if (p[0] != s_RODstart) {
34 #ifndef NDEBUG
35  log << MSG::ERROR << "ROD Start of header marker not found" << endmsg;
36 #endif
37  assert(0);
38  }
39  if (p[1] != s_RODheadersize) {
40 #ifndef NDEBUG
41  log << MSG::ERROR << "ROD header size doesn't match " << s_RODheadersize << endmsg;
42 #endif
43  assert(0);
44  }
45 
46  // decode the rest of the header
47  // Subdetector Id and mrodId
48  m_word = p[3];
49  m_subdetId = getBits(getBitsWord(15, 8));
50  m_mrodId = getBits(getBitsWord(7, 0));
51 
52  // Lvl1Id
53  m_word = p[4];
54  m_lvl1Id = getBits(getBitsWord(23, 0));
55 
56  // Bunch crossing identifier
57  m_word = p[5];
58  m_bcId = getBits(getBitsWord(11, 0));
59 
60  // Trigger type Id
61  m_word = p[6];
63 }
64 
65 // Decode the ROD footer
66 void MdtRODReadOut::decodeFooter(const std::vector<uint32_t>& /*p*/) {}
67 
69  uint16_t inputData[4] = {0, 0, subdet, mrod};
70  uint16_t inputPos[4] = {24, 16, 8, 0};
71  uint16_t nData = 4;
72 
73  return setBits(nData, inputData, inputPos);
74 }
75 
76 uint32_t* MdtRODReadOut::encodeFooter() { return nullptr; }
77 
79  m_subdetId = 0;
80  m_mrodId = 0;
81  m_lvl1Id = 0;
82  m_bcId = 0;
83  m_triggerTypeId = 0;
84 }
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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:68
MdtRODReadOut::MdtRODReadOut
MdtRODReadOut()
Definition: MdtRODReadOut.cxx:14
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
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
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:76
MdtRODReadOut::decodeFooter
void decodeFooter(const std::vector< uint32_t > &p)
Definition: MdtRODReadOut.cxx:66
MdtRODReadOut::decodeHeader
void decodeHeader(const std::vector< uint32_t > &p)
Definition: MdtRODReadOut.cxx:23
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MdtRODReadOut::setZero
void setZero()
Definition: MdtRODReadOut.cxx:78
MdtReadOut::getBitsWord
constexpr std::pair< uint32_t, uint16_t > getBitsWord(const uint16_t bstart, const uint16_t bstop)
Definition: MdtReadOut.h:20
MdtRODReadOut.h