ATLAS Offline Software
Loading...
Searching...
No Matches
jFEXForwardElecInfo.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4//***************************************************************************
5// jFEXForwardElecInfo -
6// -------------------
7// begin : 12 05 2022
8// email : ulla.blumenschein@cern.ch
9//***************************************************************************
10
11#include <vector>
14
15
16void LVL1::jFEXForwardElecInfo::setup(int jfex, uint ttid, int neta, int nphi){
17 m_jfex = jfex;
18 m_coreTTID = ttid;
19 m_ieta = neta;
20 m_iphi = nphi;
21}
22
23
25 m_reso = reso;
26 for(int i=0;i<9;i++) m_cval[i] = cval[i];
27}
28
29
33
37
41
45
46
50
54
58
62
66
70
74
78
82
86
88 m_nextTTEtEM = nextEt;
89}
90
94
98
102
104 m_TTEtEMiso = iso_ET;
105}
106
108 m_TTEtEMiso += iso_ET;
109}
110
114
119
123
127
129 m_TTEtHad1 = ET_HAD;
130}
131
133 m_TTEtHad1 += ET_HAD;
134}
135
139
141 m_TTEtHad2 = ET_HAD;
142}
143
147
151
155
159
163
167
171
173 return m_tob;
174}
175
179
181 return m_TTsInSearchWindow;
182}
183
184
185
186// Calculating Top quantities
187
189 m_res = 0;
190 m_sat = 0;
191 m_emiso = 0;
192 m_emfr1 = 0;
193 m_emfr2 = 0;
194 m_eta = 0;
195 m_phi = 0;
196 m_et = 0;
197 m_tob = 0;
198 m_EtEMiso = 0;
199 m_EtHad1 = 0;
200 m_EtHad2 = 0;
201 m_EtEM = 0;
202
203 if(m_jfex == 5) {
204 m_eta = m_ieta -8;
205 if(m_ieta < FEXAlgoSpaceDefs::jFEX_algoSpace_A_EMIE_eta) { // ieta lower than EMIE stats -> belong to EMB
206 m_phi = m_iphi-8;
207 }
208 else if(m_ieta < FEXAlgoSpaceDefs::jFEX_algoSpace_A_FCAL_start_eta) { // ieta lower than FCAL stats -> belong to EMIE
209 m_phi = m_iphi -4;
210 }
211 else { // rest ieta belongs to FCAL
212 m_phi = m_iphi -2;
213 }
214 }
215 else if(m_jfex == 0) {
216 m_eta = 36 - m_ieta;
217
218 if(m_ieta < FEXAlgoSpaceDefs::jFEX_algoSpace_C_FCAL_end_eta) { // ieta lower than FCal ends -> FCAL
219 m_phi = m_iphi -2 ;
220 }
221 else if(m_ieta < FEXAlgoSpaceDefs::jFEX_algoSpace_C_EMIE_end_eta) {// ieta lower than EMIE ends -> EMIE
222 m_phi = m_iphi -4 ;
223 }
224 else {// rest of ieta -> EMB
225 m_phi = m_iphi -8 ;
226 }
227 }
228
230
231 if(m_reso > 0){
237 }
238
239 if (m_et > 0x7ff) { //0x7ff is 11 bits
240 m_et = 0x7ff;
241 //current FW convention is to NOT set the saturation bit on value overflow, but only to propagate cell saturation information from LAr
242 //m_sat=1;
243 }
245
246
247 // jFEX internal values are at higher granularity (25MeV), not output granularity (200MeV).
248 // since we avoid divisions, MeV values are just as good (given that input granularity is already 25MeV)
249 if (m_TTClusEtEM > m_cval[2] * m_TTEtEMiso) {
250 m_emiso = 3;
251 } else if (m_TTClusEtEM > m_cval[1] * m_TTEtEMiso){
252 m_emiso = 2;
253 } else if (m_TTClusEtEM > m_cval[0] * m_TTEtEMiso){
254 m_emiso = 1;
255 }
256
257 // hadronic fraction: only compare to core (=seed) tower
258 if (m_coreTTEtEM > m_cval[5] * m_TTEtHad1) {
259 m_emfr1 = 3;
260 } else if (m_coreTTEtEM > m_cval[4] * m_TTEtHad1){
261 m_emfr1 = 2;
262 } else if (m_coreTTEtEM > m_cval[3] * m_TTEtHad1){
263 m_emfr1 = 1;
264 }
265 if (m_coreTTEtEM > m_cval[8] * m_TTEtHad2) {
266 m_emfr2 = 3;
267 } else if (m_coreTTEtEM > m_cval[7] * m_TTEtHad2){
268 m_emfr2 = 2;
269 } else if (m_coreTTEtEM > m_cval[6] * m_TTEtHad2){
270 m_emfr2 = 1;
271 }
272
274}
275
276
277
278std::unique_ptr<LVL1::jFEXForwardElecTOB> LVL1::jFEXForwardElecInfo::getFwdElTOBs(){
279
280 std::unique_ptr<LVL1::jFEXForwardElecTOB> tob = std::make_unique<LVL1::jFEXForwardElecTOB>();
281
282 calcFwdElEDM();
283
284 tob->setET(m_et);
285 tob->setPhi(m_phi);
286 tob->setEta(m_eta);
287 tob->setIso(m_emiso);
288 tob->setEMf1(m_emfr1);
289 tob->setEMf2(m_emfr2);
290 tob->setSat(m_sat);
291 return tob;
292}
unsigned int uint
static constexpr int jEM_phiBit
static constexpr int jEM_emf1Bit
static constexpr int jFEX_algoSpace_C_FCAL_end_eta
static constexpr int jEM_etBit
static constexpr int jFEX_algoSpace_A_FCAL_start_eta
static constexpr int jFEX_algoSpace_A_EMIE_eta
static constexpr int jEM_emf2Bit
static constexpr int jEM_resBit
static constexpr int jEM_isoBit
static constexpr int jEM_etaBit
static constexpr int jFEX_algoSpace_C_EMIE_end_eta
std::unique_ptr< jFEXForwardElecTOB > getFwdElTOBs()
Calculate top word.
std::vector< uint > m_TTsInSearchWindow
void calcFwdElEDM()
Calculate variables for top word.
const std::vector< uint > & getTTinSearchWindow()
void setup(int jfex, uint ttid, int neta, int nphi)