ATLAS Offline Software
JetCMXTopoData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Local include(s):
7 
8 
9 namespace LVL1 {
10 
12  const unsigned int JetCMXTopoData::s_maxTOBsPerLink;
13  const unsigned int JetCMXTopoData::s_maxTOBsPerJem;
14 
16  JetCMXTopoData::JetCMXTopoData( int crate, bool overflow, const std::vector< uint32_t >& tobWords )
17  : m_crate( crate ), m_overflow( overflow ),
18  m_jem_overflow(false)
19  {
20 
21  m_tobWords.clear();
22  for (std::vector<uint32_t>::const_iterator it = tobWords.begin(); it != tobWords.end(); ++it) {
23  if (m_tobWords.size() < s_maxTOBsPerLink) m_tobWords.push_back( (*it) );
24  else m_overflow = true;
25  }
27  }
28 
29 
30  JetCMXTopoData::JetCMXTopoData( int crate, bool overflow, const std::vector< JetTopoTOB >& tobs )
31  : m_crate( crate ), m_overflow( overflow ),
32  m_jem_overflow(false)
33  {
34 
35  m_tobWords.clear();
36  for (std::vector<JetTopoTOB>::const_iterator it = tobs.begin(); it != tobs.end(); ++it) {
37  if (m_tobWords.size() < s_maxTOBsPerLink) m_tobWords.push_back( (*it).tobWord() );
38  else m_overflow = true;
39  }
41  }
42 
43 
44  JetCMXTopoData::JetCMXTopoData( int crate, const std::vector< uint32_t >& roiWords )
45  : m_crate( crate ),
46  m_jem_overflow(false)
47  {
48 
49  m_overflow = false;
50  m_tobWords.clear();
51 
52  for (std::vector<uint32_t>::const_iterator it = roiWords.begin(); it != roiWords.end(); ++it) {
53  JetTopoTOB tob((*it));
54  if (tob.crate() == m_crate) m_tobWords.push_back( tob.tobWord() );
55  }
57  }
58 
59 
61  : m_crate( crate ), m_overflow( false ),
62  m_jem_overflow(false)
63  {
64  m_tobWords.clear();
65  }
66 
67 
69  : m_crate( 0 ), m_overflow ( false ),
70  m_jem_overflow(false)
71  {
72  m_tobWords.clear();
73  }
74 
75 
78  }
79 
80 
82  void JetCMXTopoData::addTOB( const JetTopoTOB tob ) {
83  if (m_tobWords.size() < s_maxTOBsPerLink)
84  m_tobWords.push_back(tob.tobWord());
85  else m_overflow = true;
86  }
87 
88 
90  void JetCMXTopoData::addTOB( uint32_t tobWord ) {
91  if (m_tobWords.size() < s_maxTOBsPerLink) m_tobWords.push_back( tobWord );
92  else m_overflow = true;
93  }
94 
97  JetTopoTOB tob(roiWord);
98  if (tob.crate() == m_crate) m_tobWords.push_back( tob.tobWord() );
99  }
100 
101 
103  void JetCMXTopoData::setOverflow( bool overflow ) {
105  }
106 
107 
109  int JetCMXTopoData::crate() const {
110  return m_crate;
111  }
112 
113 
115  if ( m_overflow ||
116  (m_tobWords.size() > s_maxTOBsPerLink) ||
117  m_jem_overflow ) return true;
118  return false;
119  }
120 
121 
122  const std::vector< uint32_t >& JetCMXTopoData::tobWords() const {
123  return m_tobWords;
124  }
125 
126 
127  void JetCMXTopoData::tobs(std::vector< JetTopoTOB >& tobs) const {
128  tobs.clear();
129 
130  std::vector< uint32_t >::const_iterator it = m_tobWords.begin();
131  for ( ; it != m_tobWords.end(); ++it)
132  tobs.push_back(JetTopoTOB(m_crate, (*it)));
133 
134  return;
135  }
136 
138 {
139  const size_t max_jem_index = 15; // as indicated in JetTopoTOB::jem()
140  std::vector<uint32_t> counters_tob_per_jem(max_jem_index, 0);
141  for(const uint32_t word : m_tobWords) {
142  JetTopoTOB tob(m_crate, word);
143  const size_t iJem = tob.jem();
144  counters_tob_per_jem[iJem] += 1;
145  }
147  std::any_of(counters_tob_per_jem.begin(),
148  counters_tob_per_jem.end(),
149  [](const uint32_t &c) { return (c >= s_maxTOBsPerJem); }));
150  return *this;
151 }
152 
153 
154 } // namespace bracket
LVL1::JetCMXTopoData::tobWords
const std::vector< uint32_t > & tobWords() const
Return vector of TOB words.
Definition: JetCMXTopoData.cxx:122
LVL1::JetTopoTOB::tobWord
uint32_t tobWord() const
Return packed TOB word.
Definition: JetTopoTOB.h:129
LVL1::JetCMXTopoData::~JetCMXTopoData
~JetCMXTopoData()
Destructor.
Definition: JetCMXTopoData.cxx:77
JetCMXTopoData.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1::JetCMXTopoData::s_maxTOBsPerLink
static const unsigned int s_maxTOBsPerLink
Static constants.
Definition: JetCMXTopoData.h:69
LVL1::JetCMXTopoData::overflow
bool overflow() const
Return overflow flag.
Definition: JetCMXTopoData.cxx:114
skel.it
it
Definition: skel.GENtoEVGEN.py:396
LVL1::JetTopoTOB::jem
int jem() const
Return JEM number (0-15)
Definition: JetTopoTOB.h:104
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::JetCMXTopoData::tobs
void tobs(std::vector< JetTopoTOB > &tobs) const
Return vector of TOBs.
Definition: JetCMXTopoData.cxx:127
LVL1::JetCMXTopoData::s_maxTOBsPerJem
static const unsigned int s_maxTOBsPerJem
as specified in BackplaneFormats_v3.xlsx
Definition: JetCMXTopoData.h:70
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
LVL1::JetCMXTopoData::m_crate
int m_crate
Data members.
Definition: JetCMXTopoData.h:64
LVL1::JetCMXTopoData::m_jem_overflow
bool m_jem_overflow
overflow on JEM -> CMX transmission
Definition: JetCMXTopoData.h:66
LVL1::JetCMXTopoData::addTOB
void addTOB(const JetTopoTOB tob)
Add TOB to record.
Definition: JetCMXTopoData.cxx:82
LVL1::JetTopoTOB
Jet TOB data for L1Topo.
Definition: JetTopoTOB.h:19
LVL1::JetCMXTopoData::addRoI
void addRoI(uint32_t roiWord)
Add TOB from RoI word.
Definition: JetCMXTopoData.cxx:96
LVL1::JetCMXTopoData
Definition: JetCMXTopoData.h:22
LVL1::JetCMXTopoData::m_tobWords
std::vector< uint32_t > m_tobWords
Definition: JetCMXTopoData.h:67
LVL1::JetTopoTOB::crate
int crate() const
Return crate number (0-3)
Definition: JetTopoTOB.h:99
LVL1::JetCMXTopoData::checkJemOverflow
JetCMXTopoData & checkJemOverflow()
count whether any transmission JEM -> CMX had too many TOBs
Definition: JetCMXTopoData.cxx:137
LVL1::JetCMXTopoData::m_overflow
bool m_overflow
overflow on CMX -> L1Topo transmission
Definition: JetCMXTopoData.h:65
LVL1::JetCMXTopoData::JetCMXTopoData
JetCMXTopoData()
Default constructor.
Definition: JetCMXTopoData.cxx:68
LVL1::JetCMXTopoData::crate
int crate() const
Return crate number (0-1)
Definition: JetCMXTopoData.cxx:109
LVL1::JetCMXTopoData::setOverflow
void setOverflow(bool overflow)
Set overflow flag.
Definition: JetCMXTopoData.cxx:103
python.compressB64.c
def c
Definition: compressB64.py:93