Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
16 namespace 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 
28  : SG::AuxElement() {
29  }
30  void jFexFwdElRoI_v1::initialize(uint8_t jFexNumber, uint8_t fpgaNumber, uint32_t tobWord, char istob, int resolution, float_t eta, float_t phi ) {
31 
44  setEta( eta );
45  setPhi( phi );
47  setIsTOB(istob);
49  setEtEM(getEtEM());
52 
53  return;
54  }
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)
115  unsigned int jFexFwdElRoI_v1::unpackEtTOB() const{
116  return (tobWord() >> s_etBit) & s_etMask;
117  }
118 
119  //Return the isolation bit
120  unsigned int jFexFwdElRoI_v1::unpackEMIsoTOB() const{
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 
xAOD::jFexFwdElRoI_v1::unpackEtaIndex
unsigned int unpackEtaIndex() const
Eta coordinates.
Definition: jFexFwdElRoI_v1.cxx:135
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
xAOD::jFexFwdElRoI_v1::unpackEMf2TOB
unsigned int unpackEMf2TOB() const
Definition: jFexFwdElRoI_v1.cxx:130
xAOD::jFexFwdElRoI_v1::setjFexNumber
void setjFexNumber(uint8_t jFexNumber)
xAOD::jFexFwdElRoI_v1::setGlobalPhi
void setGlobalPhi(uint value)
xAOD::jFexFwdElRoI_v1::tobLocalEta
uint8_t tobLocalEta() const
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::jFexFwdElRoI_v1::unpackEMf1TOB
unsigned int unpackEMf1TOB() const
TOB EM fraction bits (decoded from TOB, stored for convenience)
Definition: jFexFwdElRoI_v1.cxx:125
AuxStoreAccessorMacros.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
index
Definition: index.py:1
xAOD::jFexFwdElRoI_v1::eta
float eta() const
xAOD::jFexFwdElRoI_v1::getGlobalPhi
uint getGlobalPhi() const
Definition: jFexFwdElRoI_v1.cxx:203
xAOD::jFexFwdElRoI_v1::setEtEMiso
void setEtEMiso(uint16_t value)
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
xAOD::jFexFwdElRoI_v1::getGlobalEta
int getGlobalEta() const
could add iso, emf1 and emf2 calculated from EtEMiso, EtEM, ETHad1 and EtHad2
Definition: jFexFwdElRoI_v1.cxx:160
xAOD::jFexFwdElRoI_v1::jFexNumber
uint8_t jFexNumber() const
Additional info (initialization)
xAOD::jFexFwdElRoI_v1::phi
float phi() const
xAOD::jFexFwdElRoI_v1::globalEta
int globalEta() const
Calculated from Tob.
xAOD::jFexFwdElRoI_v1::s_etaMask
static const int s_etaMask
Definition: jFexFwdElRoI_v1.h:143
xAOD::jFexFwdElRoI_v1::s_phiMask
static const int s_phiMask
Definition: jFexFwdElRoI_v1.h:144
xAOD::jFexFwdElRoI_v1::jFexFwdElRoI_v1
jFexFwdElRoI_v1()
Default constructor.
Definition: jFexFwdElRoI_v1.cxx:27
xAOD::jFexFwdElRoI_v1::tobLocalPhi
uint8_t tobLocalPhi() const
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::jFexFwdElRoI_v1::s_FWD_EtaPosition
static const std::vector< int > s_FWD_EtaPosition
Definition: jFexFwdElRoI_v1.h:124
xAOD::jFexFwdElRoI_v1::setEtHad1
void setEtHad1(uint16_t value)
xAOD::jFexFwdElRoI_v1::tobEtScale
int tobEtScale() const
xAOD::jFexFwdElRoI_v1::s_satBit
static const int s_satBit
Definition: jFexFwdElRoI_v1.h:135
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
tobEt
uint16_t tobEt(const T *tob)
Definition: JfexSimMonitorAlgorithm.cxx:102
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
Amg::setPhi
Amg::RotationMatrix3D setPhi(Amg::RotationMatrix3D mat, double angle, int convention=0)
Definition: EulerAnglesHelpers.h:102
jFexFwdElRoI.h
xAOD::jFexFwdElRoI_v1::unpackSaturationIndex
unsigned int unpackSaturationIndex() const
Definition: jFexFwdElRoI_v1.cxx:144
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
xAOD::jFexFwdElRoI_v1::s_satMask
static const int s_satMask
Definition: jFexFwdElRoI_v1.h:145
SG::IAuxElement::index
size_t index() const
Return the index of this element within its container.
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
xAOD::jFexFwdElRoI_v1::globalPhi
uint globalPhi() const
xAOD::jFexFwdElRoI_v1::setTobEMf1
void setTobEMf1(uint8_t value)
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
xAOD::jFexFwdElRoI_v1::s_FCAL_EtaPosition
static const std::vector< int > s_FCAL_EtaPosition
Definition: jFexFwdElRoI_v1.h:125
xAOD::jFexFwdElRoI_v1::s_isoMask
static const int s_isoMask
Definition: jFexFwdElRoI_v1.h:141
xAOD::jFexFwdElRoI_v1::setTobWord
void setTobWord(uint32_t tobWord)
Set the "raw" words describing the object candidate, need 27/32 bits.
xAOD::jFexFwdElRoI_v1::unpackEtTOB
unsigned int unpackEtTOB() const
TOB ET (decoded from TOB, stored for convenience)
Definition: jFexFwdElRoI_v1.cxx:115
xAOD::jFexFwdElRoI_v1::setTobSat
void setTobSat(uint8_t value)
xAOD::jFexFwdElRoI_v1::setIsTOB
void setIsTOB(char value)
Set the isTOB variable (TOB or xTOB)
xAOD::jFexFwdElRoI_v1::getEtHad1
unsigned int getEtHad1() const
Definition: jFexFwdElRoI_v1.cxx:240
xAOD::jFexFwdElRoI_v1::setTobEMIso
void setTobEMIso(uint8_t value)
xAOD::jFexFwdElRoI_v1::getEtHad2
unsigned int getEtHad2() const
Definition: jFexFwdElRoI_v1.cxx:245
xAOD::jFexFwdElRoI_v1::s_emf2Mask
static const int s_emf2Mask
Definition: jFexFwdElRoI_v1.h:139
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
TRT::Hit::globalPhi
@ globalPhi
Definition: HitInfo.h:38
xAOD::jFexFwdElRoI_v1::setResolution
void setResolution(int value)
xAOD::jFexFwdElRoI_v1::setGlobalEta
void setGlobalEta(int value)
xAOD::jFexFwdElRoI_v1::s_emf1Bit
static const int s_emf1Bit
Definition: jFexFwdElRoI_v1.h:130
xAOD::jFexFwdElRoI_v1::setfpgaNumber
void setfpgaNumber(uint8_t fpgaNumber)
xAOD::jFexFwdElRoI_v1::s_etaBit
static const int s_etaBit
Definition: jFexFwdElRoI_v1.h:133
xAOD::jFexFwdElRoI_v1::setTobLocalEta
void setTobLocalEta(uint8_t value)
xAOD::jFexFwdElRoI_v1::getEtEM
unsigned int getEtEM() const
Definition: jFexFwdElRoI_v1.cxx:235
xAOD::jFexFwdElRoI_v1::tobEt
uint16_t tobEt() const
Decoded from Tob (for convenience)
xAOD::jFexFwdElRoI_v1::s_emf2Bit
static const int s_emf2Bit
Definition: jFexFwdElRoI_v1.h:129
xAOD::jFexFwdElRoI_v1::setPhi
void setPhi(float value)
xAOD::jFexFwdElRoI_v1::unpackPhiIndex
unsigned int unpackPhiIndex() const
Phi coordinates.
Definition: jFexFwdElRoI_v1.cxx:139
xAOD::jFexFwdElRoI_v1::initialize
void initialize(uint8_t jFexNumber, uint8_t fpgaNumber, uint32_t tobWord, char istob, int resolution, float_t eta, float_t phi)
initialze the EDM
Definition: jFexFwdElRoI_v1.cxx:30
xAOD::jFexFwdElRoI_v1::s_isoBit
static const int s_isoBit
Definition: jFexFwdElRoI_v1.h:131
xAOD::jFexFwdElRoI_v1::setEtHad2
void setEtHad2(uint16_t value)
xAOD::jFexFwdElRoI_v1::s_phiBit
static const int s_phiBit
Definition: jFexFwdElRoI_v1.h:134
xAOD::jFexFwdElRoI_v1::et
unsigned int et() const
Methods that require combining results or applying scales.
Definition: jFexFwdElRoI_v1.cxx:151
xAOD::jFexFwdElRoI_v1::setTobEt
void setTobEt(uint16_t value)
xAOD::jFexFwdElRoI_v1::getEtEMiso
unsigned int getEtEMiso() const
Definition: jFexFwdElRoI_v1.cxx:230
xAOD::jFexFwdElRoI_v1::setTobLocalPhi
void setTobLocalPhi(uint8_t value)
xAOD::jFexFwdElRoI_v1::s_emf1Mask
static const int s_emf1Mask
Definition: jFexFwdElRoI_v1.h:140
xAOD::jFexFwdElRoI_v1::unpackEMIsoTOB
unsigned int unpackEMIsoTOB() const
TOB Isolation bits (decoded from TOB, stored for convenience)
Definition: jFexFwdElRoI_v1.cxx:120
xAOD::tobEtScale
tobEtScale
Definition: gFexJetRoI_v1.cxx:64
xAOD::jFexFwdElRoI_v1::setEta
void setEta(float value)
xAOD::jFexFwdElRoI_v1::tobWord
uint32_t tobWord() const
The "raw" 32-bit word describing the object candidate, 27 bit-word used at hardware level.
xAOD::jFexFwdElRoI_v1::menuEta
int menuEta() const
the eta index to use for looking up thresholds in the menu
Definition: jFexFwdElRoI_v1.cxx:56
xAOD::jFexFwdElRoI_v1::setTobEMf2
void setTobEMf2(uint8_t value)
xAOD::jFexFwdElRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexFwdElRoI_v1.h:23
getQuadrant.h
xAOD::jFexFwdElRoI_v1::setEtEM
void setEtEM(uint16_t value)
xAOD::jFexFwdElRoI_v1::fpgaNumber
uint8_t fpgaNumber() const