ATLAS Offline Software
Loading...
Searching...
No Matches
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>
7#include "L1TopoRDO/Helpers.h"
8
9namespace 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
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
32 uint32_t L1TopoFPGA::fpgaTrailer1() const{
33 return m_fpgaTrailer1;
34 }
35
36 uint32_t L1TopoFPGA::fpgaTrailer2() const{
37 return m_fpgaTrailer2;
38 }
39
41 return m_fpgaBlockSize;
42 }
43
44 uint32_t L1TopoFPGA::topoNumber() const{
45 return m_topoNumber;
46 }
47
48 uint32_t L1TopoFPGA::fpgaNumber() const{
49 return m_fpgaNumber;
50 }
51
52 uint32_t L1TopoFPGA::numSlices() const{
53 return m_numSlices;
54 }
55
56 uint32_t L1TopoFPGA::sliceNumber() const{
57 return m_sliceNumber;
58 }
59
60 uint32_t L1TopoFPGA::crc() const{
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
uint32_t m_fpgaNumber
Definition L1TopoFPGA.h:45
uint32_t m_fpgaTrailer2
Definition L1TopoFPGA.h:40
bool sm() const
uint32_t fpgaNumber() const
void decode()
method used by constructor to decode word
uint32_t m_sliceNumber
Definition L1TopoFPGA.h:47
uint32_t crc() const
size_t fpgaBlockSize() const
uint32_t fpgaTrailer1() const
access methods
bool ct() const
L1TopoFPGA(const uint32_t trailer1, const uint32_t trailer2)
Construct from contents and decode trailers.
uint32_t topoNumber() const
bool lm() const
bool pe() const
uint32_t m_fpgaTrailer1
variables
Definition L1TopoFPGA.h:39
uint32_t m_topoNumber
Definition L1TopoFPGA.h:44
uint32_t fpgaTrailer2() const
bool pt() const
uint32_t numSlices() const
uint32_t m_numSlices
Definition L1TopoFPGA.h:46
uint32_t sliceNumber() const
bool hm() const
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.
std::ostream & operator<<(std::ostream &, const Error)
Helper to print errors as text rather than numbers.
Definition Error.cxx:8