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

Private Attributes

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

Static Private Attributes

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

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 }
const std::vector< uint32_t > & tobWords() const
Return vector of TOB words.
int m_crate
Data members.
int crate() const
Return crate number (0-3)
bool overflow() const
Return overflow flag.
int cmx() const
Return CMX number (0 = EM, 1 = TAU)
std::vector< uint32_t > m_tobWords
CPCMXTopoData & checkCpmOverflow()
count whether any transmission CPM -> CMX had too many TOBs
bool m_cpm_overflow
overflow on CPM -> CMX transmission
static const unsigned int s_maxTOBsPerLink
Static constants.
bool m_overflow
overflow on CMX -> L1Topo transmission

◆ 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 }
void tobs(std::vector< CPTopoTOB > &tobs) const
Fill a vector of TOBs.

◆ 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: