ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::eFexTower_v1 Class Reference

Class describing input data of a LVL1 eFEX. More...

#include <eFexTower_v1.h>

Inheritance diagram for xAOD::eFexTower_v1:
Collaboration diagram for xAOD::eFexTower_v1:

Public Member Functions

float eta () const
 The pseudorapidity ( \(\eta\)).
void setEta (float)
 getter for the global eta value (float)
float phi () const
 setter for the above
void setPhi (float)
 getter for the global phi value (float)
uint8_t module () const
 setter for the above
void setModule (uint8_t)
 getter for the module number [0-23] inclusive
uint8_t fpga () const
 setter for the above
void setFpga (uint8_t)
 getter for the fpga number [0-3] inclusive
int32_t id () const
 setter for the above
const std::vector< uint16_t > & et_count () const
 get Energy Counts
void setEt_count (const std::vector< uint16_t > &)
 getter for the 11 energy counts
void setEt_count (std::vector< uint16_t > &&)
 setter for the above
bool disconnectedCount (size_t idx) const
 setter for the above
size_t cellIdx (uint32_t layer, uint32_t cell=0) const
 Obtain the index in the count vector of a given supercell returns et_count().size() if cell is invalid.
int cellEt (uint32_t layer, uint32_t cell=0) const
 supercell Et in MeV layer: 0-4 (ps,l1,l2,l3,had) cell: 0-3 for l1,l2, 0 otherwise will return 0 if the cell is disconnected or invalid
uint32_t em_status () const
 get em status bit
void setEm_status (uint32_t)
 getter for the electromagnetic status bit
uint32_t had_status () const
 setter for the above
void setHad_status (uint32_t)
 getter for hadronic status bit
uint32_t eFEXtowerID () const
 setter for the above
void initialize (const float Eta, const float Phi)
 getter for the etower simulation ID
void initialize (const float Eta, const float Phi, const std::vector< uint16_t > &Et_count, const uint8_t Module, const uint8_t Fpga, const uint32_t Em_status, const uint32_t Had_status)

Static Public Attributes

static const int c_missingCountCode = 1025

Detailed Description

Class describing input data of a LVL1 eFEX.

Definition at line 22 of file eFexTower_v1.h.

Member Function Documentation

◆ cellEt()

int xAOD::eFexTower_v1::cellEt ( uint32_t layer,
uint32_t cell = 0 ) const

supercell Et in MeV layer: 0-4 (ps,l1,l2,l3,had) cell: 0-3 for l1,l2, 0 otherwise will return 0 if the cell is disconnected or invalid

Definition at line 120 of file eFexTower_v1.cxx.

120 {
121
122 auto idx = cellIdx(layer,cell);
123 if(idx == et_count().size()) return 0;
124 if(disconnectedCount(idx)) return 0;
125 auto count = et_count().at(idx);
126 // convert count to MeV using either LATOME or Tile energy scales
127 if (layer==4 && std::abs(eta()+0.025)<1.5) {
128 // Tile energy scale (500MeV per count)
129 return count*500;
130 }
131
132 // Deal with special codes first:
133 if (count == 0) return 0; // NoData
134 if (count == 1021 || count == 1022 || count > 1023) return 0; // Reserved || Invalid || OutOfRange
135 if (count == 1023) return 65535*25; // Saturated case, return saturated value;
136
137 if (count >= 768) return 44000 + (count-768)*400;
138 if (count >= 512) return 18400 + (count-512)*100;
139 if (count >= 256) return 5600 + (count-256)*50;
140 return -750 + (count-2)*25;
141 }
size_t size() const
Number of registered mappings.
const std::vector< uint16_t > & et_count() const
get Energy Counts
size_t cellIdx(uint32_t layer, uint32_t cell=0) const
Obtain the index in the count vector of a given supercell returns et_count().size() if cell is invali...
bool disconnectedCount(size_t idx) const
setter for the above
float eta() const
The pseudorapidity ( ).
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148

◆ cellIdx()

size_t xAOD::eFexTower_v1::cellIdx ( uint32_t layer,
uint32_t cell = 0 ) const

Obtain the index in the count vector of a given supercell returns et_count().size() if cell is invalid.

Definition at line 111 of file eFexTower_v1.cxx.

111 {
112
113 if(cell > 3 || (layer!=1 && layer!=2 && cell>0)) return et_count().size();
114 // for |eta|>2.4 towers, the l1 energy (which is in the last slot) is treated as ps
115 if(layer==0 && std::abs(eta()+0.025)>2.4) return 4;
116 return (layer>0)*1 + (layer>1)*4 + (layer>2)*4 + (layer>3)*1 + cell;
117
118 }
@ layer
Definition HitInfo.h:79

◆ disconnectedCount()

bool xAOD::eFexTower_v1::disconnectedCount ( size_t idx) const

setter for the above

check if slot is actually connected some slots can be disconnected entirely (will have 0 in them) or can be pathalogically connected but not used by the module's algorithms at all (they are out of range) These are also flagged as disconnected

Definition at line 77 of file eFexTower_v1.cxx.

77 {
78 if(idx>11) return true;
80 double eta = eFexTower_v1::eta() + 0.025;
81 double phi = eFexTower_v1::phi() + 0.025;
82
83 if ( std::abs(eta)>1.8 && idx==0 ) return true; // no PS beyond 1.8
84 if ( std::abs(eta)>2.4 && idx>0 && idx<5 ) return idx!=4; // only the 'last' l1 is connected
85
86 if (mod>23) return false; // all emulated towers are connected
87
88 // extremities of the real modules are disconnected
89 // em inputs at most extreme phi of module are all disconnected
90 // as well as the last two in eta of each module (modules centered at eta = -1.6,0,1.6 ... extent in em inputs is +/- 1.0 (1.1 ish for the A/C modules) )
91 // exception is the eta=+/-2.45 inputs at the extreme of efex environment, which are present in the most extreme phi still.
92 // meaning |eta|>2.4 is all connected
93
94 double module_central_eta = 1.6*(mod%3-1);
95
96 if( std::abs(eta)<2.4 &&
97 idx!=11 &&
98 (std::abs(std::remainder(phi - (M_PI/32)*(8*(mod/3) + 6 - (mod>11)*64),2*M_PI)) > 5.*M_PI/32 || std::abs( module_central_eta - (eta) ) > 1.0 )
99 ) {
100 return true;
101 }
102
103 // finally, we also treat any input tower that is too far away from the centre of the module it is feeding as 'disconnected'
104 // it shouldn't be in use by any algorithm at least
105 double fpga_central_eta = module_central_eta + 0.4*(int(fpga())-2) + 0.2;
106 if ( std::abs(fpga_central_eta - eta) > 0.3 ) return true;
107
108 return false;
109 };
#define M_PI
float phi() const
setter for the above
uint8_t module() const
setter for the above
uint8_t fpga() const
setter for the above
setRawEt setRawPhi int

◆ eFEXtowerID()

uint32_t xAOD::eFexTower_v1::eFEXtowerID ( ) const

setter for the above

get the Simulation ID

Definition at line 23 of file eFexTower_v1.cxx.

23 {
24 // Calculate ID by hand from coordinate
25 float eta = this->eta(); float phi = this->phi();
26 int posneg = (eta >= 0 ? 1 : -1);
27 int towereta = std::abs(eta+0.025)/0.1;
28 if (phi < 0) phi += 2*M_PI;
29 int towerphi = int(32*(phi+0.025)/M_PI);
30 unsigned int tower_id = towerphi + 64*towereta;
31
32 if (towereta < 14) {
33 tower_id += (posneg > 0 ? 200000 : 100000);
34 }
35 else if (towereta == 14) {
36 tower_id += (posneg > 0 ? 400000 : 300000);
37 }
38 else {
39 tower_id += (posneg > 0 ? 600000 : 500000);
40 }
41
42 return tower_id;
43 }

◆ em_status()

uint32_t xAOD::eFexTower_v1::em_status ( ) const

get em status bit

◆ et_count()

const std::vector< uint16_t > & xAOD::eFexTower_v1::et_count ( ) const

get Energy Counts

◆ eta()

float xAOD::eFexTower_v1::eta ( ) const

The pseudorapidity ( \(\eta\)).

◆ fpga()

uint8_t xAOD::eFexTower_v1::fpga ( ) const

setter for the above

get fpga number

◆ had_status()

uint32_t xAOD::eFexTower_v1::had_status ( ) const

setter for the above

get em status bit

◆ id()

int32_t xAOD::eFexTower_v1::id ( ) const

setter for the above

get tower identifer which is assembled from the above data members Is in the form of a signed 7 digit number: +/- XXYYMMF +/- = a/c side XX is eta (from 1 to 25) YY is phi (from 00 to 63) MM is module (from 00 to 23, or 99 otherwise) F is fpga (from 0 to 3, or 9 otherwise)

Definition at line 69 of file eFexTower_v1.cxx.

69 {
70 int etaIndex = int( (eta()+0.025)*10 ) + (((eta()+0.025)<0) ? -1 : 1); // runs from -25 to 25 (excluding 0)
71 int phiIndex = int( (phi()+0.025)*32./ROOT::Math::Pi() ) + ((phi()+0.025)<0 ? 63 : 0); // runs from 0 to 63
72 int modIndex = ( module()>23 ) ? 99 : module(); // module runs from 0 to 23 or otherwise takes value 99
73 int fpgaIndex = ( fpga() > 3 ) ? 9 : fpga(); //from runs from 0 to 3 or otherwise takes value 9
74 return (std::abs(etaIndex)*100000 + phiIndex*1000 + modIndex*10 +fpgaIndex)*(etaIndex<0 ? -1 : 1);
75 }
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23

◆ initialize() [1/2]

void xAOD::eFexTower_v1::initialize ( const float Eta,
const float Phi )

getter for the etower simulation ID

initialize

Definition at line 47 of file eFexTower_v1.cxx.

48 {
49 setEta( Eta );
50 setPhi( Phi );
51 }
@ Phi
Definition RPCdef.h:8
@ Eta
Definition RPCdef.h:8
void setEta(float)
getter for the global eta value (float)
void setPhi(float)
getter for the global phi value (float)

◆ initialize() [2/2]

void xAOD::eFexTower_v1::initialize ( const float Eta,
const float Phi,
const std::vector< uint16_t > & Et_count,
const uint8_t Module,
const uint8_t Fpga,
const uint32_t Em_status,
const uint32_t Had_status )

Definition at line 53 of file eFexTower_v1.cxx.

59 {
60 setEta( Eta );
61 setPhi( Phi );
62 setEt_count( Et_count );
63 setModule( Module );
64 setFpga( Fpga );
65 setEm_status( Em_status );
66 setHad_status( Had_status );
67 }
void setFpga(uint8_t)
getter for the fpga number [0-3] inclusive
void setEt_count(const std::vector< uint16_t > &)
getter for the 11 energy counts
void setHad_status(uint32_t)
getter for hadronic status bit
void setModule(uint8_t)
getter for the module number [0-23] inclusive
void setEm_status(uint32_t)
getter for the electromagnetic status bit

◆ module()

uint8_t xAOD::eFexTower_v1::module ( ) const

setter for the above

get module number

◆ phi()

float xAOD::eFexTower_v1::phi ( ) const

setter for the above

The azimuthal angle ( \(\phi\))

◆ setEm_status()

void xAOD::eFexTower_v1::setEm_status ( uint32_t )

getter for the electromagnetic status bit

set em status bit

◆ setEt_count() [1/2]

void xAOD::eFexTower_v1::setEt_count ( const std::vector< uint16_t > & )

getter for the 11 energy counts

set Energy Counts

◆ setEt_count() [2/2]

void xAOD::eFexTower_v1::setEt_count ( std::vector< uint16_t > && )

setter for the above

◆ setEta()

void xAOD::eFexTower_v1::setEta ( float )

getter for the global eta value (float)

◆ setFpga()

void xAOD::eFexTower_v1::setFpga ( uint8_t )

getter for the fpga number [0-3] inclusive

set fpga number

◆ setHad_status()

void xAOD::eFexTower_v1::setHad_status ( uint32_t )

getter for hadronic status bit

set em status bit

◆ setModule()

void xAOD::eFexTower_v1::setModule ( uint8_t )

getter for the module number [0-23] inclusive

set module number

◆ setPhi()

void xAOD::eFexTower_v1::setPhi ( float )

getter for the global phi value (float)

Member Data Documentation

◆ c_missingCountCode

const int xAOD::eFexTower_v1::c_missingCountCode = 1025
static

Definition at line 24 of file eFexTower_v1.h.


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