ATLAS Offline Software
L1TopoFPGA.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/L1TopoFPGA.h"
7 #include "L1TopoRDO/Helpers.h"
8 
9 namespace L1Topo {
10 
11  L1TopoFPGA::L1TopoFPGA(const uint32_t trailer1, const uint32_t trailer2)
12  :m_fpgaTrailer1(trailer1), m_fpgaTrailer2(trailer2) {
13  this->decode();
14  }
15 
23  m_ct = (L1Topo::decode(m_fpgaTrailer2,5,1) & 0x1) != 0;
24  m_sm = (L1Topo::decode(m_fpgaTrailer2,4,1) & 0x1) != 0;
25  m_pe = (L1Topo::decode(m_fpgaTrailer2,3,1) & 0x1) != 0;
26  m_lm = (L1Topo::decode(m_fpgaTrailer2,2,1) & 0x1) != 0;
27  m_hm = (L1Topo::decode(m_fpgaTrailer2,1,1) & 0x1) != 0;
28  m_pt = (L1Topo::decode(m_fpgaTrailer2,0,1) & 0x1) != 0;
29  }
30 
32  return m_fpgaTrailer1;
33  }
34 
36  return m_fpgaTrailer2;
37  }
38 
39  size_t L1TopoFPGA::fpgaBlockSize() const{
40  return m_fpgaBlockSize;
41  }
42 
44  return m_topoNumber;
45  }
46 
48  return m_fpgaNumber;
49  }
50 
52  return m_numSlices;
53  }
54 
56  return m_sliceNumber;
57  }
58 
60  return m_crc;
61  }
62 
63 
64  bool L1TopoFPGA::ct() const{
65  return m_ct;
66  }
67 
68  bool L1TopoFPGA::sm() const{
69  return m_sm;
70  }
71 
72  bool L1TopoFPGA::pe() const{
73  return m_pe;
74  }
75 
76  bool L1TopoFPGA::lm() const{
77  return m_lm;
78  }
79 
80  bool L1TopoFPGA::hm() const{
81  return m_hm;
82  }
83 
84  bool L1TopoFPGA::pt() const{
85  return m_pt;
86  }
87 
88  std::ostream& operator<<(std::ostream& os, const L1TopoFPGA& s) {
89  os << std::hex << std::showbase << s.fpgaTrailer1() << std::dec <<
90  " Block Size= " << s.fpgaBlockSize() << " topoNumber= " << s.topoNumber() <<
91  " fpgaNumber= " << s.fpgaNumber() << " numSlices= " << s.numSlices() <<
92  " sliceNumber= " << s.sliceNumber() <<
93  "\n" <<
94  std::hex << std::showbase << s.fpgaTrailer2() << std::dec <<
95  " CRC= " << s.crc() <<
96  " Errors: CT= " << s.ct() << " sm= " << s.sm() <<
97  " pe= " <<s.pe() << " lm= " << s.lm() << " hm= " << s.hm() << " pt= " << s.pt() <<
98  std::dec << "\n";
99  return os;
100  }
101 
102 } // namespace L1Topo
103 
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
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
L1Topo::L1TopoFPGA::m_fpgaBlockSize
size_t m_fpgaBlockSize
Definition: L1TopoFPGA.h:42
L1Topo::L1TopoFPGA::m_ct
bool m_ct
Definition: L1TopoFPGA.h:50
L1Topo::L1TopoFPGA::pt
bool pt() const
Definition: L1TopoFPGA.cxx:84
L1Topo::L1TopoFPGA::m_pt
bool m_pt
Definition: L1TopoFPGA.h:55
L1Topo::L1TopoFPGA::m_lm
bool m_lm
Definition: L1TopoFPGA.h:53
L1Topo::L1TopoFPGA::L1TopoFPGA
L1TopoFPGA(const uint32_t trailer1, const uint32_t trailer2)
Construct from contents and decode trailers.
Definition: L1TopoFPGA.cxx:11
L1Topo::L1TopoFPGA::pe
bool pe() const
Definition: L1TopoFPGA.cxx:72
L1Topo::L1TopoFPGA::m_sliceNumber
uint32_t m_sliceNumber
Definition: L1TopoFPGA.h:47
L1Topo::L1TopoFPGA::sliceNumber
uint32_t sliceNumber() const
Definition: L1TopoFPGA.cxx:55
L1Topo::L1TopoFPGA::hm
bool hm() const
Definition: L1TopoFPGA.cxx:80
L1Topo::L1TopoFPGA::m_crc
uint32_t m_crc
Definition: L1TopoFPGA.h:48
L1Topo::L1TopoFPGA::m_sm
bool m_sm
Definition: L1TopoFPGA.h:51
L1Topo::L1TopoFPGA::numSlices
uint32_t numSlices() const
Definition: L1TopoFPGA.cxx:51
L1TopoFPGA.h
L1Topo::L1TopoFPGA::m_numSlices
uint32_t m_numSlices
Definition: L1TopoFPGA.h:46
L1Topo::L1TopoFPGA::sm
bool sm() const
Definition: L1TopoFPGA.cxx:68
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
L1Topo::L1TopoFPGA::m_fpgaTrailer1
uint32_t m_fpgaTrailer1
variables
Definition: L1TopoFPGA.h:39
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::L1TopoFPGA::fpgaBlockSize
size_t fpgaBlockSize() const
Definition: L1TopoFPGA.cxx:39
L1Topo::L1TopoFPGA::fpgaTrailer1
uint32_t fpgaTrailer1() const
access methods
Definition: L1TopoFPGA.cxx:31
L1Topo::L1TopoFPGA::crc
uint32_t crc() const
Definition: L1TopoFPGA.cxx:59
L1Topo::L1TopoFPGA::fpgaNumber
uint32_t fpgaNumber() const
Definition: L1TopoFPGA.cxx:47
L1Topo::L1TopoFPGA::m_fpgaTrailer2
uint32_t m_fpgaTrailer2
Definition: L1TopoFPGA.h:40
L1Topo::L1TopoFPGA::m_topoNumber
uint32_t m_topoNumber
Definition: L1TopoFPGA.h:44
L1Topo::L1TopoFPGA::m_hm
bool m_hm
Definition: L1TopoFPGA.h:54
L1Topo::L1TopoFPGA::lm
bool lm() const
Definition: L1TopoFPGA.cxx:76
L1Topo
Definition: BlockTypes.h:11
L1Topo::L1TopoFPGA
Definition: L1TopoFPGA.h:14
L1Topo::L1TopoFPGA::decode
void decode()
method used by constructor to decode word
Definition: L1TopoFPGA.cxx:16
L1Topo::L1TopoFPGA::topoNumber
uint32_t topoNumber() const
Definition: L1TopoFPGA.cxx:43
L1Topo::L1TopoFPGA::m_pe
bool m_pe
Definition: L1TopoFPGA.h:52
Helpers.h
L1Topo::L1TopoFPGA::fpgaTrailer2
uint32_t fpgaTrailer2() const
Definition: L1TopoFPGA.cxx:35
L1Topo::L1TopoFPGA::m_fpgaNumber
uint32_t m_fpgaNumber
Definition: L1TopoFPGA.h:45
L1Topo::L1TopoFPGA::ct
bool ct() const
Definition: L1TopoFPGA.cxx:64