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 this->clear_scIDs();
21 this->clearET();
22 }
void clear_scIDs()
Clear and resize Identifier value vector.
Definition gTower.cxx:45
void clearET()
Clear supercell ET values.
Definition gTower.cxx:37

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

25 :
26 m_eta(ieta),
27 m_phi(iphi),
28 m_tower_id(id_modifier + iphi + (nphi * ieta)),
29 m_posneg(posneg)
30 {
31 this->clear_scIDs();
32 this->clearET();
34 }
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:137
int m_tower_id
Definition gTower.h:131
int iEta() const
Get coordinates of tower.
Definition gTower.cxx:124
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:290

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

61 {
62
63 m_et_float_perlayer[layer] += et; // for monitoring
64 m_et_float += et;
65
66 return;
67
68 }
float et(const xAOD::jFexSRJetRoI *j)
std::vector< float > m_et_float_perlayer
Definition gTower.h:128
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 45 of file gTower.cxx.

46 {
47 m_scID.clear();
48 }
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 37 of file gTower.cxx.

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

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

142 {
143
144 return m_et;
145
146 }

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

157 {
158
159 return m_et_float_perlayer[0];
160
161 }

◆ getET_float()

float LVL1::gTower::getET_float ( ) const

Get ET (total) in MeV FLOAT VERSION.

Return ET (total) FLOAT VERSION.

Definition at line 149 of file gTower.cxx.

149 {
150
151 // Return ET
152 return m_et_float;
153
154 }

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

164 {
165
166 return m_et_float_perlayer[1];
167
168 }

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

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

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

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

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

119 {
120 return m_tower_id;
121 }

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

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

◆ iPhi()

int LVL1::gTower::iPhi ( ) const

Definition at line 137 of file gTower.cxx.

137 {
138 return m_phi;
139 }

◆ isSaturated()

char LVL1::gTower::isSaturated ( ) const

Returns true if is saturated.

Definition at line 174 of file gTower.cxx.

174 {
175 return m_saturated;
176 }
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 107 of file gTower.cxx.

108 {
109
110 bool pass = true;
111
112 if(et < m_noisecut){ pass = false; }
113
114 return pass;
115
116 }
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 70 of file gTower.cxx.

71 {
72
73 // addET(et, layer);
74
75 //multi linear digitisation encoding
76 unsigned int gcode = gFEXCompression::compress(m_et_float_perlayer[0]);//Only decode EM energy
77 int emET = gFEXCompression::expand(gcode);
78 int outET = emET + m_et_float_perlayer[1];//Sum EM and HAD energy
79
80 outET = outET/200.;//Convert to gFEX digit scale (200 MeV tbc)
81
82 //noise cut
83 const bool SCpass = noiseCut(outET);
84 if (SCpass){ m_et = outET; }
85 else{ m_et = 0; }
86 }
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:107

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

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

◆ setPosNeg()

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

Definition at line 50 of file gTower.cxx.

50 {
51
52 m_posneg = posneg;
53
54 return;
55
56 }

◆ setSCID()

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

Set supercell position ID.

Definition at line 97 of file gTower.cxx.

98 {
99
100 m_scID.push_back(ID);
101
102 return;
103
104 }
std::vector< Identifier > ID

◆ setTotalEt()

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

Definition at line 88 of file gTower.cxx.

89 {
90
91 m_et = totEt;
92
93 return;
94 }

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: