ATLAS Offline Software
L1TopoFPGA.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 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 
17  // See https://twiki.cern.ch/twiki/bin/view/Atlas/L1CaloBytestreamDecoders#jFEX_System
23  m_crc = L1Topo::decode(m_fpgaTrailer2,12,0xfffff);
24  m_ct = (L1Topo::decode(m_fpgaTrailer2,5,1) & 0x1) != 0;
25  m_sm = (L1Topo::decode(m_fpgaTrailer2,4,1) & 0x1) != 0;
26  m_pe = (L1Topo::decode(m_fpgaTrailer2,3,1) & 0x1) != 0;
27  m_lm = (L1Topo::decode(m_fpgaTrailer2,2,1) & 0x1) != 0;
28  m_hm = (L1Topo::decode(m_fpgaTrailer2,1,1) & 0x1) != 0;
29  m_pt = (L1Topo::decode(m_fpgaTrailer2,0,1) & 0x1) != 0;
30  }
31 
33  return m_fpgaTrailer1;
34  }
35 
37  return m_fpgaTrailer2;
38  }
39 
40  size_t L1TopoFPGA::fpgaBlockSize() const{
41  return m_fpgaBlockSize;
42  }
43 
45  return m_topoNumber;
46  }
47 
49  return m_fpgaNumber;
50  }
51 
53  return m_numSlices;
54  }
55 
57  return m_sliceNumber;
58  }
59 
61  return m_crc;
62  }
63 
64 
65  bool L1TopoFPGA::ct() const{
66  return m_ct;
67  }
68 
69  bool L1TopoFPGA::sm() const{
70  return m_sm;
71  }
72 
73  bool L1TopoFPGA::pe() const{
74  return m_pe;
75  }
76 
77  bool L1TopoFPGA::lm() const{
78  return m_lm;
79  }
80 
81  bool L1TopoFPGA::hm() const{
82  return m_hm;
83  }
84 
85  bool L1TopoFPGA::pt() const{
86  return m_pt;
87  }
88 
89  std::ostream& operator<<(std::ostream& os, const L1TopoFPGA& s) {
90  os << std::hex << std::showbase << s.fpgaTrailer1() << std::dec <<
91  " Block Size= " << s.fpgaBlockSize() << " topoNumber= " << s.topoNumber() <<
92  " fpgaNumber= " << s.fpgaNumber() << " numSlices= " << s.numSlices() <<
93  " sliceNumber= " << s.sliceNumber() <<
94  "\n" <<
95  std::hex << std::showbase << s.fpgaTrailer2() << std::dec <<
96  " CRC= " << s.crc() <<
97  " Errors: CT= " << s.ct() << " sm= " << s.sm() <<
98  " pe= " <<s.pe() << " lm= " << s.lm() << " hm= " << s.hm() << " pt= " << s.pt() <<
99  std::dec << "\n";
100  return os;
101  }
102 
103 } // namespace L1Topo
104 
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:85
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:73
L1Topo::L1TopoFPGA::m_sliceNumber
uint32_t m_sliceNumber
Definition: L1TopoFPGA.h:47
L1Topo::L1TopoFPGA::sliceNumber
uint32_t sliceNumber() const
Definition: L1TopoFPGA.cxx:56
L1Topo::L1TopoFPGA::hm
bool hm() const
Definition: L1TopoFPGA.cxx:81
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:52
L1TopoFPGA.h
L1Topo::L1TopoFPGA::m_numSlices
uint32_t m_numSlices
Definition: L1TopoFPGA.h:46
L1Topo::L1TopoFPGA::sm
bool sm() const
Definition: L1TopoFPGA.cxx:69
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:40
L1Topo::L1TopoFPGA::fpgaTrailer1
uint32_t fpgaTrailer1() const
access methods
Definition: L1TopoFPGA.cxx:32
L1Topo::L1TopoFPGA::crc
uint32_t crc() const
Definition: L1TopoFPGA.cxx:60
L1Topo::L1TopoFPGA::fpgaNumber
uint32_t fpgaNumber() const
Definition: L1TopoFPGA.cxx:48
L1Topo::L1TopoFPGA::m_fpgaTrailer2
uint32_t m_fpgaTrailer2
Definition: L1TopoFPGA.h:40
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
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:77
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:44
L1Topo::L1TopoFPGA::m_pe
bool m_pe
Definition: L1TopoFPGA.h:52
Helpers.h
L1Topo::L1TopoFPGA::fpgaTrailer2
uint32_t fpgaTrailer2() const
Definition: L1TopoFPGA.cxx:36
L1Topo::L1TopoFPGA::m_fpgaNumber
uint32_t m_fpgaNumber
Definition: L1TopoFPGA.h:45
L1Topo::L1TopoFPGA::ct
bool ct() const
Definition: L1TopoFPGA.cxx:65