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

The eTower class is an interface object for eFEX trigger algorithms The purposes are twofold: More...

#include <eTower.h>

Collaboration diagram for LVL1::eTower:

Public Member Functions

 eTower ()
 Constructors. More...
 
 eTower (float eta, float phi, int id_modifier, int posneg)
 constructs a tower and sets the coordinates and identifier More...
 
virtual ~eTower ()=default
 Destructor. More...
 
void clearET ()
 Clear supercell ET values. More...
 
void clear_scIDs ()
 Clear and resize Identifier value vector. More...
 
void addET (float et, int cell)
 Add to ET of a specified cell in MeV. More...
 
void recordMD_ET (float et, int cell)
 Add to ET of a specified cell. More...
 
int iEta () const
 Get coordinates of tower. More...
 
int iPhi () const
 Return global phi index. More...
 
float eta () const
 
float phi () const
 
void setEta (const float thiseta)
 
int id () const
 
float constid () const
 
int getET (unsigned int layer, int cell=0) const
 Get ET of a specified cell in MeV. More...
 
int getTotalET () const
 Get ET sum of all cells in the eTower in MeV. More...
 
int getLayerTotalET (unsigned int layer) const
 Get total ET sum of all cells in a given layer in MeV. More...
 
std::vector< int > getLayerETvec (unsigned int layer) const
 Get vector of ET values for a given layer in MeV. More...
 
const std::vector< int > & getETs () const
 Get vector of all ET values in MeV. More...
 
const std::vector< unsigned int > & getETSplits () const
 Get vector of INT which describe whether a slot shared split ET from two different supercells - required information for production of CSV input files. More...
 
float getET_float (unsigned int layer, int cell=0) const
 Get ET of a specified cell in MeV FLOAT VERSION. More...
 
float getTotalET_float () const
 Get ET sum of all cells in the eTower in MeV FLOAT VERSION. More...
 
float getLayerTotalET_float (unsigned int layer) const
 Get total ET sum of all cells in a given layer in MeV FLOAT VERSION. More...
 
std::vector< float > getLayerETvec_float (unsigned int layer) const
 Get vector of ET values for a given layer in MeV FLOAT VERSION. More...
 
const std::vector< float > & getETs_float () const
 Get vector of all ET values in MeV FLOAT VERSION. More...
 
void setET (int cell, float et, int layer, bool ignoreDisable=false)
 
void setSCID (Identifier ID, int cell, float et, int layer, bool doenergysplit)
 Set supercell position ID. More...
 
const std::vector< Identifier > & getSCIDs () const
 
const std::vector< Identifier > & getSCIDs_split () const
 
Identifier getSCID (int cell) const
 
std::vector< IdentifiergetLayerSCIDs (unsigned int layer) const
 
void setPosNeg (int posneg)
 
int getPosNeg () const
 

Private Attributes

float m_eta
 Internal data. More...
 
float m_phi
 
std::vector< Identifierm_scID
 
std::vector< Identifierm_scID_split
 
std::vector< int > m_et
 
std::vector< float > m_et_float
 
std::vector< unsigned int > m_etSplits
 
int m_tower_id
 
int m_posneg = 0
 

Detailed Description

The eTower class is an interface object for eFEX trigger algorithms The purposes are twofold:

Definition at line 38 of file eTower.h.

Constructor & Destructor Documentation

◆ eTower() [1/2]

LVL1::eTower::eTower ( )

Constructors.

Definition at line 25 of file eTower.cxx.

25  :
26  m_eta(0.),
27  m_phi(0.),
28  m_tower_id(-9999999),
29  m_posneg(0)
30  {
31  this->clear_scIDs();
32  this->clearET();
33  }

◆ eTower() [2/2]

LVL1::eTower::eTower ( float  eta,
float  phi,
int  id_modifier,
int  posneg 
)

constructs a tower and sets the coordinates and identifier

Definition at line 36 of file eTower.cxx.

36  :
37  m_eta(eta),
38  m_phi(phi),
39  m_tower_id(id_modifier + phi + (64 * eta)),
40  m_posneg(posneg)
41  {
42  this->clear_scIDs();
43  this->clearET();
44  }

◆ ~eTower()

virtual LVL1::eTower::~eTower ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addET()

void LVL1::eTower::addET ( float  et,
int  cell 
)

Add to ET of a specified cell in MeV.

Add ET to a specified cell.

Check cell index in range for layer - should probably throw a warning...

Definition at line 89 of file eTower.cxx.

90  {
92  if (cell < 0 || cell > 13){ return; }
93 
94  m_et_float[cell] += et;
95 
96  return;
97 
98  }

◆ clear_scIDs()

void LVL1::eTower::clear_scIDs ( )

Clear and resize Identifier value vector.

Definition at line 67 of file eTower.cxx.

68  {
69  m_scID.clear();
70  m_scID.resize(14);
71  m_scID_split.clear();
72  m_scID_split.resize(14);
73  for (unsigned int i=0; i<m_scID.size(); i++){
74  m_scID[i] = Identifier();
76  }
77  }

◆ clearET()

void LVL1::eTower::clearET ( )

Clear supercell ET values.

Clear and resize ET value vector.

Definition at line 47 of file eTower.cxx.

48  {
49  m_et.clear();
50  m_et.resize(14);
51  m_et_float.clear();
52  m_et_float.resize(14);
53  for (unsigned int i=0; i<m_et.size(); i++){
54  m_et[i] = 0;
55  m_et_float[i] = 0.0;
56  }
57 
58  m_etSplits.clear();
59  m_etSplits.resize(14);
60  for (unsigned int i=0; i<m_etSplits.size(); i++){
61  m_etSplits[i] = 0;
62  }
63 
64  }

◆ constid()

float LVL1::eTower::constid ( ) const
inline

Definition at line 71 of file eTower.h.

71 {return m_tower_id;};

◆ eta()

float LVL1::eTower::eta ( ) const
inline

Definition at line 64 of file eTower.h.

64 {return m_eta;};

◆ getET()

int LVL1::eTower::getET ( unsigned int  layer,
int  cell = 0 
) const

Get ET of a specified cell in MeV.

Return ET of specified supercell.

Check cell index in range for layer

Definition at line 172 of file eTower.cxx.

172  {
173 
175  if (layer >= s_nLayers || cell < 0 || cell >= s_cells[layer]) return 0;
176 
177  // Return ET
178  return m_et[s_offsets[layer] + cell];
179 
180  }

◆ getET_float()

float LVL1::eTower::getET_float ( unsigned int  layer,
int  cell = 0 
) const

Get ET of a specified cell in MeV FLOAT VERSION.

Return ET of specified supercell FLOAT VERSION.

Check cell index in range for layer

Definition at line 183 of file eTower.cxx.

183  {
184 
186  if (layer >= s_nLayers || cell < 0 || cell >= s_cells[layer]) return 0;
187 
188  // Return ET
189  return m_et_float[s_offsets[layer] + cell];
190 
191  }

◆ getETs()

const std::vector<int>& LVL1::eTower::getETs ( ) const
inline

Get vector of all ET values in MeV.

Definition at line 86 of file eTower.h.

86 {return m_et;};

◆ getETs_float()

const std::vector<float>& LVL1::eTower::getETs_float ( ) const
inline

Get vector of all ET values in MeV FLOAT VERSION.

Definition at line 104 of file eTower.h.

104 {return m_et_float;};

◆ getETSplits()

const std::vector<unsigned int>& LVL1::eTower::getETSplits ( ) const
inline

Get vector of INT which describe whether a slot shared split ET from two different supercells - required information for production of CSV input files.

Definition at line 89 of file eTower.h.

89 {return m_etSplits;};

◆ getLayerETvec()

std::vector< int > LVL1::eTower::getLayerETvec ( unsigned int  layer) const

Get vector of ET values for a given layer in MeV.

Return supercell ET values for specified layer.

Create empty vector of data

Check cell index in range for layer

Fill output vector

Definition at line 217 of file eTower.cxx.

217  {
218 
220  std::vector<int> cells;
221 
223  if (layer >= s_nLayers) return cells;
224 
226  for (int cell = 0; cell < s_cells[layer]; ++cell) cells.push_back(m_et[s_offsets[layer] + cell]);
227 
228  return cells;
229  }

◆ getLayerETvec_float()

std::vector< float > LVL1::eTower::getLayerETvec_float ( unsigned int  layer) const

Get vector of ET values for a given layer in MeV FLOAT VERSION.

Return supercell ET values for specified layer FLOAT VERSION.

Create empty vector of data

Check cell index in range for layer

Fill output vector

Definition at line 233 of file eTower.cxx.

233  {
234 
236  std::vector<float> cells;
237 
239  if (layer >= s_nLayers) return cells;
240 
242  for (int cell = 0; cell < s_cells[layer]; ++cell) cells.push_back(m_et_float[s_offsets[layer] + cell]);
243 
244  return cells;
245  }

◆ getLayerSCIDs()

std::vector< Identifier > LVL1::eTower::getLayerSCIDs ( unsigned int  layer) const

Definition at line 296 of file eTower.cxx.

296  {
297 
298  std::vector<Identifier> cells_in_layer;
299 
300  if (layer == 0){
301  cells_in_layer.push_back(m_scID[0]);
302  }
303  else if (layer == 1){
304  cells_in_layer.push_back(m_scID[1]);
305  cells_in_layer.push_back(m_scID[2]);
306  cells_in_layer.push_back(m_scID[3]);
307  cells_in_layer.push_back(m_scID[4]);
308  }
309  else if (layer == 2){
310  cells_in_layer.push_back(m_scID[5]);
311  cells_in_layer.push_back(m_scID[6]);
312  cells_in_layer.push_back(m_scID[7]);
313  cells_in_layer.push_back(m_scID[8]);
314  }
315  else if (layer == 3){
316  cells_in_layer.push_back(m_scID[9]);
317  }
318  else if (layer == 4){
319  cells_in_layer.push_back(m_scID[10]);
320  cells_in_layer.push_back(m_scID[11]);
321  }
322 
323  return cells_in_layer;
324 
325  }

◆ getLayerTotalET()

int LVL1::eTower::getLayerTotalET ( unsigned int  layer) const

Get total ET sum of all cells in a given layer in MeV.

Return supercell ET values for specified layer.

Definition at line 249 of file eTower.cxx.

249  {
250 
251  if (layer == 0){
252  return m_et[0];
253  }
254  else if (layer == 1){
255  return (m_et[1] + m_et[2] + m_et[3] + m_et[4]);
256  }
257  else if (layer == 2){
258  return (m_et[5] + m_et[6] + m_et[7] + m_et[8]);
259  }
260  else if (layer == 3){
261  return m_et[9];
262  }
263  else if (layer == 4){
264  return (m_et[10] + m_et[11]);
265  }
266 
267 
268  return 0;
269 
270  }

◆ getLayerTotalET_float()

float LVL1::eTower::getLayerTotalET_float ( unsigned int  layer) const

Get total ET sum of all cells in a given layer in MeV FLOAT VERSION.

Return supercell ET values for specified layer FLOAT VERSION.

Definition at line 273 of file eTower.cxx.

273  {
274 
275  if (layer == 0){
276  return m_et_float[0];
277  }
278  else if (layer == 1){
279  return (m_et_float[1] + m_et_float[2] + m_et_float[3] + m_et_float[4]);
280  }
281  else if (layer == 2){
282  return (m_et_float[5] + m_et_float[6] + m_et_float[7] + m_et_float[8]);
283  }
284  else if (layer == 3){
285  return m_et_float[9];
286  }
287  else if (layer == 4){
288  return (m_et_float[10] + m_et_float[11]);
289  }
290 
291 
292  return 0;
293 
294  }

◆ getPosNeg()

int LVL1::eTower::getPosNeg ( ) const
inline

Definition at line 121 of file eTower.h.

121 {return m_posneg;}

◆ getSCID()

Identifier LVL1::eTower::getSCID ( int  cell) const
inline

Definition at line 115 of file eTower.h.

115 { return m_scID[cell]; }

◆ getSCIDs()

const std::vector<Identifier>& LVL1::eTower::getSCIDs ( ) const
inline

Definition at line 111 of file eTower.h.

111 { return m_scID; }

◆ getSCIDs_split()

const std::vector<Identifier>& LVL1::eTower::getSCIDs_split ( ) const
inline

Definition at line 113 of file eTower.h.

113 { return m_scID_split; }

◆ getTotalET()

int LVL1::eTower::getTotalET ( ) const

Get ET sum of all cells in the eTower in MeV.

Return ET of all supercells together.

Definition at line 194 of file eTower.cxx.

194  {
195  int tmp = 0;
196  for (unsigned int i=0; i<m_et.size(); i++){
197  tmp += m_et[i];
198  }
199  // Sum saturates at 16 bits
200  return std::min(tmp,s_eFEXOverflow);
201  }

◆ getTotalET_float()

float LVL1::eTower::getTotalET_float ( ) const

Get ET sum of all cells in the eTower in MeV FLOAT VERSION.

Return ET of all supercells together FLOAT VERSION.

Definition at line 204 of file eTower.cxx.

204  {
205 
206  float tmp = 0;
207  for (unsigned int i=0; i<m_et_float.size(); i++){
208  tmp += m_et_float[i];
209  }
210 
211  return tmp;
212 
213  }

◆ id()

int LVL1::eTower::id ( ) const
inline

Definition at line 69 of file eTower.h.

69 {return m_tower_id;}

◆ iEta()

int LVL1::eTower::iEta ( ) const

Get coordinates of tower.

Return global eta index.

Should be derived from tower ID, should be corrected in the future. Need to also think what index range should be (thinking ahead to Run2)

Definition at line 159 of file eTower.cxx.

159  {
160  const int index = (m_eta * m_posneg);
161  return index;
162  }

◆ iPhi()

int LVL1::eTower::iPhi ( ) const

Return global phi index.

Should be derived from tower ID, should be corrected in the future. Decision here is whether phi is signed or not

Definition at line 167 of file eTower.cxx.

167  {
168  return m_phi;
169  }

◆ phi()

float LVL1::eTower::phi ( ) const
inline

Definition at line 65 of file eTower.h.

65 {return m_phi;};

◆ recordMD_ET()

void LVL1::eTower::recordMD_ET ( float  et,
int  cell 
)

Add to ET of a specified cell.

◆ setET()

void LVL1::eTower::setET ( int  cell,
float  et,
int  layer,
bool  ignoreDisable = false 
)

Check cell index in range for layer

Definition at line 99 of file eTower.cxx.

99  {
101  if (cell < 0 || cell > 13){ return; }
102 
103  addET(et, cell);
104 
105  //multi linear digitisation encoding ... except in tile (indicated by passing layer=5) .. just convert to 25 MeV steps
107  }

◆ setEta()

void LVL1::eTower::setEta ( const float  thiseta)
inline

Definition at line 67 of file eTower.h.

67 { m_eta = thiseta; }

◆ setPosNeg()

void LVL1::eTower::setPosNeg ( int  posneg)

Definition at line 80 of file eTower.cxx.

80  {
81 
82  m_posneg = posneg;
83 
84  return;
85 
86  }

◆ setSCID()

void LVL1::eTower::setSCID ( Identifier  ID,
int  cell,
float  et,
int  layer,
bool  doenergysplit 
)

Set supercell position ID.

Set supercell position ID and ET.

Check cell index in range for layer

Definition at line 110 of file eTower.cxx.

111  {
112 
114  if (cell < 0 || cell > 13){ return; }
115 
116  if(!doenergysplit){
117 
118  addET(et, cell);
119 
120  m_scID[cell] = ID;
121 
122  //multi linear digitisation encoding
124  m_et[cell] = outET;
125  }
126  else{
127 
128  float et_half = et*0.5;
129  addET(et_half, cell);
130  addET(et_half, cell+1);
131 
132  m_etSplits[cell] = 1;
133  m_etSplits[cell+1] = 1;
134 
135  if(cell==1){
136  m_scID[12] = ID;
137  }
138  else if(cell==3){
139  m_scID[13] = ID;
140  }
141 
142 
143  m_scID_split[cell] = ID;
144  m_scID_split[cell+1] = ID;
145 
146  m_scID.push_back(ID);
147 
150  }
151 
152  return;
153 
154  }

Member Data Documentation

◆ m_et

std::vector<int> LVL1::eTower::m_et
private

Definition at line 129 of file eTower.h.

◆ m_et_float

std::vector<float> LVL1::eTower::m_et_float
private

Definition at line 130 of file eTower.h.

◆ m_eta

float LVL1::eTower::m_eta
private

Internal data.

Definition at line 125 of file eTower.h.

◆ m_etSplits

std::vector<unsigned int> LVL1::eTower::m_etSplits
private

Definition at line 131 of file eTower.h.

◆ m_phi

float LVL1::eTower::m_phi
private

Definition at line 126 of file eTower.h.

◆ m_posneg

int LVL1::eTower::m_posneg = 0
private

Definition at line 133 of file eTower.h.

◆ m_scID

std::vector<Identifier> LVL1::eTower::m_scID
private

Definition at line 127 of file eTower.h.

◆ m_scID_split

std::vector<Identifier> LVL1::eTower::m_scID_split
private

Definition at line 128 of file eTower.h.

◆ m_tower_id

int LVL1::eTower::m_tower_id
private

Definition at line 132 of file eTower.h.


The documentation for this class was generated from the following files:
LVL1::eTower::m_tower_id
int m_tower_id
Definition: eTower.h:132
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
et
Extra patterns decribing particle interation process.
LVL1::s_nLayers
const size_t s_nLayers
Definition: eTower.cxx:19
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
index
Definition: index.py:1
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
LVL1::eTower::clearET
void clearET()
Clear supercell ET values.
Definition: eTower.cxx:47
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
LVL1::eTower::m_et
std::vector< int > m_et
Definition: eTower.h:129
LVL1::s_eFEXOverflow
const int s_eFEXOverflow
Definition: eTower.cxx:22
LVL1::s_cells
const int s_cells[s_nLayers]
Definition: eTower.cxx:20
LVL1::s_offsets
const int s_offsets[s_nLayers]
Definition: eTower.cxx:21
LVL1::eTower::phi
float phi() const
Definition: eTower.h:65
lumiFormat.i
int i
Definition: lumiFormat.py:85
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LVL1::eTower::m_phi
float m_phi
Definition: eTower.h:126
LVL1::eFEXCompression::decode
static int decode(int EtVal, int layer, bool ignoreDisable=false)
Full sequence.
Definition: eFEXCompression.cxx:118
LVL1::eTower::m_et_float
std::vector< float > m_et_float
Definition: eTower.h:130
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
LVL1::eTower::clear_scIDs
void clear_scIDs()
Clear and resize Identifier value vector.
Definition: eTower.cxx:67
LVL1::eTower::addET
void addET(float et, int cell)
Add to ET of a specified cell in MeV.
Definition: eTower.cxx:89
LVL1::eTower::m_posneg
int m_posneg
Definition: eTower.h:133
LVL1::eTower::m_scID
std::vector< Identifier > m_scID
Definition: eTower.h:127
LVL1::eTower::m_etSplits
std::vector< unsigned int > m_etSplits
Definition: eTower.h:131
DeMoScan.index
string index
Definition: DeMoScan.py:364
LVL1::eTower::eta
float eta() const
Definition: eTower.h:64
LVL1::eTower::m_eta
float m_eta
Internal data.
Definition: eTower.h:125
LVL1::eTower::m_scID_split
std::vector< Identifier > m_scID_split
Definition: eTower.h:128
Identifier
Definition: IdentifierFieldParser.cxx:14