ATLAS Offline Software
jFexLRJetRoI_v1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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  // globalEta/Phi calculation in the FCAL varies depending on position in eta space due to TT granularity change.
19  //| Region | eta region | TT (eta x phi)
20  //---------------------------------------------------------
21  // Region 1 EMB | |eta| < 25 | (1 x 1)
22  // Region 2 EMIE | 25 < |eta| < 31 | (2 x 2)
23  // Region 3 TRANS | 31 < |eta| < 32 | (1 x 2)
24  // Region 4 FCAL | |eta| > 32 | (2 x 4)
25 
26  //eta position in FCAL FPGAs
27  const std::vector<int> jFexLRJetRoI_v1::s_FWD_EtaPosition = {0, 8, //Region 1
28  9, 11, //Region 2
29  12, //Region 3
30  13, 23}; //Region 4
31 
32  //eta position of FCAL EM layer as an integer
33  //Needs to be modified with firmware values
34  const std::vector<int> jFexLRJetRoI_v1::s_FCAL_EtaPosition = {32,34,35,37,38,40,41,43,44,46,47,49};
35 
36 
38  : SG::AuxElement() {
39  }
40  void jFexLRJetRoI_v1::initialize(uint8_t jFexNumber, uint8_t fpgaNumber, uint32_t tobWord, char istob, int resolution, float_t eta, float_t phi ) {
41 
51  setEta( eta );
52  setPhi( phi );
54  setIsTOB(istob);
55 
56  return;
57  }
58 
60  // adapted from TSU::toTopoInteger
61  static const unsigned int RESOLUTION = 40;
62  float tmp = eta()*RESOLUTION;
63  int index;
64  if ( (abs(tmp)-0.5)/2. == std::round((abs(tmp)-0.5)/2.) ) {
65  if ( tmp>0 ) { index = std::floor(tmp); }
66  else { index = std::ceil(tmp); }
67  } else {
68  index = std::round(tmp);
69  }
70  return index/4;
71  }
72 
73  //----------------
75  //----------------
76 
78  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexLRJetRoI_v1, uint8_t , jFexNumber , setjFexNumber )
79  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexLRJetRoI_v1, uint8_t , fpgaNumber , setfpgaNumber )
80 
81 
82  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexLRJetRoI_v1, char, isTOB, setIsTOB )
83 
84 
86  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexLRJetRoI_v1, uint8_t , tobLocalEta , setTobLocalEta )
87  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexLRJetRoI_v1, uint8_t , tobLocalPhi , setTobLocalPhi )
89 
90  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexLRJetRoI_v1, int , globalEta, setGlobalEta )
92 
93 
96 
97 
99 
100  //-----------------
101  //
102  //Methods to decode data from the TOB/RoI and return to the user
103  //-----------------
104 
105  //include in future when xTOB in jFEX has been implemented.
106 
107 
108  //jFexLRJetRoI_v1::ObjectType jFexLRJetRoI_v1::type() const {
109  //if (Word1() == 0) return TOB;
110  //else return xTOB;
111  //}
112 
113  //Hardware coordinate elements
114 
115  //Raw ET on TOB scale (200 MeV/count)
116  unsigned int jFexLRJetRoI_v1::unpackEtTOB() const{
117  //Data content = TOB
118  return (tobWord() >> s_etBit) & s_etMask;
119 
120  }
121 
122  //Return an eta index
123  unsigned int jFexLRJetRoI::unpackEtaIndex() const {
124  return (tobWord() >> s_etaBit) & s_etaMask;
125  }
126  //Return a phi index
127  unsigned int jFexLRJetRoI::unpackPhiIndex() const {
128  return (tobWord() >> s_phiBit) & s_phiMask;
129  }
130 
131  //Return sat flag
133  return (tobWord() >> s_satBit) & s_satMask;
134  }
135 
137 
139  unsigned int jFexLRJetRoI_v1::et() const {
140  //Return the TOB Et in a 1 MeV scale
141  return tobEt()*tobEtScale();
142  }
143 
144  // Global coords
145  // It has been decided that jFEX Large-R jets are going up to 2.5 so like jFEX Taus
147 
148  int globalEta = 0;
149  if(jFexNumber()<3){
150  globalEta= 8*(jFexNumber()-2) - (tobLocalEta()+1);
151  }
152  else if(jFexNumber()<6){
153  globalEta= 8*(jFexNumber()-3) + (tobLocalEta());
154  }
155  return globalEta;
156  }
157 
158  // In the region of |eta|<2.5 there is not different granularity
160  const unsigned int quadrant = ::getQuadrant(fpgaNumber());
161 
162  uint globalPhi = tobLocalPhi() + (quadrant * 16);
163  return globalPhi;
164  }
165 
166 
167 } // namespace xAOD
168 
169 
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::jFexLRJetRoI_v1::s_satMask
static const int s_satMask
Definition: jFexLRJetRoI_v1.h:103
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::jFexLRJetRoI_v1::setTobSat
void setTobSat(uint8_t value)
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
jFexLRJetRoI.h
xAOD::jFexLRJetRoI_v1::eta
float eta() const
xAOD::jFexLRJetRoI_v1::setTobWord
void setTobWord(uint32_t tobWord)
Set the "raw" 32-bit words describing the object candidate.
AuxStoreAccessorMacros.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
index
Definition: index.py:1
xAOD::jFexLRJetRoI_v1::unpackSaturationIndex
unsigned int unpackSaturationIndex() const
Definition: jFexLRJetRoI_v1.cxx:132
xAOD::jFexLRJetRoI_v1::setTobLocalPhi
void setTobLocalPhi(uint8_t value)
xAOD::jFexLRJetRoI_v1::s_etaMask
static const int s_etaMask
Definition: jFexLRJetRoI_v1.h:99
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
xAOD::jFexLRJetRoI_v1::jFexNumber
uint8_t jFexNumber() const
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::jFexLRJetRoI_v1::unpackEtaIndex
unsigned int unpackEtaIndex() const
Eta coordinates.
Definition: jFexLRJetRoI_v1.cxx:123
xAOD::jFexLRJetRoI_v1::et
unsigned int et() const
Methods that require combining results or applying scales.
Definition: jFexLRJetRoI_v1.cxx:139
xAOD::jFexLRJetRoI_v1::s_FCAL_EtaPosition
static const std::vector< int > s_FCAL_EtaPosition
Definition: jFexLRJetRoI_v1.h:88
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
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
xAOD::jFexLRJetRoI_v1::s_phiMask
static const int s_phiMask
Definition: jFexLRJetRoI_v1.h:100
xAOD::jFexLRJetRoI_v1::setEta
void setEta(float value)
xAOD::jFexLRJetRoI_v1::setResolution
void setResolution(int value)
xAOD::jFexLRJetRoI_v1::setjFexNumber
void setjFexNumber(uint8_t jFexNumber)
xAOD::jFexLRJetRoI_v1::setTobLocalEta
void setTobLocalEta(uint8_t value)
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
SG::IAuxElement::index
size_t index() const
Return the index of this element within its container.
xAOD::jFexLRJetRoI_v1::s_FWD_EtaPosition
static const std::vector< int > s_FWD_EtaPosition
Definition: jFexLRJetRoI_v1.h:89
xAOD::jFexLRJetRoI_v1::s_satBit
static const int s_satBit
Definition: jFexLRJetRoI_v1.h:96
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
xAOD::jFexLRJetRoI_v1::jFexLRJetRoI_v1
jFexLRJetRoI_v1()
Default constructor.
Definition: jFexLRJetRoI_v1.cxx:37
xAOD::jFexLRJetRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexLRJetRoI_v1.h:22
xAOD::jFexLRJetRoI_v1::tobWord
uint32_t tobWord() const
The "raw" 32-bit word describing the object candidate.
xAOD::jFexLRJetRoI_v1::initialize
void initialize(uint8_t jFexNumber, uint8_t fpgaNumber, uint32_t tobWord, char istob, int resolution, float_t eta, float_t phi)
In future initialze the EDM.
Definition: jFexLRJetRoI_v1.cxx:40
xAOD::jFexLRJetRoI_v1::setfpgaNumber
void setfpgaNumber(uint8_t fpgaNumber)
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
xAOD::jFexLRJetRoI_v1::setPhi
void setPhi(float value)
xAOD::jFexLRJetRoI_v1::globalEta
int globalEta() const
xAOD::jFexLRJetRoI_v1::tobEt
uint16_t tobEt() const
xAOD::jFexLRJetRoI_v1::globalPhi
uint globalPhi() const
xAOD::jFexLRJetRoI_v1::tobLocalEta
uint8_t tobLocalEta() const
xAOD::jFexLRJetRoI_v1::tobEtScale
int tobEtScale() const
xAOD::jFexLRJetRoI_v1::s_etaBit
static const int s_etaBit
Definition: jFexLRJetRoI_v1.h:94
xAOD::jFexLRJetRoI_v1::tobLocalPhi
uint8_t tobLocalPhi() const
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
TRT::Hit::globalPhi
@ globalPhi
Definition: HitInfo.h:38
xAOD::jFexLRJetRoI_v1::unpackGlobalEta
int unpackGlobalEta() const
Definition: jFexLRJetRoI_v1.cxx:146
xAOD::jFexLRJetRoI_v1::unpackEtTOB
unsigned int unpackEtTOB() const
TOB ET (decoded from TOB, stored for convenience)
Definition: jFexLRJetRoI_v1.cxx:116
xAOD::jFexLRJetRoI_v1::setGlobalPhi
void setGlobalPhi(uint value)
xAOD::jFexLRJetRoI_v1::phi
float phi() const
xAOD::jFexLRJetRoI_v1::unpackGlobalPhi
uint unpackGlobalPhi() const
Definition: jFexLRJetRoI_v1.cxx:159
xAOD::jFexLRJetRoI_v1::setIsTOB
void setIsTOB(char value)
Set the isTOB variable (TOB or xTOB)
xAOD::tobEtScale
tobEtScale
Definition: gFexJetRoI_v1.cxx:61
xAOD::jFexLRJetRoI_v1::setGlobalEta
void setGlobalEta(int value)
xAOD::jFexLRJetRoI_v1::setTobEt
void setTobEt(uint16_t value)
xAOD::jFexLRJetRoI_v1::menuEta
int menuEta() const
the eta index to use for looking up thresholds in the menu
Definition: jFexLRJetRoI_v1.cxx:59
getQuadrant.h
xAOD::jFexLRJetRoI_v1::s_phiBit
static const int s_phiBit
Definition: jFexLRJetRoI_v1.h:95
xAOD::jFexLRJetRoI_v1::fpgaNumber
uint8_t fpgaNumber() const
xAOD::jFexLRJetRoI_v1::unpackPhiIndex
unsigned int unpackPhiIndex() const
Phi coordinates.
Definition: jFexLRJetRoI_v1.cxx:127