57 {
58
59
60 SG::WriteHandle<xAOD::gFexTowerContainer> gTowersContainer(
m_gTowersWriteKey, ctx);
61 ATH_CHECK(gTowersContainer.record(std::make_unique<xAOD::gFexTowerContainer>(), std::make_unique<xAOD::gFexTowerAuxContainer>()));
62 ATH_MSG_DEBUG(
"Recorded gFexTriggerTower container with key " << gTowersContainer.key());
63
67
71
75
76
77
79 memset(&tmp_gTowersIDs_subset_centralFPGA, 0, sizeof tmp_gTowersIDs_subset_centralFPGA);
81 for (int mycol = 0; mycol<12; mycol++){
82 tmp_gTowersIDs_subset_centralFPGA[myrow][mycol] = tmp_gTowersIDs_subset[myrow][mycol+8];
83 }
84 }
85
86 m_gFEXFPGA_Tool->FillgTowerEDMCentral(ctx, gTowersContainer, 0, tmp_gTowersIDs_subset_centralFPGA, Atwr, Atwr50, Asat);
87
88
90 memset(&tmp_gTowersIDs_subset_centralFPGA_B, 0, sizeof tmp_gTowersIDs_subset_centralFPGA_B);
92 for (int mycol = 0; mycol<12; mycol++){
93 tmp_gTowersIDs_subset_centralFPGA_B[myrow][mycol] = tmp_gTowersIDs_subset[myrow][mycol+20];
94 }
95 }
96
97 m_gFEXFPGA_Tool->FillgTowerEDMCentral(ctx, gTowersContainer, 1, tmp_gTowersIDs_subset_centralFPGA_B, Btwr, Btwr50, Bsat);
98
99
100
101
102
103
104
106 memset(&tmp_gTowersIDs_subset_forwardFPGA_N, 0, sizeof tmp_gTowersIDs_subset_forwardFPGA_N);
108 for (int mycol = 0; mycol<4; mycol++){
109 tmp_gTowersIDs_subset_forwardFPGA_N[myrow][mycol] = tmp_gTowersIDs_subset[myrow][mycol];
110 }
111 }
113 for (int mycol = 4; mycol<8; mycol++){
114 tmp_gTowersIDs_subset_forwardFPGA_N[myrow][mycol] = tmp_gTowersIDs_subset[myrow][mycol];
115 }
116 }
117
118
119
120
121
123 memset(&tmp_gTowersIDs_subset_forwardFPGA_P, 0, sizeof tmp_gTowersIDs_subset_forwardFPGA_P);
125 for (int mycol = 0; mycol<4; mycol++){
126 tmp_gTowersIDs_subset_forwardFPGA_P[myrow][mycol] = tmp_gTowersIDs_subset[myrow][mycol+32];
127 }
128 }
130 for (int mycol = 4; mycol<8; mycol++){
131 tmp_gTowersIDs_subset_forwardFPGA_P[myrow][mycol] = tmp_gTowersIDs_subset[myrow][mycol+32];
132 }
133 }
134
135 m_gFEXFPGA_Tool->FillgTowerEDMForward(ctx, gTowersContainer, 2, tmp_gTowersIDs_subset_forwardFPGA_N, tmp_gTowersIDs_subset_forwardFPGA_P, Ctwr, Ctwr50, Csat);
136
137
138
139 SG::ReadHandle<TrigConf::L1Menu> l1Menu (
m_l1MenuKey, ctx);
141
142
143 auto & thr_gLJ = l1Menu->thrExtraInfo().gLJ();
144 int gLJ_seedThrA = thr_gLJ.seedThrCounts('A');
145 int gLJ_seedThrB = thr_gLJ.seedThrCounts('B');
146 int gLJ_seedThrC = thr_gLJ.seedThrCounts('C');
147
148 int gLJ_ptMinToTopoCounts1 = thr_gLJ.ptMinToTopoCounts(1);
149 int gLJ_ptMinToTopoCounts2 = thr_gLJ.ptMinToTopoCounts(2);
150
151 float gLJ_rhoMaxA = (thr_gLJ.rhoTowerMax('A')*1000)/50;
152 float gLJ_rhoMaxB = (thr_gLJ.rhoTowerMax('B')*1000)/50;
153 float gLJ_rhoMaxC = (thr_gLJ.rhoTowerMax('C')*1000)/50;
154
155
156
157 auto & thr_gJ = l1Menu->thrExtraInfo().gJ();
158 int gJ_ptMinToTopoCounts1 = thr_gJ.ptMinToTopoCounts(1);
159 int gJ_ptMinToTopoCounts2 = thr_gJ.ptMinToTopoCounts(2);
160
161
162 int pucA = 0;
163 int pucB = 0;
164 int pucC = 0;
165 int pucA_JWJ = 0;
166 int pucB_JWJ = 0;
167 int pucC_JWJ = 0;
168
170
175 }
176
177
178
179
180 std::array<uint32_t, 7> ATOB1_dat = {0};
181 std::array<uint32_t, 7> ATOB2_dat = {0};
182 std::array<uint32_t, 7> BTOB1_dat = {0};
183 std::array<uint32_t, 7> BTOB2_dat = {0};
184 std::array<uint32_t, 7> CTOB1_dat = {0};
185 std::array<uint32_t, 7> CTOB2_dat = {0};
186
187
188
189 auto tobs_v =
m_gFEXJetAlgoTool->largeRfinder(Atwr, Btwr, Ctwr, Asat, Bsat, Csat, pucA, pucB, pucC,
190 gLJ_seedThrA, gLJ_seedThrB, gLJ_seedThrC, gJ_ptMinToTopoCounts1, gJ_ptMinToTopoCounts2,
191 jetThreshold, gLJ_ptMinToTopoCounts1, gLJ_ptMinToTopoCounts2,
192 ATOB1_dat, ATOB2_dat,
193 BTOB1_dat, BTOB2_dat,
194 CTOB1_dat, CTOB2_dat);
195
196 gRhoTobWords.resize(3);
197 gBlockTobWords.resize(12);
198 gJetTobWords.resize(6);
199
200 gRhoTobWords[0] = ATOB2_dat[0];
201 gRhoTobWords[1] = BTOB2_dat[0];
202 gRhoTobWords[2] = CTOB2_dat[0];
203
204
205 gBlockTobWords[0] = ATOB1_dat[1];
206 gBlockTobWords[1] = ATOB2_dat[1];
207 gBlockTobWords[2] = BTOB1_dat[1];
208 gBlockTobWords[3] = BTOB2_dat[1];
209
210 gBlockTobWords[4] = ATOB1_dat[2];
211 gBlockTobWords[5] = ATOB2_dat[2];
212 gBlockTobWords[6] = BTOB1_dat[2];
213 gBlockTobWords[7] = BTOB2_dat[2];
214
215 gBlockTobWords[8] = CTOB1_dat[1];
216 gBlockTobWords[9] = CTOB2_dat[1];
217 gBlockTobWords[10] = CTOB1_dat[2];
218 gBlockTobWords[11] = CTOB2_dat[2];
219
220
221 gJetTobWords[0] = ATOB1_dat[3];
222 gJetTobWords[1] = ATOB2_dat[3];
223 gJetTobWords[2] = BTOB1_dat[3];
224 gJetTobWords[3] = BTOB2_dat[3];
225 gJetTobWords[4] = CTOB1_dat[3];
226 gJetTobWords[5] = CTOB2_dat[3];
227
228
229
230 std::array<int32_t, 4> outJwojTOB = {0};
231 std::array<uint32_t, 4> outAltMetTOB = {0};
232
233
234 auto global_tobs =
m_gFEXJwoJAlgoTool->jwojAlgo(ctx, Atwr, pucA_JWJ, Btwr, pucB_JWJ, Ctwr, pucC_JWJ, outJwojTOB);
235
236 gScalarEJwojTobWords.resize(1);
237 gMETComponentsJwojTobWords.resize(1);
238 gMHTComponentsJwojTobWords.resize(1);
239 gMSTComponentsJwojTobWords.resize(1);
240
241
242
243 gScalarEJwojTobWords[0] = outJwojTOB[0];
244 gMETComponentsJwojTobWords[0] = outJwojTOB[1];
245 gMHTComponentsJwojTobWords[0] = outJwojTOB[2];
246 gMSTComponentsJwojTobWords[0] = outJwojTOB[3];
247
248
250
251 gMETComponentsNoiseCutTobWords.resize(1);
252 gMETComponentsRmsTobWords.resize(1);
253 gScalarENoiseCutTobWords.resize(1);
254 gScalarERmsTobWords.resize(1);
255
256
257 gMETComponentsNoiseCutTobWords[0] = outAltMetTOB[0];
258 gMETComponentsRmsTobWords[0] = outAltMetTOB[1];
259 gScalarENoiseCutTobWords[0] = outAltMetTOB[2];
260 gScalarERmsTobWords[0] = outAltMetTOB[3];
261
262 for (
int i = 0;
i <14;
i++){
263 gFEXOutputs->addJetTob(tobs_v[i]->getWord());
264 gFEXOutputs->addValueJet("EtaJet", tobs_v[i]->getEta());
265 gFEXOutputs->addValueJet(
"PhiJet", tobs_v[i]->
getPhi());
266 gFEXOutputs->addValueJet("ETJet", tobs_v[i]->getET());
267 gFEXOutputs->addValueJet("StatusJet", tobs_v[i]->getStatus());
268 gFEXOutputs->addValueJet("TobIDJet", tobs_v[i]->getTobID());
269 gFEXOutputs->fillJet();
270
271 }
272
273 for (
int i = 0;
i <4;
i++){
274 gFEXOutputs->addGlobalTob(global_tobs[i]->getWord());
275 gFEXOutputs->addValueGlobal("GlobalQuantity1", global_tobs[i]->getQuantity1());
276 gFEXOutputs->addValueGlobal("GlobalQuantity2", global_tobs[i]->getQuantity2());
277 gFEXOutputs->addValueGlobal("SaturationGlobal", global_tobs[i]->getSaturation());
278 gFEXOutputs->addValueGlobal("TobIDGlobal", global_tobs[i]->getTobID());
279 gFEXOutputs->addValueGlobal("GlobalStatus1", global_tobs[i]->getStatus1());
280 gFEXOutputs->addValueGlobal("GlobalStatus2", global_tobs[i]->getStatus2());
281 gFEXOutputs->fillGlobal();
282
283 }
284
285 return StatusCode::SUCCESS;
286}
#define ATH_CHECK
Evaluate an expression and check for errors.
static constexpr int centralNphi
static constexpr int jetThr
static constexpr int forwardNphi
static constexpr bool ENABLE_PUC
ToolHandle< IgFEXFPGA > m_gFEXFPGA_Tool
Internal data.
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
ToolHandle< IgFEXJwoJAlgo > m_gFEXJwoJAlgoTool
SG::WriteHandleKey< xAOD::gFexTowerContainer > m_gTowersWriteKey
ToolHandle< IgFEXJetAlgo > m_gFEXJetAlgoTool
ToolHandle< IgFEXaltMetAlgo > m_gFEXaltMetAlgoTool
float getPhi(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of phi.
std::array< std::array< int, 8 >, 32 > gTowersForward
std::array< std::array< int, 12 >, 32 > gTowersCentral
std::array< std::array< int, 12 >, 32 > gTowersType