50 {
51
52
53
54
55
56 std::array<int, FEXAlgoSpaceDefs::gJetTOBfib> gTOBsat = {{0,0,0,0,0,0}};
57 std::array<int, FEXAlgoSpaceDefs::gJetTOBfib> gJetTOBs = {{0,0,0,0,0,0}};
58 std::array<int, FEXAlgoSpaceDefs::gJetTOBfib> gJetTOBv = {{0,0,0,0,0,0}};
59 std::array<int, FEXAlgoSpaceDefs::gJetTOBfib> gJetTOBeta = {{0,0,0,0,0,0}};
60 std::array<int, FEXAlgoSpaceDefs::gJetTOBfib> gJetTOBphi = {{0,0,0,0,0,0}};
61
62
63
64
65 std::array<std::array<int, 3>,
FEXAlgoSpaceDefs::BTOBFIB> gBlockTOBv = {{ {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}} }};
66 std::array<std::array<int, 3>,
FEXAlgoSpaceDefs::BTOBFIB> gBlockTOBeta = {{ {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}} }};
67 std::array<std::array<int, 3>,
FEXAlgoSpaceDefs::BTOBFIB> gBlockTOBphi = {{ {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}} }};
68
69
70
71
74
77 CNtwr[irow][jcolumn] = Ctwr[irow][jcolumn] ;
79 }
80
82
83 if( jcolumn < 6 ) {
84
85 if( Asat[irow][jcolumn] == 1 ) gTOBsat[0] = 1;
86 if( Bsat[irow][jcolumn] == 1 ) gTOBsat[2] = 1;
87 if( Csat[irow][jcolumn] == 1 ) gTOBsat[4] = 1;
88 } else {
89
90 if( Asat[irow][jcolumn] == 1 ) gTOBsat[1] = 1;
91 if( Bsat[irow][jcolumn] == 1 ) gTOBsat[3] = 1;
92 if( Csat[irow][jcolumn] == 1 ) gTOBsat[5] = 1;
93 }
94 }
95 }
96
97
98
101
104
106
109
112
114
117
118
121
125
126
130
131
134
137
138 if (Asat[irow][icolumn] != 0){
139 }
140 }
141 }
142
146
147
151
152
155 AjetsRestricted[irow][icolumn] = AjetsAlt[irow][icolumn];
156 BjetsRestricted[irow][icolumn] = BjetsAlt[irow][icolumn];
157 CjetsRestricted[irow][icolumn] = CjetsAlt[irow][icolumn];
158 }
159 }
160
161
164 gBlockAB(Atwr, gBLKA, hasSeedA, gLJ_seedThrA);
165
167
170 gBlockAB(Btwr, gBLKB, hasSeedB, gLJ_seedThrB);
172
173
176 gBlockAB(Ctwr, gBLKC, hasSeedC, gLJ_seedThrC);
178
179
180 std::array<int, 32> AgBlockOutL{};
181 std::array<int, 32> AgBlockEtaIndL{};
182 std::array<int, 32> AgBlockOutR{};
183 std::array<int, 32> AgBlockEtaIndR{};
184 blkOutAB(gBLKA, AgBlockOutL, AgBlockEtaIndL, AgBlockOutR, AgBlockEtaIndR);
185
186 std::array<int, 32> BgBlockOutL{};
187 std::array<int, 32> BgBlockEtaIndL{};
188 std::array<int, 32> BgBlockOutR{};
189 std::array<int, 32> BgBlockEtaIndR{};
190 blkOutAB(gBLKB, BgBlockOutL, BgBlockEtaIndL, BgBlockOutR, BgBlockEtaIndR);
191
192 std::array<int, 32> CgBlockOutL{};
193 std::array<int, 32> CgBlockEtaIndL{};
194 std::array<int, 32> CgBlockOutR{};
195 std::array<int, 32> CgBlockEtaIndR{};
196 blkOutAB(gBLKC, CgBlockOutL, CgBlockEtaIndL, CgBlockOutR, CgBlockEtaIndR) ;
197
198
199
200
201
202 gBlockMax2(gBLKA, 1, 0, gBlockTOBv[0], gBlockTOBeta[0], gBlockTOBphi[0]);
203
204 gBlockMax2(gBLKA, 2, 1, gBlockTOBv[1], gBlockTOBeta[1], gBlockTOBphi[1]);
205
206
207 gBlockMax2(gBLKB, 3, 0, gBlockTOBv[2], gBlockTOBeta[2], gBlockTOBphi[2]);
208
209 gBlockMax2(gBLKB, 4, 1, gBlockTOBv[3], gBlockTOBeta[3], gBlockTOBphi[3]);
210
211
212 gBlockMax2( gBLKC, 0, 0, gBlockTOBv[4], gBlockTOBeta[4], gBlockTOBphi[4]);
213
214 gBlockMax2( gBLKC, 5, 1, gBlockTOBv[5], gBlockTOBeta[5], gBlockTOBphi[5]);
215
216
217
221
222
225
228
232
233
235
236
238
239
241
242 }
243
245
247
249
250 }
251
252
253
255
257
259
260 }
261
262
263
264
265
269
270
271 std::array<int, 32> AjetOutL;
272 std::array<int, 32> AetaIndL;
273 std::array<int, 32> AjetOutR;
274 std::array<int, 32> AetaIndR;
275
276
277 jetOutAB(AjetsRestricted, AjetOutL, AetaIndL, AjetOutR, AetaIndR);
278
279 std::array<int, 32> BjetOutL;
280 std::array<int, 32> BetaIndL;
281 std::array<int, 32> BjetOutR;
282 std::array<int, 32> BetaIndR;
283
284 jetOutAB(BjetsRestricted, BjetOutL, BetaIndL, BjetOutR, BetaIndR);
285
286 std::array<int, 32> CNjetOut;
287 std::array<int, 32> CNetaInd;
288 std::array<int, 32> CPjetOut;
289 std::array<int, 32> CPetaInd;
290
291 jetOutAB(CjetsRestricted, CNjetOut, CNetaInd, CPjetOut, CPetaInd);
292
293
294
295 gJetTOBgen(AjetOutL, AetaIndL, 0, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
296 gJetTOBgen(AjetOutR, AetaIndR, 1, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
297
298 gJetTOBgen(BjetOutL, BetaIndL, 2, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
299 gJetTOBgen(BjetOutR, BetaIndR, 3, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
300
301 gJetTOBgen(CNjetOut, CNetaInd, 4, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
302 gJetTOBgen(CPjetOut, CPetaInd, 5, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
303
305 std::vector<std::unique_ptr<gFEXJetTOB>> tobs_v;
306 tobs_v.resize(14);
307
308
309 ATOB1_dat[0] = 0;
310 BTOB1_dat[0] = 0;
311 CTOB1_dat[0] = 0;
312
313 ATOB2_dat[0] = (( pucA & 0x0000FFFF ) << 8);
314 BTOB2_dat[0] = (( pucB & 0x0000FFFF ) << 8);
315 CTOB2_dat[0] = (( pucC & 0x0000FFFF ) << 8);
316
317
318 tobs_v[0] = std::make_unique<gFEXJetTOB>();
319 tobs_v[0]->setWord(ATOB2_dat[0]);
320 tobs_v[0]->setET(pucA);
321 tobs_v[0]->setEta(0);
322 tobs_v[0]->setPhi(0);
323 tobs_v[0]->setTobID(0);
324 tobs_v[0]->setStatus(1);
325
326 tobs_v[1] = std::make_unique<gFEXJetTOB>();
327 tobs_v[1]->setWord(BTOB2_dat[0]);
328 tobs_v[1]->setET(pucB);
329 tobs_v[1]->setEta(0);
330 tobs_v[1]->setPhi(0);
331 tobs_v[1]->setTobID(0);
332 tobs_v[1]->setStatus(1);
333
334
335
336 ATOB1_dat[1] = 0x00000001;
337 if( gBlockTOBv[0][0] > gJ_ptMinToTopoCounts2 ) ATOB1_dat[1] = ATOB1_dat[1] | 0x00000080;
338 ATOB1_dat[1] = ATOB1_dat[1] | ( ( gBlockTOBv[0][0] & 0x00000FFF ) << 8);
339 ATOB1_dat[1] = ATOB1_dat[1] | ( ( gBlockTOBeta[0][0] & 0x0000003F ) <<20);
340 ATOB1_dat[1] = ATOB1_dat[1] | ( ( gBlockTOBphi[0][0] & 0x0000001F ) <<26);
341
342 tobs_v[2] = std::make_unique<gFEXJetTOB>();
343 tobs_v[2]->setWord(ATOB1_dat[1]);
344 tobs_v[2]->setET(gBlockTOBv[0][0]);
345 tobs_v[2]->setEta(gBlockTOBeta[0][0]);
346 tobs_v[2]->setPhi(gBlockTOBphi[0][0]);
347 tobs_v[2]->setTobID(1);
348 if( gBlockTOBv[0][0] > gJ_ptMinToTopoCounts2 ) tobs_v[2]->setStatus(1);
349 else tobs_v[2]->setStatus(0);
350
351 ATOB2_dat[1] = 0x00000002;
352 if( gBlockTOBv[1][0] > gJ_ptMinToTopoCounts1 ) ATOB2_dat[1] = ATOB2_dat[1] | 0x00000080;
353 ATOB2_dat[1] = ATOB2_dat[1] | ( ( gBlockTOBv[1][0] & 0x00000FFF ) << 8);
354 ATOB2_dat[1] = ATOB2_dat[1] | ( ( gBlockTOBeta[1][0] & 0x0000003F ) <<20);
355 ATOB2_dat[1] = ATOB2_dat[1] | ( ( gBlockTOBphi[1][0] & 0x0000001F ) <<26);
356
357 tobs_v[3] = std::make_unique<gFEXJetTOB>();
358 tobs_v[3]->setWord(ATOB2_dat[1]);
359 tobs_v[3]->setET(gBlockTOBv[1][0]);
360 tobs_v[3]->setEta(gBlockTOBeta[1][0]);
361 tobs_v[3]->setPhi(gBlockTOBphi[1][0]);
362 tobs_v[3]->setTobID(2);
363 if( gBlockTOBv[1][0] > gJ_ptMinToTopoCounts1 ) tobs_v[3]->setStatus(1);
364 else tobs_v[3]->setStatus(0);
365
366
367 BTOB1_dat[1] = 0x00000001;
368 if( gBlockTOBv[2][0] > gJ_ptMinToTopoCounts1 ) BTOB1_dat[1] = BTOB1_dat[1] | 0x00000080;
369 BTOB1_dat[1] = BTOB1_dat[1] | ( ( gBlockTOBv[2][0] & 0x00000FFF ) << 8);
370 BTOB1_dat[1] = BTOB1_dat[1] | ( ( gBlockTOBeta[2][0] & 0x0000003F ) <<20);
371 BTOB1_dat[1] = BTOB1_dat[1] | ( ( gBlockTOBphi[2][0] & 0x0000001F) <<26);
372
373 tobs_v[4] = std::make_unique<gFEXJetTOB>();
374 tobs_v[4]->setWord(BTOB1_dat[1]);
375 tobs_v[4]->setET(gBlockTOBv[2][0]);
376 tobs_v[4]->setEta(gBlockTOBeta[2][0]);
377 tobs_v[4]->setPhi(gBlockTOBphi[2][0]);
378 tobs_v[4]->setTobID(1);
379 if( gBlockTOBv[2][0] > gJ_ptMinToTopoCounts1 ) tobs_v[4]->setStatus(1);
380 else tobs_v[4]->setStatus(0);
381
382
383 BTOB2_dat[1] = 0x00000002;
384 if( gBlockTOBv[3][0] > gJ_ptMinToTopoCounts2 ) BTOB2_dat[1] = BTOB2_dat[1] | 0x00000080;
385 BTOB2_dat[1] = BTOB2_dat[1] | ( ( gBlockTOBv[3][0] & 0x00000FFF ) << 8);
386 BTOB2_dat[1] = BTOB2_dat[1] | ( ( gBlockTOBeta[3][0] & 0x0000003F ) <<20);
387 BTOB2_dat[1] = BTOB2_dat[1] | ( ( gBlockTOBphi[3][0] & 0x0000001F ) <<26);
388
389 tobs_v[5] = std::make_unique<gFEXJetTOB>();
390 tobs_v[5]->setWord(BTOB2_dat[1]);
391 tobs_v[5]->setET(gBlockTOBv[3][0]);
392 tobs_v[5]->setEta(gBlockTOBeta[3][0]);
393 tobs_v[5]->setPhi(gBlockTOBphi[3][0]);
394 tobs_v[5]->setTobID(2);
395 if( gBlockTOBv[3][0] > gJ_ptMinToTopoCounts2 ) tobs_v[5]->setStatus(1);
396 else tobs_v[5]->setStatus(0);
397
398
399 CTOB1_dat[1] = 0x00000001;
400 if( gBlockTOBv[4][0] > gJ_ptMinToTopoCounts1 ) CTOB1_dat[1] = CTOB1_dat[1] | 0x00000080;
401 CTOB1_dat[1] = CTOB1_dat[1] | ( ( gBlockTOBv[4][0] & 0x00000FFF ) << 8);
402 CTOB1_dat[1] = CTOB1_dat[1] | ( ( gBlockTOBeta[4][0] & 0x0000003F ) <<20);
403 CTOB1_dat[1] = CTOB1_dat[1] | ( ( gBlockTOBphi[4][0] & 0x0000001F) <<26);
404
405
406 CTOB2_dat[1] = 0x00000002;
407 if( gBlockTOBv[5][0] > gJ_ptMinToTopoCounts2) CTOB2_dat[1] = CTOB2_dat[1] | 0x00000080;
408 CTOB2_dat[1] = CTOB2_dat[1] | ( ( gBlockTOBv[5][0] & 0x00000FFF ) << 8);
409 CTOB2_dat[1] = CTOB2_dat[1] | ( ( gBlockTOBeta[5][0] & 0x0000003F ) <<20);
410 CTOB2_dat[1] = CTOB2_dat[1] | ( ( gBlockTOBphi[5][0] & 0x0000001F ) <<26);
411
412
413
414
415 ATOB1_dat[2] = 0x00000003;
416 if( gBlockTOBv[0][1] > gJ_ptMinToTopoCounts2 ) ATOB1_dat[2] = ATOB1_dat[2] | 0x00000080;
417 ATOB1_dat[2] = ATOB1_dat[2] | ( ( gBlockTOBv[0][1] & 0x00000FFF ) << 8);
418 ATOB1_dat[2] = ATOB1_dat[2] | ( ( gBlockTOBeta[0][1] & 0x0000003F ) <<20);
419 ATOB1_dat[2] = ATOB1_dat[2] | ( ( gBlockTOBphi[0][1] & 0x0000001F ) <<26);
420
421 tobs_v[6] = std::make_unique<gFEXJetTOB>();
422 tobs_v[6]->setWord(ATOB1_dat[2]);
423 tobs_v[6]->setET(gBlockTOBv[0][1]);
424 tobs_v[6]->setEta(gBlockTOBeta[0][1]);
425 tobs_v[6]->setPhi(gBlockTOBphi[0][1]);
426 tobs_v[6]->setTobID(3);
427 if( gBlockTOBv[0][1] > gJ_ptMinToTopoCounts2 ) tobs_v[6]->setStatus(1);
428 else tobs_v[6]->setStatus(0);
429
430
431 ATOB2_dat[2] = 0x00000004;
432 if( gBlockTOBv[1][1] > gJ_ptMinToTopoCounts1 ) ATOB2_dat[2] = ATOB2_dat[2] | 0x00000080;
433 ATOB2_dat[2] = ATOB2_dat[2] | ( ( gBlockTOBv[1][1] & 0x00000FFF ) << 8);
434 ATOB2_dat[2] = ATOB2_dat[2] | ( ( gBlockTOBeta[1][1] & 0x0000003F ) <<20);
435 ATOB2_dat[2] = ATOB2_dat[2] | ( ( gBlockTOBphi[1][1] & 0x0000001F ) <<26);
436
437 tobs_v[7] = std::make_unique<gFEXJetTOB>();
438 tobs_v[7]->setWord(ATOB2_dat[2]);
439 tobs_v[7]->setET(gBlockTOBv[1][1]);
440 tobs_v[7]->setEta(gBlockTOBeta[1][1]);
441 tobs_v[7]->setPhi(gBlockTOBphi[1][1]);
442 tobs_v[7]->setTobID(4);
443 if( gBlockTOBv[1][1] > gJ_ptMinToTopoCounts1 ) tobs_v[7]->setStatus(1);
444 else tobs_v[7]->setStatus(0);
445
446
447 BTOB1_dat[2] = 0x00000003;
448 if( gBlockTOBv[2][1] > gJ_ptMinToTopoCounts1 ) BTOB1_dat[2] = BTOB1_dat[2] | 0x00000080;
449 BTOB1_dat[2] = BTOB1_dat[2] | ( ( gBlockTOBv[2][1] & 0x00000FFF ) << 8);
450 BTOB1_dat[2] = BTOB1_dat[2] | ( ( gBlockTOBeta[2][1] & 0x0000003F ) <<20);
451 BTOB1_dat[2] = BTOB1_dat[2] | ( ( gBlockTOBphi[2][1] & 0x0000001F ) <<26);
452
453 tobs_v[8] = std::make_unique<gFEXJetTOB>();
454 tobs_v[8]->setWord(BTOB1_dat[2]);
455 tobs_v[8]->setET(gBlockTOBv[2][1]);
456 tobs_v[8]->setEta(gBlockTOBeta[2][1]);
457 tobs_v[8]->setPhi(gBlockTOBphi[2][1]);
458 tobs_v[8]->setTobID(3);
459 if( gBlockTOBv[2][1] > gJ_ptMinToTopoCounts1 ) tobs_v[8]->setStatus(1);
460 else tobs_v[8]->setStatus(0);
461
462
463 BTOB2_dat[2] = 0x00000004;
464 if( gBlockTOBv[3][1] > gJ_ptMinToTopoCounts2 ) BTOB2_dat[2] = BTOB2_dat[2] | 0x00000080;
465 BTOB2_dat[2] = BTOB2_dat[2] | ( ( gBlockTOBv[3][1] & 0x00000FFF ) << 8);
466 BTOB2_dat[2] = BTOB2_dat[2] | ( ( gBlockTOBeta[3][1] & 0x0000003F ) <<20);
467 BTOB2_dat[2] = BTOB2_dat[2] | ( ( gBlockTOBphi[3][1] & 0x0000001F ) <<26);
468
469 tobs_v[9] = std::make_unique<gFEXJetTOB>();
470 tobs_v[9]->setWord(BTOB2_dat[2]);
471 tobs_v[9]->setET(gBlockTOBv[3][1]);
472 tobs_v[9]->setEta(gBlockTOBeta[3][1]);
473 tobs_v[9]->setPhi(gBlockTOBphi[3][1]);
474 tobs_v[9]->setTobID(4);
475 if( gBlockTOBv[3][1] > gJ_ptMinToTopoCounts2 ) tobs_v[9]->setStatus(1);
476 else tobs_v[9]->setStatus(0);
477
478
479 CTOB1_dat[2] = 0x00000003;
480 if( gBlockTOBv[4][1] > gJ_ptMinToTopoCounts1 ) CTOB1_dat[2] = CTOB1_dat[2] | 0x00000080;
481 CTOB1_dat[2] = CTOB1_dat[2] | ( ( gBlockTOBv[4][1] & 0x00000FFF ) << 8);
482 CTOB1_dat[2] = CTOB1_dat[2] | ( ( gBlockTOBeta[4][1] & 0x0000003F ) <<20);
483 CTOB1_dat[2] = CTOB1_dat[2] | ( ( gBlockTOBphi[4][1] & 0x0000001F ) <<26);
484
485 CTOB2_dat[2] = 0x00000004;
486 if( gBlockTOBv[5][1] > gJ_ptMinToTopoCounts2 ) CTOB2_dat[2] = CTOB2_dat[2] | 0x00000080;
487 CTOB2_dat[2] = CTOB2_dat[2] | ( ( gBlockTOBv[5][1] & 0x00000FFF ) << 8);
488 CTOB2_dat[2] = CTOB2_dat[2] | ( ( gBlockTOBeta[5][1] & 0x0000003F ) <<20);
489 CTOB2_dat[2] = CTOB2_dat[2] | ( ( gBlockTOBphi[5][1] & 0x0000001F ) <<26);
490
491
492
493
494
495
496
497
498 int tobvShift = 8;
499 int tobvMask = 0x00000FFF;
500
501
502 ATOB1_dat[3] = 0x00000005;
503 if( gJetTOBv[0] > gLJ_ptMinToTopoCounts2 ) ATOB1_dat[3] = ATOB1_dat[3] | 0x00000080;
504 ATOB1_dat[3] = ATOB1_dat[3] | ( ( gJetTOBv[0] & tobvMask) << tobvShift);
505 ATOB1_dat[3] = ATOB1_dat[3] | ( ( gJetTOBeta[0] & 0x0000003F ) <<20);
506 ATOB1_dat[3] = ATOB1_dat[3] | ( ( gJetTOBphi[0] & 0x0000001F ) <<26);
507
508 tobs_v[10] = std::make_unique<gFEXJetTOB>();
509 tobs_v[10]->setWord(ATOB1_dat[3]);
510 tobs_v[10]->setET(gJetTOBv[0]);
511 tobs_v[10]->setEta(gJetTOBeta[0]);
512 tobs_v[10]->setPhi(gJetTOBphi[0]);
513 tobs_v[10]->setTobID(5);
514 if(gJetTOBv[0] > gLJ_ptMinToTopoCounts2 ) tobs_v[10]->setStatus(1);
515 else tobs_v[10]->setStatus(0);
516
517
518 ATOB2_dat[3] = 0x00000006;
519 if( gJetTOBv[1] > gLJ_ptMinToTopoCounts1 ) ATOB2_dat[3] = ATOB2_dat[3] | 0x00000080;
520 ATOB2_dat[3] = ATOB2_dat[3] | ( ( gJetTOBv[1] & tobvMask ) << tobvShift);
521 ATOB2_dat[3] = ATOB2_dat[3] | ( ( gJetTOBeta[1] & 0x0000003F ) <<20);
522 ATOB2_dat[3] = ATOB2_dat[3] | ( ( gJetTOBphi[1] & 0x0000001F ) <<26);
523
524 tobs_v[11] = std::make_unique<gFEXJetTOB>();
525 tobs_v[11]->setWord(ATOB2_dat[3]);
526 tobs_v[11]->setET(gJetTOBv[1]);
527 tobs_v[11]->setEta(gJetTOBeta[1]);
528 tobs_v[11]->setPhi(gJetTOBphi[1]);
529 tobs_v[11]->setTobID(6);
530 if( gJetTOBv[1] > gLJ_ptMinToTopoCounts1 ) tobs_v[11]->setStatus(1);
531 else tobs_v[11]->setStatus(0);
532
533
534 BTOB1_dat[3] = 0x00000005;
535 if( gJetTOBv[2] > gLJ_ptMinToTopoCounts1 ) BTOB1_dat[3] = BTOB1_dat[3] | 0x00000080;
536 BTOB1_dat[3] = BTOB1_dat[3] | ( ( gJetTOBv[2] & tobvMask) << tobvShift);
537 BTOB1_dat[3] = BTOB1_dat[3] | ( ( gJetTOBeta[2] & 0x0000003F ) <<20);
538 BTOB1_dat[3] = BTOB1_dat[3] | ( ( gJetTOBphi[2] & 0x0000001F ) <<26);
539
540 tobs_v[12] = std::make_unique<gFEXJetTOB>();
541 tobs_v[12]->setWord(BTOB1_dat[3]);
542 tobs_v[12]->setET(gJetTOBv[2]);
543 tobs_v[12]->setEta(gJetTOBeta[2]);
544 tobs_v[12]->setPhi(gJetTOBphi[2]);
545 tobs_v[12]->setTobID(5);
546 if( gJetTOBv[2] > gLJ_ptMinToTopoCounts1 ) tobs_v[12]->setStatus(1);
547 else tobs_v[12]->setStatus(0);
548
549
550 BTOB2_dat[3] = 0x00000006;
551 if( gJetTOBv[3] > gLJ_ptMinToTopoCounts2 ) BTOB2_dat[3] = BTOB2_dat[3] | 0x00000080;
552 BTOB2_dat[3] = BTOB2_dat[3] | ( ( gJetTOBv[3] & tobvMask ) << tobvShift);
553 BTOB2_dat[3] = BTOB2_dat[3] | ( ( gJetTOBeta[3] & 0x0000003F ) <<20);
554 BTOB2_dat[3] = BTOB2_dat[3] | ( ( gJetTOBphi[3] & 0x0000001F ) <<26);
555
556 tobs_v[13] = std::make_unique<gFEXJetTOB>();
557 tobs_v[13]->setWord(BTOB2_dat[3]);
558 tobs_v[13]->setET(gJetTOBv[3]);
559 tobs_v[13]->setEta(gJetTOBeta[3]);
560 tobs_v[13]->setPhi(gJetTOBphi[3]);
561 tobs_v[13]->setTobID(6);
562 if( gJetTOBv[3] > gLJ_ptMinToTopoCounts2 ) tobs_v[13]->setStatus(1);
563 else tobs_v[13]->setStatus(0);
564
565
566 CTOB1_dat[3] = 0x00000005;
567 if( gJetTOBv[4] > gLJ_ptMinToTopoCounts1 ) CTOB1_dat[3] = CTOB1_dat[3] | 0x00000080;
568 CTOB1_dat[3] = CTOB1_dat[3] | ( ( gJetTOBv[4] & tobvMask) << tobvShift);
569 CTOB1_dat[3] = CTOB1_dat[3] | ( ( gJetTOBeta[4] & 0x0000003F ) <<20);
570 CTOB1_dat[3] = CTOB1_dat[3] | ( ( gJetTOBphi[4] & 0x0000001F ) <<26);
571
572 CTOB2_dat[3] = 0x00000006;
573 if( gJetTOBv[5] > gLJ_ptMinToTopoCounts2 ) CTOB2_dat[3] = CTOB2_dat[3] | 0x00000080;
574 CTOB2_dat[3] = CTOB2_dat[3] | ( ( gJetTOBv[5] & tobvMask ) << tobvShift);
575 CTOB2_dat[3] = CTOB2_dat[3] | ( ( gJetTOBeta[5] & 0x0000003F ) <<20);
576 CTOB2_dat[3] = CTOB2_dat[3] | ( ( gJetTOBphi[5] & 0x0000001F ) <<26);
577
578
579
580
581
582 bool setSat = 0;
583 if ( setSat) {
584 if( gTOBsat[0] ) {
585 ATOB1_dat[1] = ( ATOB1_dat[1] | 0x80000000 );
586 ATOB1_dat[3] = ( ATOB1_dat[3] | 0x80000000 );
587 }
588
589 if( gTOBsat[1] ) {
590 ATOB2_dat[1] = ( ATOB2_dat[1] | 0x80000000 );
591 ATOB2_dat[3] = ( ATOB2_dat[3] | 0x80000000 );
592 }
593
594 if( gTOBsat[2] ) {
595 BTOB1_dat[1] = ( BTOB1_dat[1] | 0x80000000 );
596 BTOB1_dat[3] = ( BTOB1_dat[3] | 0x80000000 );
597 }
598
599 if( gTOBsat[3] ) {
600 BTOB2_dat[1] = ( BTOB2_dat[1] | 0x80000000 );
601 BTOB2_dat[3] = ( BTOB2_dat[3] | 0x80000000 );
602 }
603
604 if( gTOBsat[4] ) {
605 CTOB1_dat[1] = ( CTOB1_dat[1] | 0x80000000 );
606 CTOB1_dat[3] = ( CTOB1_dat[3] | 0x80000000 );
607 }
608
609 if( gTOBsat[5] ) {
610 CTOB2_dat[1] = ( CTOB2_dat[1] | 0x80000000 );
611 CTOB2_dat[3] = ( CTOB2_dat[3] | 0x80000000 );
612 }
613 }
614
615
616
617 ATOB1_dat[4] = 0 ;
618 ATOB2_dat[4] = 0 ;
619 BTOB1_dat[4] = 0 ;
620 BTOB2_dat[4] = 0 ;
621 CTOB1_dat[4] = 0 ;
622 CTOB2_dat[4] = 0 ;
623
624
625
627
628 ATOB1_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
629 ATOB2_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
630 BTOB1_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
631 BTOB2_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
632 CTOB1_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
633 CTOB2_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
634
635
636 int CRC = 0;
637
638
639 ATOB1_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
640 ATOB2_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
641 BTOB1_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
642 BTOB2_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
643 CTOB1_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
644 CTOB2_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
645
646
647 return tobs_v;
648
649}
static constexpr int PS_UPPER_AB
static constexpr int BTOBFIB
static constexpr bool ENABLE_INTER_AB
static constexpr bool ENABLE_INTER_ABC
static constexpr bool ENABLE_INTER_C
static constexpr int PS_SHIFT_C
static constexpr int PS_LOWER_C
static constexpr int ABcolumns
static constexpr int PS_SHIFT_AB
static constexpr int PS_LOWER_AB
static constexpr int PS_UPPER_C
virtual void gBlockMax2(const gTowersType &gBlkSum, int BjetColumn, int localColumn, std::array< int, 3 > &gBlockV, std::array< int, 3 > &gBlockEta, std::array< int, 3 > &gBlockPhi) const
virtual void SaturateBlocks(gTowersType &gBlkSum, const gTowersType &sat) const
virtual void gBlockVetoAB(gTowersType &jets, gTowersType &hasSeed) const
virtual void pileUpCorrectionAB(gTowersType &jets, int puc) const
virtual void addRemoteCPin(gTowersType &jets, const gTowersPartialSums &partial, int ps_upper, int ps_lower, int ps_shift) const
virtual void ZeroNegative(gTowersType &jets) const
virtual void addRemoteLin(gTowersType &jets, const gTowersPartialSums &partial, int ps_upper, int ps_lower, int ps_shift) const
virtual void gJetVetoAB(gTowersType &twrs, int jet_threshold) const
virtual void blkOutAB(gTowersType &blocks, std::array< int, 32 > &jetOutL, std::array< int, 32 > &etaIndL, std::array< int, 32 > &jetOutR, std::array< int, 32 > &etaIndR) const
virtual void InternalPartialAB(const gTowersType &twrs, gTowersPartialSums &lps, gTowersPartialSums &rps) const
virtual void RemotePartialCN(const gTowersJetEngine &twrs, gTowersPartialSums &rps) const
virtual void addRemoteRin(gTowersType &jets, const gTowersPartialSums &partial, int ps_upper, int ps_lower, int ps_shift) const
virtual void singleHalf(const gTowersType &twrs, gTowersType &FPGAsum) const
virtual void RemotePartialCP(const gTowersJetEngine &twrs, gTowersPartialSums &lps) const
virtual void gBlockAB(const gTowersType &twrs, gTowersType &gBlkSum, gTowersType &hasSeed, int seedThreshold) const
virtual void gJetTOBgen(const std::array< int, FEXAlgoSpaceDefs::ABCrows > &jetOut, const std::array< int, FEXAlgoSpaceDefs::ABCrows > &etaInd, int TOBnum, int jetThreshold, std::array< int, FEXAlgoSpaceDefs::gJetTOBfib > &gJetTOBs, std::array< int, FEXAlgoSpaceDefs::gJetTOBfib > &gJetTOBv, std::array< int, FEXAlgoSpaceDefs::gJetTOBfib > &gJetTOBeta, std::array< int, FEXAlgoSpaceDefs::gJetTOBfib > &gJetTOBphi) const
virtual void SaturateJets(gTowersType &jets, const gTowersType &sat) const
virtual void addRemoteCNin(gTowersType &jets, const gTowersPartialSums &partial, int ps_upper, int ps_lower, int ps_shift) const
virtual void addInternalRin(gTowersType &jets, gTowersPartialSums &partial) const
virtual void jetOutAB(const gTowersType &jets, std::array< int, 32 > &jetOutL, std::array< int, 32 > &etaIndL, std::array< int, 32 > &jetOutR, std::array< int, 32 > &etaIndR) const
virtual void addInternalLin(gTowersType &jets, gTowersPartialSums &partial) const
virtual void RemotePartialAB(const gTowersType &twrs, gTowersPartialSums &lps, gTowersPartialSums &rps) const
std::array< std::array< int, 12 >, 32 > gTowersType
std::array< std::array< int, 4 >, 32 > gTowersPartialSums