ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::EnergyTopoData Class Reference

This class defines the Ex/Ey/ET data transferred from the EnergySum CMX to the L1Topo processors. More...

#include <EnergyTopoData.h>

Inheritance diagram for LVL1::EnergyTopoData:
Collaboration diagram for LVL1::EnergyTopoData:

Public Types

enum  SumTypes { Normal = 0 , Restricted = 1 }

Public Member Functions

 EnergyTopoData (unsigned int word0, unsigned int word1, unsigned int word2)
 constructor
 EnergyTopoData ()=default
void addEx (unsigned int Ex, unsigned int overflow, int type)
 add data.
void addEy (unsigned int Ey, unsigned int overflow, int type)
void addEt (unsigned int Et, unsigned int overflow, int type)
void addRoI (uint32_t roiWord)
 add data using RoI word
void addRoIs (const std::vector< uint32_t > &roiWords)
unsigned int word0 () const
 return word 0
unsigned int word1 () const
 return word 1
unsigned int word2 () const
 return word 2
int Ex (SumTypes type=LVL1::EnergyTopoData::Normal) const
 return Ex, Ey, ET values
int Ey (SumTypes type=LVL1::EnergyTopoData::Normal) const
 Ey (signed)
int Et (SumTypes type=LVL1::EnergyTopoData::Normal) const
 ET Sum.
int ExTC (SumTypes type=LVL1::EnergyTopoData::Normal) const
 return twos-complement Ex, Ey values
int EyTC (SumTypes type=LVL1::EnergyTopoData::Normal) const
 Ey (twos complement)
unsigned int ExOverflow (SumTypes type=LVL1::EnergyTopoData::Normal) const
 return overflow flags
unsigned int EyOverflow (SumTypes type=LVL1::EnergyTopoData::Normal) const
unsigned int EtOverflow (SumTypes type=LVL1::EnergyTopoData::Normal) const

Private Member Functions

int decodeTC (unsigned int word) const
 Decode 15-bit twos-complement values.

Private Attributes

unsigned int m_word0 {}
unsigned int m_word1 {}
unsigned int m_word2 {}

Detailed Description

This class defines the Ex/Ey/ET data transferred from the EnergySum CMX to the L1Topo processors.

Definition at line 26 of file EnergyTopoData.h.

Member Enumeration Documentation

◆ SumTypes

Enumerator
Normal 
Restricted 

Definition at line 29 of file EnergyTopoData.h.

Constructor & Destructor Documentation

◆ EnergyTopoData() [1/2]

LVL1::EnergyTopoData::EnergyTopoData ( unsigned int word0,
unsigned int word1,
unsigned int word2 )

constructor

Definition at line 10 of file EnergyTopoData.cxx.

10 :
14{
15}
unsigned int word2() const
return word 2
unsigned int word1() const
return word 1
unsigned int word0() const
return word 0

◆ EnergyTopoData() [2/2]

LVL1::EnergyTopoData::EnergyTopoData ( )
default

Member Function Documentation

◆ addEt()

void LVL1::EnergyTopoData::addEt ( unsigned int Et,
unsigned int overflow,
int type )

Definition at line 37 of file EnergyTopoData.cxx.

37 {
38 unsigned int word = (Et&0x7fff) + (overflow<<15);
39
41 m_word2 = (m_word2&0xffff0000) + (word&0xffff);
42 else if (type == LVL1::EnergyTopoData::Restricted)
43 m_word2 = (m_word2&0xffff) + ( (word&0xffff)<<16 );
44}
int Et(SumTypes type=LVL1::EnergyTopoData::Normal) const
ET Sum.

◆ addEx()

void LVL1::EnergyTopoData::addEx ( unsigned int Ex,
unsigned int overflow,
int type )

add data.

Adding to or modifying data.

Ex/Ey values should be in 15 bit twos-complement format

Definition at line 19 of file EnergyTopoData.cxx.

19 {
20 unsigned int word = (Ex&0x7fff) + (overflow<<15);
21
23 m_word0 = (m_word0&0xffff0000) + (word&0xffff);
24 else if (type == LVL1::EnergyTopoData::Restricted)
25 m_word0 = (m_word0&0xffff) + ( (word&0xffff)<<16 );
26}
int Ex(SumTypes type=LVL1::EnergyTopoData::Normal) const
return Ex, Ey, ET values

◆ addEy()

void LVL1::EnergyTopoData::addEy ( unsigned int Ey,
unsigned int overflow,
int type )

Definition at line 28 of file EnergyTopoData.cxx.

28 {
29 unsigned int word = (Ey&0x7fff) + (overflow<<15);
30
32 m_word1 = (m_word1&0xffff0000) + (word&0xffff);
33 else if (type == LVL1::EnergyTopoData::Restricted)
34 m_word1 = (m_word1&0xffff) + ( (word&0xffff)<<16 );
35}
int Ey(SumTypes type=LVL1::EnergyTopoData::Normal) const
Ey (signed)

◆ addRoI()

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

add data using RoI word

Definition at line 46 of file EnergyTopoData.cxx.

46 {
47 uint8_t header = (roiWord>>28);
48 uint8_t type = (roiWord>>26)&1;
49 uint32_t payload = (roiWord&0xffff);
50
51 if (header == 4) {
52 if (type == LVL1::EnergyTopoData::Normal) m_word0 = (m_word0&0xffff0000) + payload;
53 else if (type == LVL1::EnergyTopoData::Restricted) m_word0 = (m_word0&0xffff) + (payload<<16);
54 }
55 else if (header == 6) {
56 if (type == LVL1::EnergyTopoData::Normal) m_word1 = (m_word1&0xffff0000) + payload;
57 else if (type == LVL1::EnergyTopoData::Restricted) m_word1 = (m_word1&0xffff) + (payload<<16);
58 }
59 else if (header == 5) {
60 if (type == LVL1::EnergyTopoData::Normal) m_word2 = (m_word2&0xffff0000) + payload;
61 else if (type == LVL1::EnergyTopoData::Restricted) m_word2 = (m_word2&0xffff) + (payload<<16);
62 }
63}
setEventNumber uint32_t

◆ addRoIs()

void LVL1::EnergyTopoData::addRoIs ( const std::vector< uint32_t > & roiWords)

Definition at line 65 of file EnergyTopoData.cxx.

65 {
66
67 for (std::vector<uint32_t>::const_iterator it = roiWords.begin(); it != roiWords.end(); ++it) addRoI((*it)) ;
68
69}
void addRoI(uint32_t roiWord)
add data using RoI word

◆ decodeTC()

int LVL1::EnergyTopoData::decodeTC ( unsigned int word) const
private

Decode 15-bit twos-complement values.

Should be redundant

Definition at line 147 of file EnergyTopoData.cxx.

147 {
148
149 word = word & 0x7fff;
150 int value = word;
151
152 int sign = (word >> 14) & 1;
153 if (sign != 0) {
154 int complement = ~word;
155 value = -( (complement+1) & 0x7fff );
156 }
157
158 return value;
159}
int sign(int a)
T complement(const T &v, const unsigned int &p)

◆ Et()

int LVL1::EnergyTopoData::Et ( SumTypes type = LVL1::EnergyTopoData::Normal) const

ET Sum.

Definition at line 94 of file EnergyTopoData.cxx.

94 {
95
96 int value = 0;
97 if (type == EnergyTopoData::Normal) value = m_word2 & 0x7fff;
98 else if (type == EnergyTopoData::Restricted) value = (m_word2>>16) & 0x7fff;
99
100 return value;
101}

◆ EtOverflow()

unsigned int LVL1::EnergyTopoData::EtOverflow ( SumTypes type = LVL1::EnergyTopoData::Normal) const

Definition at line 139 of file EnergyTopoData.cxx.

139 {
140 unsigned int overflow = 0;
141 if (type == EnergyTopoData::Normal) overflow = (m_word2 >> 15) & 1;
142 else if (type == EnergyTopoData::Restricted) overflow = (m_word2 >> 31) & 1;
143 return overflow = 0;
144}

◆ Ex()

int LVL1::EnergyTopoData::Ex ( SumTypes type = LVL1::EnergyTopoData::Normal) const

return Ex, Ey, ET values

Data access methods.

Ex (signed)

Definition at line 74 of file EnergyTopoData.cxx.

74 {
75
76 int value = 0;
77 if (type == EnergyTopoData::Normal) value = m_word0 & 0x7fff;
78 else if (type == EnergyTopoData::Restricted) value = (m_word0>>16) & 0x7fff;
79
80 return decodeTC(value);
81}
int decodeTC(unsigned int word) const
Decode 15-bit twos-complement values.

◆ ExOverflow()

unsigned int LVL1::EnergyTopoData::ExOverflow ( SumTypes type = LVL1::EnergyTopoData::Normal) const

return overflow flags

Overflow flags.

Definition at line 125 of file EnergyTopoData.cxx.

125 {
126 unsigned int overflow = 0;
127 if (type == EnergyTopoData::Normal) overflow = (m_word0 >> 15) & 1;
128 else if (type == EnergyTopoData::Restricted) overflow = (m_word0 >> 31) & 1;
129 return overflow = 0;
130}

◆ ExTC()

int LVL1::EnergyTopoData::ExTC ( SumTypes type = LVL1::EnergyTopoData::Normal) const

return twos-complement Ex, Ey values

Ex (twos complement)

Definition at line 104 of file EnergyTopoData.cxx.

104 {
105
106 int value = 0;
107 if (type == EnergyTopoData::Normal) value = m_word0 & 0x7fff;
108 else if (type == EnergyTopoData::Restricted) value = (m_word0>>16) & 0x7fff;
109
110 return value;
111}

◆ Ey()

int LVL1::EnergyTopoData::Ey ( SumTypes type = LVL1::EnergyTopoData::Normal) const

Ey (signed)

Definition at line 84 of file EnergyTopoData.cxx.

84 {
85
86 int value = 0;
87 if (type == EnergyTopoData::Normal) value = m_word1 & 0x7fff;
88 else if (type == EnergyTopoData::Restricted) value = (m_word1>>16) & 0x7fff;
89
90 return decodeTC(value);
91}

◆ EyOverflow()

unsigned int LVL1::EnergyTopoData::EyOverflow ( SumTypes type = LVL1::EnergyTopoData::Normal) const

Definition at line 132 of file EnergyTopoData.cxx.

132 {
133 unsigned int overflow = 0;
134 if (type == EnergyTopoData::Normal) overflow = (m_word1 >> 15) & 1;
135 else if (type == EnergyTopoData::Restricted) overflow = (m_word1 >> 31) & 1;
136 return overflow = 0;
137}

◆ EyTC()

int LVL1::EnergyTopoData::EyTC ( SumTypes type = LVL1::EnergyTopoData::Normal) const

Ey (twos complement)

Definition at line 114 of file EnergyTopoData.cxx.

114 {
115
116 int value = 0;
117 if (type == EnergyTopoData::Normal) value = m_word1 & 0x7fff;
118 else if (type == EnergyTopoData::Restricted) value = (m_word1>>16) & 0x7fff;
119
120 return value;
121}

◆ word0()

unsigned int LVL1::EnergyTopoData::word0 ( ) const
inline

return word 0

Definition at line 48 of file EnergyTopoData.h.

48{return m_word0;}

◆ word1()

unsigned int LVL1::EnergyTopoData::word1 ( ) const
inline

return word 1

Definition at line 50 of file EnergyTopoData.h.

50{return m_word1;}

◆ word2()

unsigned int LVL1::EnergyTopoData::word2 ( ) const
inline

return word 2

Definition at line 52 of file EnergyTopoData.h.

52{return m_word2;}

Member Data Documentation

◆ m_word0

unsigned int LVL1::EnergyTopoData::m_word0 {}
private

Definition at line 67 of file EnergyTopoData.h.

67{};

◆ m_word1

unsigned int LVL1::EnergyTopoData::m_word1 {}
private

Definition at line 68 of file EnergyTopoData.h.

68{};

◆ m_word2

unsigned int LVL1::EnergyTopoData::m_word2 {}
private

Definition at line 69 of file EnergyTopoData.h.

69{};

The documentation for this class was generated from the following files: