ATLAS Offline Software
Loading...
Searching...
No Matches
L1Topo/L1TopoRDO/src/L1TopoResult.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "L1TopoRDO/Helpers.h"
7
8
9namespace L1Topo {
10
14
20
23
25 {
26 m_overflows.reset();
27 m_decisions.reset();
28 m_l1topoROD.clear();
29 m_l1topoFPGA.clear();
30 for(const xAOD::L1TopoRawData* l1topo_raw : container) {
31 const std::vector<uint32_t>& dataWords = l1topo_raw->dataWords();
32 size_t nWords = dataWords.size();
33 if (nWords!=50) {
34 m_status = false;
35 return;
36 }else {
37 m_status = true;
38 }
39 uint32_t rodTrailer2 = dataWords[--nWords];
40 uint32_t rodTrailer1 = dataWords[--nWords];
41
42 m_l1topoROD.emplace_back(new L1Topo::L1TopoROD(rodTrailer1, rodTrailer2));
43
44
45 for (size_t i = nWords; i --> 0;) {
46 if ((i+1)%8==0) {
47 uint32_t fpgaTrailer2 = dataWords[i];
48 uint32_t fpgaTrailer1 = dataWords[--i];
49
50 m_l1topoFPGA.emplace_back(new L1Topo::L1TopoFPGA(fpgaTrailer1, fpgaTrailer2));
51
52 }
53 else {
54 if (m_l1topoFPGA.back()->topoNumber() != 1) {
55 i-=3;
56 uint32_t overflowWord = dataWords[--i];
57 uint32_t triggerWord = dataWords[--i];
58 for (size_t iBit=0;iBit<32;iBit++) {
59 uint32_t topo = m_l1topoFPGA.back()->topoNumber();
60 uint32_t fpga = m_l1topoFPGA.back()->fpgaNumber();
61 unsigned int index = L1Topo::triggerBitIndexPhase1(topo, fpga, iBit);
62 m_overflows[index] = (overflowWord>>iBit)&1;
63 m_decisions[index] = (triggerWord>>iBit)&1;
64 }
65 } // Decision & overflow
66 else {
67 if (m_l1topoFPGA.back()->fpgaNumber() == 1) {
68 m_topo1opt3.reset(); m_topo1opt2.reset();
69 for (size_t k=0;k<3;k++) {
70 uint32_t word = dataWords[i];
71 for (size_t iBit=0;iBit<32;iBit++) {
72 size_t index = iBit+32*(2-k);
73 m_topo1opt3[index] = (word>>iBit)&1;
74 }
75 i--;
76 }
77 for (size_t k=0;k<3;k++) {
78 uint32_t word = dataWords[i];
79 for (size_t iBit=0;iBit<32;iBit++) {
80 size_t index = iBit+32*(2-k);
81 m_topo1opt2[index] = (word>>iBit)&1;
82 }
83 i--;
84 }
85 i++;
86 } // multiplicity 2-3
87 else {
88 m_topo1opt1.reset(); m_topo1opt0.reset();
89 for (size_t k=0;k<3;k++) {
90 uint32_t word = dataWords[i];
91 for (size_t iBit=0;iBit<32;iBit++) {
92 size_t index = iBit+32*(2-k);
93 m_topo1opt1[index] = (word>>iBit)&1;
94 }
95 i--;
96 }
97 for (size_t k=0;k<3;k++) {
98 uint32_t word = dataWords[i];
99 for (size_t iBit=0;iBit<32;iBit++) {
100 size_t index = iBit+32*(2-k);
101 m_topo1opt0[index] = (word>>iBit)&1;
102 }
103 i--;
104 }
105 i++;
106
107 } // multiplicity 0-1
108
109 } // end of multiplicity
110 } // end of decoding
111 } // end of nwords
112 } // end of container
113
114 }
115
116} // namespace L1Topo
Derived DataVector<T>.
Definition DataVector.h:795
std::bitset< s_nTopoOutputs > m_topo1opt3
std::bitset< s_nTopoOutputs > m_decisions
std::bitset< s_nTopoOutputs > m_topo1opt0
std::vector< std::shared_ptr< L1Topo::L1TopoFPGA > > m_l1topoFPGA
std::bitset< s_nTopoOutputs > m_topo1opt2
std::vector< std::shared_ptr< L1Topo::L1TopoROD > > m_l1topoROD
void decode(const DataVector< xAOD::L1TopoRawData > &container)
method used by constructor to decode xAOD
std::bitset< s_nTopoOutputs > m_overflows
std::bitset< s_nTopoOutputs > m_topo1opt1
unsigned int triggerBitIndexPhase1(uint32_t topo, uint32_t fpga, size_t bitIdx)
Definition index.py:1
L1TopoRawData_v1 L1TopoRawData
Define the latest version of the L1TopoRawData class.