ATLAS Offline Software
Loading...
Searching...
No Matches
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
16namespace 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
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
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)
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
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 setEta(float value)
void setTobLocalEta(uint8_t value)
static const int s_etaMask
unsigned int et() const
Methods that require combining results or applying scales.
void setIsTOB(char value)
Set the isTOB variable (TOB or xTOB)
static const int s_phiBit
void setfpgaNumber(uint8_t fpgaNumber)
void setGlobalPhi(uint value)
void setTobWord(uint32_t tobWord)
Set the "raw" 32-bit words describing the object candidate.
uint8_t fpgaNumber() const
static const int s_satBit
unsigned int unpackPhiIndex() const
Phi coordinates.
uint16_t tobEt() const
static const std::vector< int > s_FWD_EtaPosition
void setResolution(int value)
void setTobEt(uint16_t value)
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.
static const int s_phiMask
void setTobSat(uint8_t value)
jFexLRJetRoI_v1()
Default constructor.
int menuEta() const
the eta index to use for looking up thresholds in the menu
unsigned int unpackEtTOB() const
TOB ET (decoded from TOB, stored for convenience)
uint8_t tobLocalPhi() const
static const int s_etBit
int tobEtScale() const
unsigned int unpackSaturationIndex() const
void setGlobalEta(int value)
uint globalPhi() const
static const int s_etMask
uint8_t jFexNumber() const
static const std::vector< int > s_FCAL_EtaPosition
void setjFexNumber(uint8_t jFexNumber)
uint8_t tobLocalEta() const
void setTobLocalPhi(uint8_t value)
static const int s_satMask
void setPhi(float value)
static const int s_etaBit
unsigned int unpackEtaIndex() const
Eta coordinates.
uint32_t tobWord() const
The "raw" 32-bit word describing the object candidate.
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