ATLAS Offline Software
Loading...
Searching...
No Matches
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.
 gTower (int eta, int phi, int nphi, int id_modifier, int posneg)
 constructs a tower and sets the coordinates and identifier
 ~gTower ()
 Destructor.
void clearET ()
 Clear supercell ET values.
void clear_scIDs ()
 Clear and resize Identifier value vector.
void addET (float et, int layer)
 Add ET in MeV, layer refers to EM or HAD (Tile).
int getID () const
 Add to ET.
int iEta () const
 Get coordinates of tower.
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.
float getET_float () const
 Get ET (total) in MeV FLOAT VERSION.
int getET_EM_float () const
 Get ET in MeV from EM calo FLOAT VERSION.
int getET_HAD_float () const
 Get ET in MeV from HAD calo FLOAT VERSION.
void setET ()
void setTotalEt (int totEt)
void setSCID (Identifier ID)
 Set supercell position ID.
const std::vector< Identifier > & getSCIDs () const
bool noiseCut (int et) const
 Apply supercell noise cut.
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.
int getFWID () const
 Calculates and returns the firmware ID.
void getEtaPhi (float &Eta, float &Phi, int iEta, int iPhi) const
 Calculates eta and phi from ieta and iphi.
void setIsSaturated (char isSaturated)
 Sets saturation flag.
char isSaturated () const
 Returns true if is saturated.

Private Attributes

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

Detailed Description

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

  • to provide inputs to the algorithms in a way that reflects the cell structure within a tower (the basic element of an gFEX algorithm window)
  • to hide the details of the individual data sources, e.g. which hadronic cells are LAr and which are HEC, from the algorithms It needs to contain supercell ET values and a tower coordinate or identifier (not yet defined). ET values should be on the gFEX's internal ET scale, not MeV. This should be a purely transient object, but will need to enter the transient event store (so class_def etc will be needed before it can be used for real)

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.

19 {
20 m_et_float_perlayer.assign(2, 0.0);
21 }
std::vector< float > m_et_float_perlayer
Definition gTower.h:128

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

24 :
25 m_eta(ieta),
26 m_phi(iphi),
27 m_tower_id(id_modifier + iphi + (nphi * ieta)),
28 m_posneg(posneg)
29 {
30 m_et_float_perlayer.assign(2, 0.0);
32 }
float m_phi_float
Definition gTower.h:126
int m_posneg
Definition gTower.h:132
int m_eta
Internal data.
Definition gTower.h:122
int iPhi() const
Definition gTower.cxx:135
int m_tower_id
Definition gTower.h:131
int iEta() const
Get coordinates of tower.
Definition gTower.cxx:122
float m_eta_float
Definition gTower.h:125
void getEtaPhi(float &Eta, float &Phi, int iEta, int iPhi) const
Calculates eta and phi from ieta and iphi.
Definition gTower.cxx:288

◆ ~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 58 of file gTower.cxx.

59 {
60
61 m_et_float_perlayer[layer] += et; // for monitoring
62 m_et_float += et;
63
64 return;
65
66 }
float et(const xAOD::jFexSRJetRoI *j)
float m_et_float
Definition gTower.h:127
@ layer
Definition HitInfo.h:79

◆ clear_scIDs()

void LVL1::gTower::clear_scIDs ( )

Clear and resize Identifier value vector.

Definition at line 43 of file gTower.cxx.

44 {
45 m_scID.clear();
46 }
std::vector< Identifier > m_scID
Definition gTower.h:129

◆ clearET()

void LVL1::gTower::clearET ( )

Clear supercell ET values.

Clear and resize ET value vector.

Definition at line 35 of file gTower.cxx.

36 {
37 m_et = 0;
38 m_et_float = 0.0;
39 m_et_float_perlayer.assign(2, 0.0);
40 }

◆ 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 140 of file gTower.cxx.

140 {
141
142 return m_et;
143
144 }

◆ 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 155 of file gTower.cxx.

155 {
156
157 return m_et_float_perlayer[0];
158
159 }

◆ getET_float()

float LVL1::gTower::getET_float ( ) const

Get ET (total) in MeV FLOAT VERSION.

Return ET (total) FLOAT VERSION.

Definition at line 147 of file gTower.cxx.

147 {
148
149 // Return ET
150 return m_et_float;
151
152 }

◆ 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 162 of file gTower.cxx.

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

◆ 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 288 of file gTower.cxx.

288 {
289
290 constexpr float s_centralPhiWidth = (2*M_PI)/32; //In central region, gFex has 32 bins in phi
291 constexpr float s_forwardPhiWidth = (2*M_PI)/16; //In forward region, gFex has 16 bins in phi (before rearranging bins)
292
293 constexpr std::array<float, 40> s_EtaCenter = { -4.5, -3.8, -3.38, -3.18, -3.15, -3,
294 -2.8, -2.6, -2.35, -2.1, -1.9, -1.7, -1.5, -1.3, -1.1, -0.9,
295 -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1,
296 1.3, 1.5, 1.7, 1.9, 2.1, 2.35, 2.6, 2.8, 3.0,
297 3.15, 3.18, 3.38, 3.8, 4.5};
298
299 Eta = s_EtaCenter.at(iEta);
300
301 float Phi_gFex = -99;
302 if (( iEta <= 3 ) || ( (iEta >= 36) )){
303 Phi_gFex = ( (iPhi * s_forwardPhiWidth) + s_forwardPhiWidth/2);
304 }
305 else {
306 Phi_gFex = ( (iPhi * s_centralPhiWidth) + s_centralPhiWidth/2);
307 }
308
309 if (Phi_gFex < M_PI) {
310 Phi = Phi_gFex;
311 }
312 else {
313 Phi = (Phi_gFex - 2*M_PI);
314 }
315 }
#define M_PI
@ Phi
Definition RPCdef.h:8
@ Eta
Definition RPCdef.h:8

◆ getFWID() [1/2]

int LVL1::gTower::getFWID ( ) const

Calculates and returns the firmware ID.

Definition at line 177 of file gTower.cxx.

177 {
178 int iPhiFW, iEtaFW;
179 return getFWID(iPhiFW, iEtaFW);
180 }
int getFWID() const
Calculates and returns the firmware ID.
Definition gTower.cxx:177

◆ 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 195 of file gTower.cxx.

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

◆ getID()

int LVL1::gTower::getID ( ) const

Add to ET.

Return unique identifier.

Get unique ID of tower

Definition at line 117 of file gTower.cxx.

117 {
118 return m_tower_id;
119 }

◆ 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 122 of file gTower.cxx.

122 {
123 int index = (m_eta * m_posneg);
124 if (m_posneg < 0){
125 index = index + 19;
126 }
127 else if ((m_posneg > 0)){
128 index = index + 20;
129 }
130
131 return index;
132 }
str index
Definition DeMoScan.py:362

◆ iPhi()

int LVL1::gTower::iPhi ( ) const

Definition at line 135 of file gTower.cxx.

135 {
136 return m_phi;
137 }

◆ isSaturated()

char LVL1::gTower::isSaturated ( ) const

Returns true if is saturated.

Definition at line 172 of file gTower.cxx.

172 {
173 return m_saturated;
174 }
char m_saturated
Definition gTower.h:135

◆ noiseCut()

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

Apply supercell noise cut.

Apply noise cut per layer.

Definition at line 105 of file gTower.cxx.

106 {
107
108 bool pass = true;
109
110 if(et < m_noisecut){ pass = false; }
111
112 return pass;
113
114 }
int m_noisecut
Definition gTower.h:133

◆ 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 68 of file gTower.cxx.

69 {
70
71 // addET(et, layer);
72
73 //multi linear digitisation encoding
74 unsigned int gcode = gFEXCompression::compress(m_et_float_perlayer[0]);//Only decode EM energy
75 int emET = gFEXCompression::expand(gcode);
76 int outET = emET + m_et_float_perlayer[1];//Sum EM and HAD energy
77
78 outET = outET/200.;//Convert to gFEX digit scale (200 MeV tbc)
79
80 //noise cut
81 const bool SCpass = noiseCut(outET);
82 if (SCpass){ m_et = outET; }
83 else{ m_et = 0; }
84 }
static int expand(unsigned int code)
Uncompress data.
static unsigned int compress(float Energy)
Compress data.
bool noiseCut(int et) const
Apply supercell noise cut.
Definition gTower.cxx:105

◆ 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 168 of file gTower.cxx.

168 {
170 }
char isSaturated() const
Returns true if is saturated.
Definition gTower.cxx:172

◆ setPosNeg()

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

Definition at line 48 of file gTower.cxx.

48 {
49
51
52 return;
53
54 }

◆ setSCID()

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

Set supercell position ID.

Definition at line 95 of file gTower.cxx.

96 {
97
98 m_scID.push_back(ID);
99
100 return;
101
102 }

◆ setTotalEt()

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

Definition at line 86 of file gTower.cxx.

87 {
88
89 m_et = totEt;
90
91 return;
92 }

Member Data Documentation

◆ m_et

int LVL1::gTower::m_et = 0
private

Definition at line 124 of file gTower.h.

◆ m_et_float

float LVL1::gTower::m_et_float = 0
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 = 0
private

Internal data.

Definition at line 122 of file gTower.h.

◆ m_eta_float

float LVL1::gTower::m_eta_float = 0
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 = 0
private

Definition at line 123 of file gTower.h.

◆ m_phi_float

float LVL1::gTower::m_phi_float = 0
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 = 0
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 = -9999999
private

Definition at line 131 of file gTower.h.


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