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

The gTower class is an interface object for gFEX trigger algorithms The purposes are twofold: More...

#include <gTower.h>

Collaboration diagram for LVL1::gTower:

Public Member Functions

 gTower ()
 Constructors. More...
 
 gTower (int eta, int phi, int nphi, int id_modifier, int posneg)
 constructs a tower and sets the coordinates and identifier More...
 
 ~gTower ()
 Destructor. More...
 
void clearET ()
 Clear supercell ET values. More...
 
void clear_scIDs ()
 Clear and resize Identifier value vector. More...
 
void addET (float et, int layer)
 Add ET in MeV, layer refers to EM or HAD (Tile) More...
 
int getID () const
 Add to ET
More...
 
int iEta () const
 Get coordinates of tower. More...
 
int iPhi () const
 
float eta () const
 
float phi () const
 
void setEta (const float thiseta)
 
int id () const
 
float constid () const
 
int getET () const
 Get ET (total) in MeV. More...
 
float getET_float () const
 Get ET (total) in MeV FLOAT VERSION. More...
 
int getET_EM_float () const
 Get ET in MeV from EM calo FLOAT VERSION. More...
 
int getET_HAD_float () const
 Get ET in MeV from HAD calo FLOAT VERSION. More...
 
void setET ()
 
void setTotalEt (int totEt)
 
void setSCID (Identifier ID)
 Set supercell position ID. More...
 
const std::vector< Identifier > & getSCIDs () const
 
bool noiseCut (int et) const
 Apply supercell noise cut. More...
 
void setPosNeg (int posneg)
 
int getPosNeg () const
 
int getFWID (int &iPhiFW, int &iEtaFW) const
 Calculates and returns the firmware ID, as well as iPhi and iEta in FT/global scheme. More...
 
int getFWID () const
 Calculates and returns the firmware ID. More...
 
void getEtaPhi (float &Eta, float &Phi, int iEta, int iPhi) const
 Calculates eta and phi from ieta and iphi. More...
 
void setIsSaturated (char isSaturated)
 Sets saturation flag. More...
 
char isSaturated () const
 Returns true if is saturated. More...
 

Private Attributes

int m_eta
 Internal data. More...
 
int m_phi
 
int m_et
 
float m_eta_float
 
float m_phi_float
 
float m_et_float
 
std::vector< float > m_et_float_perlayer
 
std::vector< Identifierm_scID
 
int m_tower_id
 
int m_posneg = 0
 
int m_noisecut = -100000
 
char m_saturated
 

Detailed Description

The gTower class is an interface object for gFEX trigger algorithms The purposes are twofold:

Definition at line 38 of file gTower.h.

Constructor & Destructor Documentation

◆ gTower() [1/2]

LVL1::gTower::gTower ( )

Constructors.

Definition at line 18 of file gTower.cxx.

18  :
19  m_eta(0),
20  m_phi(0),
21  m_tower_id(-9999999),
22  m_posneg(0)
23  {
24  this->clear_scIDs();
25  this->clearET();
26  }

◆ gTower() [2/2]

LVL1::gTower::gTower ( int  eta,
int  phi,
int  nphi,
int  id_modifier,
int  posneg 
)

constructs a tower and sets the coordinates and identifier

Definition at line 29 of file gTower.cxx.

29  :
30  m_eta(ieta),
31  m_phi(iphi),
32  m_tower_id(id_modifier + iphi + (nphi * ieta)),
33  m_posneg(posneg),
34  m_saturated(0)
35  {
36  this->clear_scIDs();
37  this->clearET();
39  }

◆ ~gTower()

LVL1::gTower::~gTower ( )
inline

Destructor.

Definition at line 47 of file gTower.h.

47 {};

Member Function Documentation

◆ addET()

void LVL1::gTower::addET ( float  et,
int  layer 
)

Add ET in MeV, layer refers to EM or HAD (Tile)

Add ET.

Definition at line 65 of file gTower.cxx.

66  {
67 
68  m_et_float_perlayer[layer] += et; // for monitoring
69  m_et_float += et;
70 
71  return;
72 
73  }

◆ clear_scIDs()

void LVL1::gTower::clear_scIDs ( )

Clear and resize Identifier value vector.

Definition at line 50 of file gTower.cxx.

51  {
52  m_scID.clear();
53  }

◆ clearET()

void LVL1::gTower::clearET ( )

Clear supercell ET values.

Clear and resize ET value vector.

Definition at line 42 of file gTower.cxx.

43  {
44  m_et = 0;
45  m_et_float = 0.0;
46  m_et_float_perlayer.assign(2, 0.0);
47  }

◆ constid()

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

Definition at line 75 of file gTower.h.

75 {return m_tower_id;};

◆ eta()

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

Definition at line 68 of file gTower.h.

68 {return m_eta_float;};

◆ getET()

int LVL1::gTower::getET ( ) const

Get ET (total) in MeV.

Return ET (total)

Definition at line 147 of file gTower.cxx.

147  {
148 
149  return m_et;
150 
151  }

◆ getET_EM_float()

int LVL1::gTower::getET_EM_float ( ) const

Get ET in MeV from EM calo FLOAT VERSION.

Return ET for EM.

Definition at line 162 of file gTower.cxx.

162  {
163 
164  return m_et_float_perlayer[0];
165 
166  }

◆ getET_float()

float LVL1::gTower::getET_float ( ) const

Get ET (total) in MeV FLOAT VERSION.

Return ET (total) FLOAT VERSION.

Definition at line 154 of file gTower.cxx.

154  {
155 
156  // Return ET
157  return m_et_float;
158 
159  }

◆ getET_HAD_float()

int LVL1::gTower::getET_HAD_float ( ) const

Get ET in MeV from HAD calo FLOAT VERSION.

Return ET for HAD.

Definition at line 169 of file gTower.cxx.

169  {
170 
171  return m_et_float_perlayer[1];
172 
173  }

◆ getEtaPhi()

void LVL1::gTower::getEtaPhi ( float &  Eta,
float &  Phi,
int  iEta,
int  iPhi 
) const

Calculates eta and phi from ieta and iphi.

Definition at line 295 of file gTower.cxx.

295  {
296 
297  float s_centralPhiWidth = (2*M_PI)/32; //In central region, gFex has 32 bins in phi
298  float s_forwardPhiWidth = (2*M_PI)/16; //In forward region, gFex has 16 bins in phi (before rearranging bins)
299 
300  constexpr std::array<float, 40> s_EtaCenter = { -4.7, -4.2, -3.7, -3.4, -3.2, -3,
301  -2.8, -2.6, -2.35, -2.1, -1.9, -1.7, -1.5, -1.3, -1.1, -0.9,
302  -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1,
303  1.3, 1.5, 1.7, 1.9, 2.1, 2.35, 2.6, 2.8, 3.0,
304  3.2, 3.4, 3.7, 4.2, 4.7};
305 
306  Eta = s_EtaCenter.at(iEta);
307 
308  float Phi_gFex = -99;
309  if (( iEta <= 3 ) || ( (iEta >= 36) )){
310  Phi_gFex = ( (iPhi * s_forwardPhiWidth) + s_forwardPhiWidth/2);
311  }
312  else {
313  Phi_gFex = ( (iPhi * s_centralPhiWidth) + s_centralPhiWidth/2);
314  }
315 
316  if (Phi_gFex < M_PI) {
317  Phi = Phi_gFex;
318  }
319  else {
320  Phi = (Phi_gFex - 2*M_PI);
321  }
322  }

◆ getFWID() [1/2]

int LVL1::gTower::getFWID ( ) const

Calculates and returns the firmware ID.

Definition at line 184 of file gTower.cxx.

184  {
185  int iPhiFW, iEtaFW;
186  return getFWID(iPhiFW, iEtaFW);
187  }

◆ getFWID() [2/2]

int LVL1::gTower::getFWID ( int &  iPhiFW,
int &  iEtaFW 
) const

Calculates and returns the firmware ID, as well as iPhi and iEta in FT/global scheme.

Return the firmware ID from the software ID.

Definition at line 202 of file gTower.cxx.

202  {
203 
204  int gFEXtowerID; // the firmware ID to be calculated
205 
206  int iEta = this->iEta();
207  int iPhi = this->iPhi();
208  float Eta = this->eta();
209 
210  iPhiFW = iPhi;
211  iEtaFW = iEta;
212 
213  bool is_central = true;
214  if (iEta <= 7 || iEta >= 32) is_central = false;
215 
216  if (is_central)
217  {
218 
219  if (iEta < 20)
220  {
221  // FPGA 0
222  gFEXtowerID = (iEta - 8) + (iPhi * 12);
223  } else
224  {
225  // FPGA 1
226  gFEXtowerID = 10000 + (iEta - 20) + (iPhi * 12);
227 
228  }
229 
230  } else
231  {
232  gFEXtowerID = 20000;
233 
234  if ( Eta < 0 ){
235 
236  if ( iEta == 0 ){
237  gFEXtowerID = gFEXtowerID + (iPhi*24);
238  iPhiFW = iPhi*2;
239  iEtaFW = 2;
240  }
241  else if ( iEta == 1 ){
242  gFEXtowerID = gFEXtowerID + ((iPhi*24) + 12);
243  iPhiFW = (iPhi*2)+1;
244  iEtaFW = 2;
245  }
246  else if ( iEta == 2 ){
247  gFEXtowerID = gFEXtowerID + ((iPhi*24) + 1);
248  iPhiFW = iPhi*2;
249  iEtaFW = 3;
250  }
251  else if ( iEta == 3 ){
252  gFEXtowerID = gFEXtowerID + ((iPhi*24) + 13);
253  iPhiFW = (iPhi*2)+1;
254  iEtaFW = 3;
255  }
256  else if ( iEta >= 4 and iEta <= 7 ){
257  gFEXtowerID = gFEXtowerID + ((iPhi*12) + (iEta -2));
258  }
259 
260  }
261 
262  else if ( Eta > 0 ){
263 
264  if ( iEta >= 32 and iEta <= 35){
265  gFEXtowerID = gFEXtowerID + (iPhi*12) + (iEta -32 +6);
266  }
267  else if ( iEta == 36 ){
268  gFEXtowerID = gFEXtowerID + ((iPhi*24) + 22);
269  iPhiFW = (iPhi*2)+1;
270  iEtaFW = 36;
271  }
272  else if ( iEta == 37 ){
273  gFEXtowerID = gFEXtowerID + ((iPhi*24) + 10);
274  iPhiFW = iPhi*2;
275  iEtaFW = 36;
276  }
277  else if ( iEta == 38 ){
278  gFEXtowerID = gFEXtowerID + ((iPhi*24) + 23);
279  iPhiFW = (iPhi*2)+1;
280  iEtaFW = 37;
281  }
282  else if ( iEta == 39 ){
283  gFEXtowerID = gFEXtowerID + ((iPhi*24) + 11);
284  iPhiFW = iPhi*2;
285  iEtaFW = 37;
286  }
287  }
288 
289  }
290 
291  return gFEXtowerID;
292 
293  }

◆ getID()

int LVL1::gTower::getID ( ) const

Add to ET

Return unique identifier.

Get unique ID of tower

Definition at line 124 of file gTower.cxx.

124  {
125  return m_tower_id;
126  }

◆ getPosNeg()

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

Definition at line 103 of file gTower.h.

103 {return m_posneg;}

◆ getSCIDs()

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

Definition at line 96 of file gTower.h.

96 { return m_scID; }

◆ id()

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

Definition at line 73 of file gTower.h.

73 {return m_tower_id;}

◆ iEta()

int LVL1::gTower::iEta ( ) const

Get coordinates of tower.

Definition at line 129 of file gTower.cxx.

129  {
130  int index = (m_eta * m_posneg);
131  if (m_posneg < 0){
132  index = index + 19;
133  }
134  else if ((m_posneg > 0)){
135  index = index + 20;
136  }
137 
138  return index;
139  }

◆ iPhi()

int LVL1::gTower::iPhi ( ) const

Definition at line 142 of file gTower.cxx.

142  {
143  return m_phi;
144  }

◆ isSaturated()

char LVL1::gTower::isSaturated ( ) const

Returns true if is saturated.

Definition at line 179 of file gTower.cxx.

179  {
180  return m_saturated;
181  }

◆ noiseCut()

bool LVL1::gTower::noiseCut ( int  et) const

Apply supercell noise cut.

Apply noise cut per layer.

Definition at line 112 of file gTower.cxx.

113  {
114 
115  bool pass = true;
116 
117  if(et < m_noisecut){ pass = false; }
118 
119  return pass;
120 
121  }

◆ phi()

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

Definition at line 69 of file gTower.h.

69 {return m_phi_float;};

◆ setET()

void LVL1::gTower::setET ( )

Definition at line 75 of file gTower.cxx.

76  {
77 
78  // addET(et, layer);
79 
80  //multi linear digitisation encoding
81  unsigned int gcode = gFEXCompression::compress(m_et_float_perlayer[0]);//Only decode EM energy
82  int emET = gFEXCompression::expand(gcode);
83  int outET = emET + m_et_float_perlayer[1];//Sum EM and HAD energy
84 
85  outET = outET/200.;//Convert to gFEX digit scale (200 MeV tbc)
86 
87  //noise cut
88  const bool SCpass = noiseCut(outET);
89  if (SCpass){ m_et = outET; }
90  else{ m_et = 0; }
91  }

◆ setEta()

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

Definition at line 71 of file gTower.h.

71 { m_eta = thiseta; }

◆ setIsSaturated()

void LVL1::gTower::setIsSaturated ( char  isSaturated)

Sets saturation flag.

Definition at line 175 of file gTower.cxx.

175  {
177  }

◆ setPosNeg()

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

Definition at line 55 of file gTower.cxx.

55  {
56 
57  m_posneg = posneg;
58 
59  return;
60 
61  }

◆ setSCID()

void LVL1::gTower::setSCID ( Identifier  ID)

Set supercell position ID.

Definition at line 102 of file gTower.cxx.

103  {
104 
105  m_scID.push_back(ID);
106 
107  return;
108 
109  }

◆ setTotalEt()

void LVL1::gTower::setTotalEt ( int  totEt)

Definition at line 93 of file gTower.cxx.

94  {
95 
96  m_et = totEt;
97 
98  return;
99  }

Member Data Documentation

◆ m_et

int LVL1::gTower::m_et
private

Definition at line 124 of file gTower.h.

◆ m_et_float

float LVL1::gTower::m_et_float
private

Definition at line 127 of file gTower.h.

◆ m_et_float_perlayer

std::vector<float> LVL1::gTower::m_et_float_perlayer
private

Definition at line 128 of file gTower.h.

◆ m_eta

int LVL1::gTower::m_eta
private

Internal data.

Definition at line 122 of file gTower.h.

◆ m_eta_float

float LVL1::gTower::m_eta_float
private

Definition at line 125 of file gTower.h.

◆ m_noisecut

int LVL1::gTower::m_noisecut = -100000
private

Definition at line 133 of file gTower.h.

◆ m_phi

int LVL1::gTower::m_phi
private

Definition at line 123 of file gTower.h.

◆ m_phi_float

float LVL1::gTower::m_phi_float
private

Definition at line 126 of file gTower.h.

◆ m_posneg

int LVL1::gTower::m_posneg = 0
private

Definition at line 132 of file gTower.h.

◆ m_saturated

char LVL1::gTower::m_saturated
private

Definition at line 135 of file gTower.h.

◆ m_scID

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

Definition at line 129 of file gTower.h.

◆ m_tower_id

int LVL1::gTower::m_tower_id
private

Definition at line 131 of file gTower.h.


The documentation for this class was generated from the following files:
et
Extra patterns decribing particle interation process.
LVL1::gTower::noiseCut
bool noiseCut(int et) const
Apply supercell noise cut.
Definition: gTower.cxx:112
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
LVL1::gTower::m_eta
int m_eta
Internal data.
Definition: gTower.h:122
index
Definition: index.py:1
LVL1::gFEXCompression::compress
static unsigned int compress(float Energy)
Compress data.
Definition: gFEXCompression.cxx:20
LVL1::gTower::getEtaPhi
void getEtaPhi(float &Eta, float &Phi, int iEta, int iPhi) const
Calculates eta and phi from ieta and iphi.
Definition: gTower.cxx:295
LVL1::gTower::isSaturated
char isSaturated() const
Returns true if is saturated.
Definition: gTower.cxx:179
LVL1::gTower::getFWID
int getFWID() const
Calculates and returns the firmware ID.
Definition: gTower.cxx:184
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::gTower::m_et_float
float m_et_float
Definition: gTower.h:127
Phi
@ Phi
Definition: RPCdef.h:8
LVL1::gTower::iPhi
int iPhi() const
Definition: gTower.cxx:142
LVL1::gTower::m_et_float_perlayer
std::vector< float > m_et_float_perlayer
Definition: gTower.h:128
LVL1::gFEXCompression::expand
static int expand(unsigned int code)
Uncompress data.
Definition: gFEXCompression.cxx:50
LVL1::gTower::m_scID
std::vector< Identifier > m_scID
Definition: gTower.h:129
LVL1::gTower::m_eta_float
float m_eta_float
Definition: gTower.h:125
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LVL1::gTower::m_phi
int m_phi
Definition: gTower.h:123
LVL1::gTower::clear_scIDs
void clear_scIDs()
Clear and resize Identifier value vector.
Definition: gTower.cxx:50
LVL1::gTower::eta
float eta() const
Definition: gTower.h:68
LVL1::gTower::m_tower_id
int m_tower_id
Definition: gTower.h:131
DeMoScan.index
string index
Definition: DeMoScan.py:364
LVL1::gTower::clearET
void clearET()
Clear supercell ET values.
Definition: gTower.cxx:42
LVL1::gTower::m_phi_float
float m_phi_float
Definition: gTower.h:126
LVL1::gTower::iEta
int iEta() const
Get coordinates of tower.
Definition: gTower.cxx:129
LVL1::gTower::m_posneg
int m_posneg
Definition: gTower.h:132
LVL1::gTower::m_et
int m_et
Definition: gTower.h:124
Eta
@ Eta
Definition: RPCdef.h:8
LVL1::gTower::m_noisecut
int m_noisecut
Definition: gTower.h:133
LVL1::gTower::m_saturated
char m_saturated
Definition: gTower.h:135