ATLAS Offline Software
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 ()
 
 ~EnergyTopoData ()
 destructor More...
 
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 15 of file EnergyTopoData.cxx.

15  :
16  m_word0(word0),
17  m_word1(word1),
18  m_word2(word2)
19 {
20 }

◆ EnergyTopoData() [2/2]

LVL1::EnergyTopoData::EnergyTopoData ( )

Definition at line 10 of file EnergyTopoData.cxx.

10  : m_word0(0), m_word1(0), m_word2(0)
11 {
12 }

◆ ~EnergyTopoData()

LVL1::EnergyTopoData::~EnergyTopoData ( )
inline

destructor

Definition at line 47 of file EnergyTopoData.h.

49 {return m_word0;}

Member Function Documentation

◆ addEt()

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

Definition at line 42 of file EnergyTopoData.cxx.

42  {
43  unsigned int word = (Et&0x7fff) + (overflow<<15);
44 
46  m_word2 = (m_word2&0xffff0000) + (word&0xffff);
48  m_word2 = (m_word2&0xffff) + ( (word&0xffff)<<16 );
49 }

◆ 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 24 of file EnergyTopoData.cxx.

24  {
25  unsigned int word = (Ex&0x7fff) + (overflow<<15);
26 
28  m_word0 = (m_word0&0xffff0000) + (word&0xffff);
30  m_word0 = (m_word0&0xffff) + ( (word&0xffff)<<16 );
31 }

◆ addEy()

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

Definition at line 33 of file EnergyTopoData.cxx.

33  {
34  unsigned int word = (Ey&0x7fff) + (overflow<<15);
35 
37  m_word1 = (m_word1&0xffff0000) + (word&0xffff);
39  m_word1 = (m_word1&0xffff) + ( (word&0xffff)<<16 );
40 }

◆ addRoI()

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

add data using RoI word

Definition at line 51 of file EnergyTopoData.cxx.

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

◆ addRoIs()

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

Definition at line 70 of file EnergyTopoData.cxx.

70  {
71 
72  for (std::vector<uint32_t>::const_iterator it = roiWords.begin(); it != roiWords.end(); ++it) addRoI((*it)) ;
73 
74 }

◆ decodeTC()

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

Decode 15-bit twos-complement values.

Should be redundant

Definition at line 152 of file EnergyTopoData.cxx.

152  {
153 
154  word = word & 0x7fff;
155  int value = word;
156 
157  int sign = (word >> 14) & 1;
158  if (sign != 0) {
159  int complement = ~word;
160  value = -( (complement+1) & 0x7fff );
161  }
162 
163  return value;
164 }

◆ Et()

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

ET Sum.

Definition at line 99 of file EnergyTopoData.cxx.

99  {
100 
101  int value = 0;
102  if (type == EnergyTopoData::Normal) value = m_word2 & 0x7fff;
103  else if (type == EnergyTopoData::Restricted) value = (m_word2>>16) & 0x7fff;
104 
105  return value;
106 }

◆ EtOverflow()

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

Definition at line 144 of file EnergyTopoData.cxx.

144  {
145  unsigned int overflow = 0;
146  if (type == EnergyTopoData::Normal) overflow = (m_word2 >> 15) & 1;
147  else if (type == EnergyTopoData::Restricted) overflow = (m_word2 >> 31) & 1;
148  return overflow = 0;
149 }

◆ Ex()

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

return Ex, Ey, ET values

Data access methods.

Ex (signed)

Definition at line 79 of file EnergyTopoData.cxx.

79  {
80 
81  int value = 0;
82  if (type == EnergyTopoData::Normal) value = m_word0 & 0x7fff;
83  else if (type == EnergyTopoData::Restricted) value = (m_word0>>16) & 0x7fff;
84 
85  return decodeTC(value);
86 }

◆ ExOverflow()

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

return overflow flags

Overflow flags.

Definition at line 130 of file EnergyTopoData.cxx.

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

◆ ExTC()

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

return twos-complement Ex, Ey values

Ex (twos complement)

Definition at line 109 of file EnergyTopoData.cxx.

109  {
110 
111  int value = 0;
112  if (type == EnergyTopoData::Normal) value = m_word0 & 0x7fff;
113  else if (type == EnergyTopoData::Restricted) value = (m_word0>>16) & 0x7fff;
114 
115  return value;
116 }

◆ Ey()

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

Ey (signed)

Definition at line 89 of file EnergyTopoData.cxx.

89  {
90 
91  int value = 0;
92  if (type == EnergyTopoData::Normal) value = m_word1 & 0x7fff;
93  else if (type == EnergyTopoData::Restricted) value = (m_word1>>16) & 0x7fff;
94 
95  return decodeTC(value);
96 }

◆ EyOverflow()

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

Definition at line 137 of file EnergyTopoData.cxx.

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

◆ EyTC()

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

Ey (twos complement)

Definition at line 119 of file EnergyTopoData.cxx.

119  {
120 
121  int value = 0;
122  if (type == EnergyTopoData::Normal) value = m_word1 & 0x7fff;
123  else if (type == EnergyTopoData::Restricted) value = (m_word1>>16) & 0x7fff;
124 
125  return value;
126 }

◆ word0()

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

return word 0

Definition at line 59 of file EnergyTopoData.h.

◆ word1()

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

return word 1

Definition at line 61 of file EnergyTopoData.h.

◆ word2()

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

return word 2

Definition at line 63 of file EnergyTopoData.h.

Member Data Documentation

◆ m_word0

unsigned int LVL1::EnergyTopoData::m_word0
private

Definition at line 78 of file EnergyTopoData.h.

◆ m_word1

unsigned int LVL1::EnergyTopoData::m_word1
private

Definition at line 79 of file EnergyTopoData.h.

◆ m_word2

unsigned int LVL1::EnergyTopoData::m_word2
private

Definition at line 80 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:59
LVL1::EnergyTopoData::m_word1
unsigned int m_word1
Definition: EnergyTopoData.h:79
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:63
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1::EnergyTopoData::m_word0
unsigned int m_word0
Definition: EnergyTopoData.h:78
LVL1::EnergyTopoData::Ex
int Ex(SumTypes type=LVL1::EnergyTopoData::Normal) const
return Ex, Ey, ET values
Definition: EnergyTopoData.cxx:79
LVL1::EnergyTopoData::Normal
@ Normal
Definition: EnergyTopoData.h:44
skel.it
it
Definition: skel.GENtoEVGEN.py:396
athena.value
value
Definition: athena.py:124
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
LVL1::EnergyTopoData::m_word2
unsigned int m_word2
Definition: EnergyTopoData.h:80
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:152
LVL1::EnergyTopoData::Ey
int Ey(SumTypes type=LVL1::EnergyTopoData::Normal) const
Ey (signed)
Definition: EnergyTopoData.cxx:89
LVL1::EnergyTopoData::addRoI
void addRoI(uint32_t roiWord)
add data using RoI word
Definition: EnergyTopoData.cxx:51
LVL1::EnergyTopoData::Et
int Et(SumTypes type=LVL1::EnergyTopoData::Normal) const
ET Sum.
Definition: EnergyTopoData.cxx:99
LVL1::EnergyTopoData::Restricted
@ Restricted
Definition: EnergyTopoData.h:44
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:61