Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 More...
 
 EnergyTopoData ()=default
 
void addEx (unsigned int Ex, unsigned int overflow, int type)
 add data. More...
 
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 More...
 
void addRoIs (const std::vector< uint32_t > &roiWords)
 
unsigned int word0 () const
 return word 0 More...
 
unsigned int word1 () const
 return word 1 More...
 
unsigned int word2 () const
 return word 2 More...
 
int Ex (SumTypes type=LVL1::EnergyTopoData::Normal) const
 return Ex, Ey, ET values More...
 
int Ey (SumTypes type=LVL1::EnergyTopoData::Normal) const
 Ey (signed) More...
 
int Et (SumTypes type=LVL1::EnergyTopoData::Normal) const
 ET Sum. More...
 
int ExTC (SumTypes type=LVL1::EnergyTopoData::Normal) const
 return twos-complement Ex, Ey values More...
 
int EyTC (SumTypes type=LVL1::EnergyTopoData::Normal) const
 Ey (twos complement) More...
 
unsigned int ExOverflow (SumTypes type=LVL1::EnergyTopoData::Normal) const
 return overflow flags More...
 
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. More...
 

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 31 of file EnergyTopoData.h.

Member Enumeration Documentation

◆ SumTypes

Enumerator
Normal 
Restricted 

Definition at line 39 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  :
11  m_word0(word0),
12  m_word1(word1),
13  m_word2(word2)
14 {
15 }

◆ 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);
43  m_word2 = (m_word2&0xffff) + ( (word&0xffff)<<16 );
44 }

◆ 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);
25  m_word0 = (m_word0&0xffff) + ( (word&0xffff)<<16 );
26 }

◆ 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);
34  m_word1 = (m_word1&0xffff) + ( (word&0xffff)<<16 );
35 }

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

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

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

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

◆ 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 58 of file EnergyTopoData.h.

◆ word1()

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

return word 1

Definition at line 60 of file EnergyTopoData.h.

◆ word2()

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

return word 2

Definition at line 62 of file EnergyTopoData.h.

Member Data Documentation

◆ m_word0

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

Definition at line 77 of file EnergyTopoData.h.

◆ m_word1

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

Definition at line 78 of file EnergyTopoData.h.

◆ m_word2

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

Definition at line 79 of file EnergyTopoData.h.


The documentation for this class was generated from the following files:
LVL1::EnergyTopoData::word0
unsigned int word0() const
return word 0
Definition: EnergyTopoData.h:58
LVL1::EnergyTopoData::m_word1
unsigned int m_word1
Definition: EnergyTopoData.h:78
header
Definition: hcg.cxx:526
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
LVL1::EnergyTopoData::word2
unsigned int word2() const
return word 2
Definition: EnergyTopoData.h:62
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1::EnergyTopoData::m_word0
unsigned int m_word0
Definition: EnergyTopoData.h:77
LVL1::EnergyTopoData::Ex
int Ex(SumTypes type=LVL1::EnergyTopoData::Normal) const
return Ex, Ey, ET values
Definition: EnergyTopoData.cxx:74
LVL1::EnergyTopoData::Normal
@ Normal
Definition: EnergyTopoData.h:44
skel.it
it
Definition: skel.GENtoEVGEN.py:407
athena.value
value
Definition: athena.py:124
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
LVL1::EnergyTopoData::m_word2
unsigned int m_word2
Definition: EnergyTopoData.h:79
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
LVL1::EnergyTopoData::decodeTC
int decodeTC(unsigned int word) const
Decode 15-bit twos-complement values.
Definition: EnergyTopoData.cxx:147
LVL1::EnergyTopoData::Ey
int Ey(SumTypes type=LVL1::EnergyTopoData::Normal) const
Ey (signed)
Definition: EnergyTopoData.cxx:84
LVL1::EnergyTopoData::addRoI
void addRoI(uint32_t roiWord)
add data using RoI word
Definition: EnergyTopoData.cxx:46
LVL1::EnergyTopoData::Et
int Et(SumTypes type=LVL1::EnergyTopoData::Normal) const
ET Sum.
Definition: EnergyTopoData.cxx:94
LVL1::EnergyTopoData::Restricted
@ Restricted
Definition: EnergyTopoData.h:44
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
TSU::complement
T complement(const T &v, const unsigned int &p)
Definition: L1TopoDataTypes.cxx:18
LVL1::EnergyTopoData::word1
unsigned int word1() const
return word 1
Definition: EnergyTopoData.h:60