ATLAS Offline Software
L1TopoROD.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <iostream>
6 #include "L1TopoRDO/L1TopoROD.h"
7 #include "L1TopoRDO/Helpers.h"
8 
9 namespace L1Topo {
10 
11  L1TopoROD::L1TopoROD(const uint32_t trailer1, const uint32_t trailer2)
12  :m_rodTrailer1(trailer1), m_rodTrailer2(trailer2) {
13  this->decode();
14  }
15 
21 
23  m_linkErrs = (L1Topo::decode(m_rodTrailer2,8,4) & 0xf) != 0;
24  m_ct = (L1Topo::decode(m_rodTrailer2,6,1) & 0xf) != 0;
25  m_pc = (L1Topo::decode(m_rodTrailer2,5,1) & 0xf) != 0;
26  m_hc = (L1Topo::decode(m_rodTrailer2,4,1) & 0xf) != 0;
27  m_pe = (L1Topo::decode(m_rodTrailer2,3,1) & 0xf) != 0;
28  m_lm = (L1Topo::decode(m_rodTrailer2,2,1) & 0xf) != 0;
29  m_hm = (L1Topo::decode(m_rodTrailer2,1,1) & 0xf) != 0;
30  m_pt = (L1Topo::decode(m_rodTrailer2,0,1) & 0xf) != 0;
31  }
32 
34  return m_rodTrailer1;
35  }
36 
38  return m_rodTrailer2;
39  }
40 
42  return m_shelf;
43  }
44 
46  return m_rod;
47  }
48 
50  return m_linkErrMap;
51  }
52 
54  return m_payloadLength;
55  }
56 
58  return m_crc;
59  }
60 
61  bool L1TopoROD::linkErrs() const{
62  return m_linkErrs;
63  }
64 
65  bool L1TopoROD::ct() const{
66  return m_ct;
67  }
68 
69  bool L1TopoROD::pc() const{
70  return m_pc;
71  }
72 
73  bool L1TopoROD::hc() const{
74  return m_hc;
75  }
76 
77  bool L1TopoROD::pe() const{
78  return m_pe;
79  }
80 
81  bool L1TopoROD::lm() const{
82  return m_lm;
83  }
84 
85  bool L1TopoROD::hm() const{
86  return m_hm;
87  }
88 
89  bool L1TopoROD::pt() const{
90  return m_pt;
91  }
92 
93  std::ostream& operator<<(std::ostream& os, const L1TopoROD& s) {
94  os << std::hex << std::showbase << s.rodTrailer1() << std::dec <<
95  " Shelf= " << s.shelf() << " ROD= " << s.rod() <<
96  " Link error map= " << s.linkErrMap() << " Payload length= " << s.payloadLength() <<
97  "\n" <<
98  std::hex << std::showbase << s.rodTrailer2() << std::dec <<
99  " CRC= " << s.crc() << " Link errors= " << s.linkErrs() <<
100  " ROD errors: CT= " << s.ct() << " pc= " << s.pc() << " hc= " << s.hc() <<
101  " pe= " <<s.pe() << " lm= " << s.lm() << " hm= " << s.hm() << " pt= " << s.pt() <<
102  std::dec << "\n";
103  return os;
104  }
105 
106 } // namespace L1Topo
107 
L1TopoROD.h
L1Topo::L1TopoROD::m_linkErrs
bool m_linkErrs
Definition: L1TopoROD.h:49
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
L1Topo::operator<<
std::ostream & operator<<(std::ostream &, const Error)
Helper to print errors as text rather than numbers.
Definition: Error.cxx:8
L1Topo::L1TopoROD::ct
bool ct() const
Definition: L1TopoROD.cxx:65
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
L1Topo::L1TopoROD::payloadLength
uint32_t payloadLength() const
Definition: L1TopoROD.cxx:53
L1Topo::L1TopoROD::m_rodTrailer1
uint32_t m_rodTrailer1
variables
Definition: L1TopoROD.h:40
L1Topo::L1TopoROD::m_crc
uint32_t m_crc
Definition: L1TopoROD.h:48
L1Topo::L1TopoROD::lm
bool lm() const
Definition: L1TopoROD.cxx:81
L1Topo::L1TopoROD::pc
bool pc() const
Definition: L1TopoROD.cxx:69
L1Topo::L1TopoROD::m_ct
bool m_ct
Definition: L1TopoROD.h:50
L1Topo::L1TopoROD::pe
bool pe() const
Definition: L1TopoROD.cxx:77
L1Topo::L1TopoROD::m_shelf
uint32_t m_shelf
Definition: L1TopoROD.h:43
L1Topo::L1TopoROD::m_hc
bool m_hc
Definition: L1TopoROD.h:52
L1Topo::L1TopoROD::m_pc
bool m_pc
Definition: L1TopoROD.h:51
L1Topo::L1TopoROD::pt
bool pt() const
Definition: L1TopoROD.cxx:89
L1Topo::L1TopoROD::m_pe
bool m_pe
Definition: L1TopoROD.h:53
L1Topo::L1TopoROD::rodTrailer2
uint32_t rodTrailer2() const
Definition: L1TopoROD.cxx:37
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
L1Topo::L1TopoROD::m_pt
bool m_pt
Definition: L1TopoROD.h:56
L1Topo::decode
uint32_t decode(const uint32_t &word, const uint32_t &offset, const uint32_t &size)
Helper function to decode word based on offset and size.
Definition: Trigger/TrigT1/L1Topo/L1TopoRDO/src/Helpers.cxx:107
L1Topo::L1TopoROD
Definition: L1TopoROD.h:14
L1Topo::L1TopoROD::L1TopoROD
L1TopoROD(const uint32_t trailer1, const uint32_t trailer2)
Construct from contents and decode trailers.
Definition: L1TopoROD.cxx:11
L1Topo::L1TopoROD::m_rodTrailer2
uint32_t m_rodTrailer2
Definition: L1TopoROD.h:41
L1Topo::L1TopoROD::hm
bool hm() const
Definition: L1TopoROD.cxx:85
L1Topo::L1TopoROD::shelf
uint32_t shelf() const
Definition: L1TopoROD.cxx:41
L1Topo::L1TopoROD::linkErrMap
uint32_t linkErrMap() const
Definition: L1TopoROD.cxx:49
L1Topo::L1TopoROD::m_payloadLength
uint32_t m_payloadLength
Definition: L1TopoROD.h:46
L1Topo::L1TopoROD::m_linkErrMap
uint32_t m_linkErrMap
Definition: L1TopoROD.h:45
L1Topo::L1TopoROD::m_rod
uint32_t m_rod
Definition: L1TopoROD.h:44
L1Topo::L1TopoROD::m_lm
bool m_lm
Definition: L1TopoROD.h:54
L1Topo::L1TopoROD::m_hm
bool m_hm
Definition: L1TopoROD.h:55
L1Topo::L1TopoROD::decode
void decode()
method used by constructor to decode word
Definition: L1TopoROD.cxx:16
L1Topo::L1TopoROD::linkErrs
bool linkErrs() const
Definition: L1TopoROD.cxx:61
L1Topo::L1TopoROD::hc
bool hc() const
Definition: L1TopoROD.cxx:73
L1Topo::L1TopoROD::crc
uint32_t crc() const
Definition: L1TopoROD.cxx:57
L1Topo
Definition: BlockTypes.h:11
L1Topo::L1TopoROD::rod
uint32_t rod() const
Definition: L1TopoROD.cxx:45
L1Topo::L1TopoROD::rodTrailer1
uint32_t rodTrailer1() const
access methods
Definition: L1TopoROD.cxx:33
Helpers.h