ATLAS Offline Software
Loading...
Searching...
No Matches
jFexFwdElRoI_v1.cxx
Go to the documentation of this file.
1
2// Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
4
5
6// System include(s):
7#include <stdexcept>
8
9// xAOD include(s):
11
12// Local include(s):
14#include "getQuadrant.h"
15
16namespace xAOD {
17
18 //eta position in FCAL FPGAs
19 const std::vector<int> jFexFwdElRoI_v1::s_FWD_EtaPosition = {0, 8, //Region 1
20 9, 11, //Region 2
21 12, //Region 3
22 13, 24}; //Region 4
23 //eta position of FCAL EM layer as an integer
24 const std::vector<int> jFexFwdElRoI_v1::s_FCAL_EtaPosition = {32,34,35,37,38,40,41,43,44,46,47,49};
25
26
55
57 // adapted from TSU::toTopoInteger
58 static const unsigned int RESOLUTION = 40;
59 float tmp = eta()*RESOLUTION;
60 int index;
61 if ( (abs(tmp)-0.5)/2. == std::round((abs(tmp)-0.5)/2.) ) {
62 if ( tmp>0 ) { index = std::floor(tmp); }
63 else { index = std::ceil(tmp); }
64 } else {
65 index = std::round(tmp);
66 }
67 return index/4; // note: unlike SR and LR jets, apparently this can be signed?
68 }
69
70 //----------------
72 //----------------
73
76
77
79 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexFwdElRoI_v1, uint8_t , jFexNumber , setjFexNumber )
80 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexFwdElRoI_v1, uint8_t , fpgaNumber , setfpgaNumber )
81
82
83 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexFwdElRoI_v1, uint8_t , tobLocalEta , setTobLocalEta )
84 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexFwdElRoI_v1, uint8_t , tobLocalPhi , setTobLocalPhi )
90 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexFwdElRoI_v1, int , globalEta, setGlobalEta )
92
93
96
97
99
100
105
106 //-----------------
108 //-----------------
109
110
111
112 //Hardware coordinate elements
113
114 //Raw ET on TOB scale (200 MeV/count)
116 return (tobWord() >> s_etBit) & s_etMask;
117 }
118
119 //Return the isolation bit
121 return (tobWord() >> s_isoBit) & s_isoMask;
122 }
123
124 //Return the emfraction1 bit
125 unsigned int jFexFwdElRoI_v1::unpackEMf1TOB() const{
126 return (tobWord() >> s_emf1Bit) & s_emf1Mask;
127 }
128
129 //Return the emfraction2 bit
130 unsigned int jFexFwdElRoI_v1::unpackEMf2TOB() const{
131 return (tobWord() >> s_emf2Bit) & s_emf2Mask;
132 }
133
134 //Return an eta index
135 unsigned int jFexFwdElRoI_v1::unpackEtaIndex() const {
136 return (tobWord() >> s_etaBit) & s_etaMask;
137 }
138 //Return a phi index
139 unsigned int jFexFwdElRoI_v1::unpackPhiIndex() const {
140 return (tobWord() >> s_phiBit) & s_phiMask;
141 }
142
143 //Return sat flag
145 return (tobWord() >> s_satBit) & s_satMask;
146 }
147
149
151 unsigned int jFexFwdElRoI_v1::et() const {
152 //return TOB Et in a 1 MeV scale
153 return tobEt()*tobEtScale();
154 }
155
157
158 //global coords
159
161
162 int globalEta = 0;
163
164 if(jFexNumber()==5 ) {
165
166 if(tobLocalEta() <=s_FWD_EtaPosition[1]) { //Region 1
167 globalEta = (tobLocalEta() + (8*(jFexNumber() -3)) );
168 }
169 else if(tobLocalEta() <=s_FWD_EtaPosition[3]) { //Region 2
170 globalEta = 25 +2*(tobLocalEta()-9);
171 }
172 else if(tobLocalEta() == s_FWD_EtaPosition[4] ) { //Region 3
173 globalEta = 31;
174 }
175 else if(tobLocalEta() <= s_FWD_EtaPosition[6]) { //Region 4
177 }
178
179 }
180 else if(jFexNumber()==0) {
181
182 if(tobLocalEta() <=s_FWD_EtaPosition[1]) { //Region 1
183 globalEta = (8-tobLocalEta() + (8*(jFexNumber() -3)) )-1;
184 }
185 else if(tobLocalEta() <=s_FWD_EtaPosition[3]) { //Region 2
186 globalEta = -27 -2*(tobLocalEta()-9);
187 }
188 else if(tobLocalEta() == s_FWD_EtaPosition[4] ) { //Region 3
189 globalEta = -32;
190 }
191 else if(tobLocalEta() <= s_FWD_EtaPosition[6]) { //Region 4
193 }
194 }
195 else { //Module 1-4
196 globalEta = (tobLocalEta() + (8*(jFexNumber() -3)) );
197 }
198
199 return globalEta;
200 }
201
202
204
205 uint globalPhi = 0;
206 const unsigned int quadrant = ::getQuadrant(fpgaNumber());
207
208 //16 is the phi height of an FPGA
209 if(jFexNumber() == 0 || jFexNumber() == 5) {
210
211 if(tobLocalEta() <=s_FWD_EtaPosition[1]) { //Region 1
212 globalPhi = tobLocalPhi() + (quadrant * 16);
213 }
214 else if(tobLocalEta() <=s_FWD_EtaPosition[4]) {//Region 2 and Region 3 have the same granularity
215 globalPhi = (16*quadrant) + 2*(tobLocalPhi());
216 }
217 else if(tobLocalEta() <=s_FWD_EtaPosition[6]) {//Region 4
218 globalPhi = (16*quadrant) + 4*(tobLocalPhi())+1;
219 }
220 }
221 else { //Modules 1-4
222 globalPhi = tobLocalPhi() + (quadrant * 16);
223 }
224
225 return globalPhi;
226
227 }
228
229
230 unsigned int jFexFwdElRoI_v1::getEtEMiso() const{
231 // to be implemented
232 return 0;
233 }
234
235 unsigned int jFexFwdElRoI_v1::getEtEM() const{
236 // to be implemented
237 return 0;
238 }
239
240 unsigned int jFexFwdElRoI_v1::getEtHad1() const{
241 // to be implemented
242 return 0;
243 }
244
245 unsigned int jFexFwdElRoI_v1::getEtHad2() const{
246 // to be implemented
247 return 0;
248 }
249
250
251
252
253
254
255} // namespace xAOD
256
Scalar eta() const
pseudorapidity method
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
uint16_t tobEt(const T *tob)
unsigned int uint
AuxElement()
Default constructor.
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
void setGlobalPhi(uint value)
static const int s_etMask
unsigned int getEtEM() const
void setGlobalEta(int value)
void setResolution(int value)
void setTobEt(uint16_t value)
void setjFexNumber(uint8_t jFexNumber)
unsigned int getEtHad1() const
static const int s_satMask
uint32_t tobWord() const
The "raw" 32-bit word describing the object candidate, 27 bit-word used at hardware level.
static const int s_emf2Mask
unsigned int unpackEtaIndex() const
Eta coordinates.
static const int s_satBit
void setTobLocalPhi(uint8_t value)
static const int s_emf1Bit
static const int s_isoMask
int globalEta() const
Calculated from Tob.
uint8_t tobLocalPhi() const
void setTobLocalEta(uint8_t value)
static const std::vector< int > s_FCAL_EtaPosition
void setEtHad2(uint16_t value)
unsigned int unpackEMf2TOB() const
static const std::vector< int > s_FWD_EtaPosition
void setEtEMiso(uint16_t value)
void setEtHad1(uint16_t value)
void setIsTOB(char value)
Set the isTOB variable (TOB or xTOB)
unsigned int et() const
Methods that require combining results or applying scales.
unsigned int getEtEMiso() const
jFexFwdElRoI_v1()
Default constructor.
unsigned int unpackPhiIndex() const
Phi coordinates.
static const int s_isoBit
int menuEta() const
the eta index to use for looking up thresholds in the menu
uint globalPhi() const
unsigned int unpackEMIsoTOB() const
TOB Isolation bits (decoded from TOB, stored for convenience)
void setTobEMIso(uint8_t value)
void setfpgaNumber(uint8_t fpgaNumber)
void setEta(float value)
static const int s_etaBit
unsigned int unpackEMf1TOB() const
TOB EM fraction bits (decoded from TOB, stored for convenience)
int tobEtScale() const
unsigned int getEtHad2() const
static const int s_phiMask
void setPhi(float value)
void setTobEMf1(uint8_t value)
void setTobSat(uint8_t value)
uint16_t tobEt() const
Decoded from Tob (for convenience)
unsigned int unpackEtTOB() const
TOB ET (decoded from TOB, stored for convenience)
static const int s_emf2Bit
void setEtEM(uint16_t value)
unsigned int unpackSaturationIndex() const
uint8_t fpgaNumber() const
static const int s_phiBit
void initialize(uint8_t jFexNumber, uint8_t fpgaNumber, uint32_t tobWord, char istob, int resolution, float_t eta, float_t phi)
initialze the EDM
static const int s_emf1Mask
int getGlobalEta() const
could add iso, emf1 and emf2 calculated from EtEMiso, EtEM, ETHad1 and EtHad2
void setTobWord(uint32_t tobWord)
Set the "raw" words describing the object candidate, need 27/32 bits.
static const int s_etaMask
void setTobEMf2(uint8_t value)
uint8_t tobLocalEta() const
uint8_t jFexNumber() const
Additional info (initialization)
static const int s_etBit
Forward declaration.
Definition index.py:1
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setWord1 uint16_t
setEventNumber uint32_t