ATLAS Offline Software
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
LVL1::CPCMXTopoData Class Reference

#include <CPCMXTopoData.h>

Collaboration diagram for LVL1::CPCMXTopoData:

Public Member Functions

 CPCMXTopoData (int crate, int cmx, bool overflow, const std::vector< uint32_t > &tobWords)
 Constructor with Crate, CMX numbers, overflow flag and vector of TOB words. More...
 
 CPCMXTopoData (int crate, int cmx, bool overflow, const std::vector< CPTopoTOB > &tobs)
 Constructor with Crate, CMX numbers, overflow flag and TOB vector. More...
 
 CPCMXTopoData (int crate, int cmx, const std::vector< uint32_t > &roiWords)
 Constructor for HLT: Crate, CMX numbers and vector of RoI words. More...
 
 CPCMXTopoData (int crate, int cmx)
 Constructor with Crate, CMX numbers only. More...
 
 CPCMXTopoData ()
 Default constructor. More...
 
 ~CPCMXTopoData ()
 Destructor. More...
 
int crate () const
 Return crate number (0-3) More...
 
int cmx () const
 Return CMX number (0 = EM, 1 = TAU) More...
 
bool overflow () const
 Return overflow flag. More...
 
void tobs (std::vector< CPTopoTOB > &tobs) const
 Fill a vector of TOBs. More...
 
const std::vector< uint32_t > & tobWords () const
 Return vector of TOB words. More...
 
void addTOB (const CPTopoTOB tob)
 Add TOB to record. More...
 
void addTOB (uint32_t tobWord)
 Add another TOB to the collection. More...
 
void addRoI (uint32_t roiWord)
 Add TOB from RoI word. More...
 
void setOverflow (bool overflow)
 Set overflow flag. More...
 
CPCMXTopoDatacheckCpmOverflow ()
 count whether any transmission CPM -> CMX had too many TOBs More...
 

Private Attributes

int m_crate
 Data members. More...
 
int m_cmx
 
bool m_overflow
 overflow on CMX -> L1Topo transmission More...
 
bool m_cpm_overflow
 overflow on CPM -> CMX transmission More...
 
std::vector< uint32_t > m_tobWords
 

Static Private Attributes

static const unsigned int s_maxTOBsPerLink = 30
 Static constants. More...
 
static const unsigned int s_maxTOBsPerCpm = 5
 as specified in BackplaneFormats_v3.xlsx More...
 

Detailed Description

Definition at line 22 of file CPCMXTopoData.h.

Constructor & Destructor Documentation

◆ CPCMXTopoData() [1/5]

LVL1::CPCMXTopoData::CPCMXTopoData ( int  crate,
int  cmx,
bool  overflow,
const std::vector< uint32_t > &  tobWords 
)

Constructor with Crate, CMX numbers, overflow flag and vector of TOB words.

Load complete object in one go.

Definition at line 34 of file CPCMXTopoData.cxx.

36  m_cpm_overflow(false)
37  {
38 
39  m_tobWords.clear();
40  for (std::vector<uint32_t>::const_iterator it = tobWords.begin(); it != tobWords.end(); ++it) {
41  if (m_tobWords.size() < s_maxTOBsPerLink) m_tobWords.push_back( (*it) );
42  else m_overflow = true;
43  }
45  }

◆ CPCMXTopoData() [2/5]

LVL1::CPCMXTopoData::CPCMXTopoData ( int  crate,
int  cmx,
bool  overflow,
const std::vector< CPTopoTOB > &  tobs 
)

Constructor with Crate, CMX numbers, overflow flag and TOB vector.

Constructors.

Load complete object in one go

Definition at line 19 of file CPCMXTopoData.cxx.

21  m_cpm_overflow(false)
22  {
23 
24  m_tobWords.clear();
25  for (std::vector<CPTopoTOB>::const_iterator it = tobs.begin(); it != tobs.end(); ++it) {
26  if (m_tobWords.size() < s_maxTOBsPerLink) m_tobWords.push_back( (*it).tobWord() );
27  else m_overflow = true;
28  }
30  }

◆ CPCMXTopoData() [3/5]

LVL1::CPCMXTopoData::CPCMXTopoData ( int  crate,
int  cmx,
const std::vector< uint32_t > &  roiWords 
)

Constructor for HLT: Crate, CMX numbers and vector of RoI words.

Load complete object in one go.

Definition at line 49 of file CPCMXTopoData.cxx.

50  : m_crate( crate ), m_cmx( cmx ),
51  m_cpm_overflow(false)
52  {
53 
54  m_overflow = false;
55  m_tobWords.clear();
56 
57  for (std::vector<uint32_t>::const_iterator it = roiWords.begin(); it != roiWords.end(); ++it) {
58  CPTopoTOB tob((*it));
59  if (tob.crate() == m_crate && tob.cmx() == m_cmx) m_tobWords.push_back( tob.tobWord() );
60  }
62  }

◆ CPCMXTopoData() [4/5]

LVL1::CPCMXTopoData::CPCMXTopoData ( int  crate,
int  cmx 
)

Constructor with Crate, CMX numbers only.

Create empty object for specified crate and module.

Definition at line 66 of file CPCMXTopoData.cxx.

67  : m_crate( crate ), m_cmx( cmx ), m_overflow( false ),
68  m_cpm_overflow(false)
69  {
70  m_tobWords.clear();
71  }

◆ CPCMXTopoData() [5/5]

LVL1::CPCMXTopoData::CPCMXTopoData ( )

Default constructor.

default constructor

Definition at line 75 of file CPCMXTopoData.cxx.

76  : m_crate( 0 ), m_cmx( 0 ), m_overflow( false ),
77  m_cpm_overflow(false)
78 
79  {
80  m_tobWords.clear();
81  }

◆ ~CPCMXTopoData()

LVL1::CPCMXTopoData::~CPCMXTopoData ( )

Destructor.

Definition at line 85 of file CPCMXTopoData.cxx.

85  {
86  }

Member Function Documentation

◆ addRoI()

void LVL1::CPCMXTopoData::addRoI ( uint32_t  roiWord)

Add TOB from RoI word.

Add another TOB word to the collection.

Note: overflows ignored in this method

Definition at line 104 of file CPCMXTopoData.cxx.

104  {
105 
106  CPTopoTOB tob(roiWord);
107 
108  if (tob.crate() == m_crate && tob.cmx() == m_cmx) m_tobWords.push_back( tob.tobWord() );
109 
110  }

◆ addTOB() [1/2]

void LVL1::CPCMXTopoData::addTOB ( const CPTopoTOB  tob)

Add TOB to record.

Add another TOB word to the collection.

Definition at line 96 of file CPCMXTopoData.cxx.

96  {
97  if (m_tobWords.size() < s_maxTOBsPerLink)
98  m_tobWords.push_back( tob.tobWord() );
99  else m_overflow = true;
100  }

◆ addTOB() [2/2]

void LVL1::CPCMXTopoData::addTOB ( uint32_t  tobWord)

Add another TOB to the collection.

Definition at line 89 of file CPCMXTopoData.cxx.

89  {
90  if (m_tobWords.size() < s_maxTOBsPerLink) m_tobWords.push_back(tobWord);
91  else m_overflow = true;
92  }

◆ checkCpmOverflow()

CPCMXTopoData & LVL1::CPCMXTopoData::checkCpmOverflow ( )

count whether any transmission CPM -> CMX had too many TOBs

In which case toggle m_cpm_overflow

Definition at line 153 of file CPCMXTopoData.cxx.

154 {
155  const size_t max_cpm_index = 14; // as indicated in CPTopoTOB::cpm(), but we start from 0, not 1
156  std::vector<uint32_t> counters_tob_per_cpm(max_cpm_index, 0);
157  for(const uint32_t word : m_tobWords) {
158  CPTopoTOB tob(m_crate, m_cmx, word);
159  const size_t iCpm = tob.cpm()-1;
160  const bool icpmValid = iCpm < counters_tob_per_cpm.size();
161  if(icpmValid) {
162  counters_tob_per_cpm[iCpm] += 1;
163  } else {
164  /*
165  // cout discouraged in athena, but this occurrence is
166  // rare and not deemed to deserve Athena::MsgStreamMember
167  cout<<"CPCMXTopoData::checkCpmOverflow :"
168  <<" invalid iCpm "<<iCpm<<","
169  <<" vector size is "<<counters_tob_per_cpm.size()
170  <<endl;
171  */
172  }
173  }
175  std::any_of(counters_tob_per_cpm.begin(),
176  counters_tob_per_cpm.end(),
177  [](const uint32_t &c) { return (c >= s_maxTOBsPerCpm); }));
178  return *this;
179 }

◆ cmx()

int LVL1::CPCMXTopoData::cmx ( ) const

Return CMX number (0 = EM, 1 = TAU)

Definition at line 125 of file CPCMXTopoData.cxx.

125  {
126  return m_cmx;
127  }

◆ crate()

int LVL1::CPCMXTopoData::crate ( ) const

Return crate number (0-3)

Access methods.

Definition at line 120 of file CPCMXTopoData.cxx.

120  {
121  return m_crate;
122  }

◆ overflow()

bool LVL1::CPCMXTopoData::overflow ( ) const

Return overflow flag.

Definition at line 130 of file CPCMXTopoData.cxx.

130  {
131  if ( m_overflow ||
132  (m_tobWords.size() > s_maxTOBsPerLink) ||
133  m_cpm_overflow ) return true;
134  return false;
135  }

◆ setOverflow()

void LVL1::CPCMXTopoData::setOverflow ( bool  overflow)

Set overflow flag.

Definition at line 114 of file CPCMXTopoData.cxx.

114  {
116  }

◆ tobs()

void LVL1::CPCMXTopoData::tobs ( std::vector< CPTopoTOB > &  tobs) const

Fill a vector of TOBs.

Definition at line 143 of file CPCMXTopoData.cxx.

143  {
144  tobs.clear();
145 
146  std::vector< uint32_t >::const_iterator it = m_tobWords.begin();
147  for ( ; it != m_tobWords.end(); ++it)
148  tobs.push_back( CPTopoTOB(m_crate, m_cmx, (*it)) );
149 
150  return;
151  }

◆ tobWords()

const std::vector< uint32_t > & LVL1::CPCMXTopoData::tobWords ( ) const

Return vector of TOB words.

Definition at line 138 of file CPCMXTopoData.cxx.

138  {
139  return m_tobWords;
140  }

Member Data Documentation

◆ m_cmx

int LVL1::CPCMXTopoData::m_cmx
private

Definition at line 66 of file CPCMXTopoData.h.

◆ m_cpm_overflow

bool LVL1::CPCMXTopoData::m_cpm_overflow
private

overflow on CPM -> CMX transmission

Definition at line 68 of file CPCMXTopoData.h.

◆ m_crate

int LVL1::CPCMXTopoData::m_crate
private

Data members.

Definition at line 65 of file CPCMXTopoData.h.

◆ m_overflow

bool LVL1::CPCMXTopoData::m_overflow
private

overflow on CMX -> L1Topo transmission

Definition at line 67 of file CPCMXTopoData.h.

◆ m_tobWords

std::vector< uint32_t > LVL1::CPCMXTopoData::m_tobWords
private

Definition at line 69 of file CPCMXTopoData.h.

◆ s_maxTOBsPerCpm

const unsigned int LVL1::CPCMXTopoData::s_maxTOBsPerCpm = 5
staticprivate

as specified in BackplaneFormats_v3.xlsx

Definition at line 72 of file CPCMXTopoData.h.

◆ s_maxTOBsPerLink

const unsigned int LVL1::CPCMXTopoData::s_maxTOBsPerLink = 30
staticprivate

Static constants.

Definition at line 71 of file CPCMXTopoData.h.


The documentation for this class was generated from the following files:
LVL1::CPCMXTopoData::tobWords
const std::vector< uint32_t > & tobWords() const
Return vector of TOB words.
Definition: CPCMXTopoData.cxx:138
LVL1::CPCMXTopoData::crate
int crate() const
Return crate number (0-3)
Definition: CPCMXTopoData.cxx:120
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1::CPCMXTopoData::m_cpm_overflow
bool m_cpm_overflow
overflow on CPM -> CMX transmission
Definition: CPCMXTopoData.h:68
skel.it
it
Definition: skel.GENtoEVGEN.py:396
LVL1::CPCMXTopoData::m_cmx
int m_cmx
Definition: CPCMXTopoData.h:66
LVL1::CPCMXTopoData::s_maxTOBsPerLink
static const unsigned int s_maxTOBsPerLink
Static constants.
Definition: CPCMXTopoData.h:71
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
LVL1::CPCMXTopoData::m_crate
int m_crate
Data members.
Definition: CPCMXTopoData.h:65
LVL1::CPCMXTopoData::cmx
int cmx() const
Return CMX number (0 = EM, 1 = TAU)
Definition: CPCMXTopoData.cxx:125
LVL1::CPCMXTopoData::overflow
bool overflow() const
Return overflow flag.
Definition: CPCMXTopoData.cxx:130
LVL1::CPCMXTopoData::m_tobWords
std::vector< uint32_t > m_tobWords
Definition: CPCMXTopoData.h:69
LVL1::CPCMXTopoData::tobs
void tobs(std::vector< CPTopoTOB > &tobs) const
Fill a vector of TOBs.
Definition: CPCMXTopoData.cxx:143
LVL1::CPCMXTopoData::checkCpmOverflow
CPCMXTopoData & checkCpmOverflow()
count whether any transmission CPM -> CMX had too many TOBs
Definition: CPCMXTopoData.cxx:153
python.compressB64.c
def c
Definition: compressB64.py:93
LVL1::CPCMXTopoData::m_overflow
bool m_overflow
overflow on CMX -> L1Topo transmission
Definition: CPCMXTopoData.h:67