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
150
151
154 AjetsRestricted[irow][icolumn] = AjetsAlt[irow][icolumn];
155 BjetsRestricted[irow][icolumn] = BjetsAlt[irow][icolumn];
156 CjetsRestricted[irow][icolumn] = CjetsAlt[irow][icolumn];
157 }
158 }
159
160
163 gBlockAB(Atwr, gBLKA, hasSeedA, gLJ_seedThrA);
164
166
167
168
169
170
171
174 if(Asat[irow][icol] && (icol % 6 != 0)) hasSeedA[irow][
icol - 1] = 1;
175 }
176 }
177
180 gBlockAB(Btwr, gBLKB, hasSeedB, gLJ_seedThrB);
182
183
184
187 if(Bsat[irow][icol] && (icol % 6 != 0) && icol != 11) hasSeedB[irow][
icol - 1] = 1;
188 }
189 }
190
193 gBlockAB(Ctwr, gBLKC, hasSeedC, gLJ_seedThrC);
195
196
197
200 if(Csat[irow][icol] && (icol % 6 != 0) && (icol % 6 != 5)) hasSeedC[irow][
icol - 1] = 1;
201 }
202 }
203
204
205 std::array<int, 32> AgBlockOutL{};
206 std::array<int, 32> AgBlockEtaIndL{};
207 std::array<int, 32> AgBlockOutR{};
208 std::array<int, 32> AgBlockEtaIndR{};
209 blkOutAB(gBLKA, AgBlockOutL, AgBlockEtaIndL, AgBlockOutR, AgBlockEtaIndR);
210
211 std::array<int, 32> BgBlockOutL{};
212 std::array<int, 32> BgBlockEtaIndL{};
213 std::array<int, 32> BgBlockOutR{};
214 std::array<int, 32> BgBlockEtaIndR{};
215 blkOutAB(gBLKB, BgBlockOutL, BgBlockEtaIndL, BgBlockOutR, BgBlockEtaIndR);
216
217 std::array<int, 32> CgBlockOutL{};
218 std::array<int, 32> CgBlockEtaIndL{};
219 std::array<int, 32> CgBlockOutR{};
220 std::array<int, 32> CgBlockEtaIndR{};
221 blkOutAB(gBLKC, CgBlockOutL, CgBlockEtaIndL, CgBlockOutR, CgBlockEtaIndR) ;
222
223
224
225
226
227 gBlockMax2(gBLKA, 1, 0, gBlockTOBv[0], gBlockTOBeta[0], gBlockTOBphi[0]);
228
229 gBlockMax2(gBLKA, 2, 1, gBlockTOBv[1], gBlockTOBeta[1], gBlockTOBphi[1]);
230
231
232 gBlockMax2(gBLKB, 3, 0, gBlockTOBv[2], gBlockTOBeta[2], gBlockTOBphi[2]);
233
234 gBlockMax2(gBLKB, 4, 1, gBlockTOBv[3], gBlockTOBeta[3], gBlockTOBphi[3]);
235
236
237 gBlockMax2( gBLKC, 0, 0, gBlockTOBv[4], gBlockTOBeta[4], gBlockTOBphi[4]);
238
239 gBlockMax2( gBLKC, 5, 1, gBlockTOBv[5], gBlockTOBeta[5], gBlockTOBphi[5]);
240
241
245
246
249
252
256
257
259
260
262
263
265
266 }
267
269
271
273
274 }
275
276
277
279
281
283
284 }
285
286
287
288
289
290
291
292
293
297
298
299
300
304
305 std::array<int, 32> AjetOutL;
306 std::array<int, 32> AetaIndL;
307 std::array<int, 32> AjetOutR;
308 std::array<int, 32> AetaIndR;
309
310
311 jetOutAB(AjetsRestricted, AjetOutL, AetaIndL, AjetOutR, AetaIndR);
312
313 std::array<int, 32> BjetOutL;
314 std::array<int, 32> BetaIndL;
315 std::array<int, 32> BjetOutR;
316 std::array<int, 32> BetaIndR;
317
318 jetOutAB(BjetsRestricted, BjetOutL, BetaIndL, BjetOutR, BetaIndR);
319
320 std::array<int, 32> CNjetOut;
321 std::array<int, 32> CNetaInd;
322 std::array<int, 32> CPjetOut;
323 std::array<int, 32> CPetaInd;
324
325 jetOutAB(CjetsRestricted, CNjetOut, CNetaInd, CPjetOut, CPetaInd);
326
327 gJetTOBgen(AjetOutL, AetaIndL, 0, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
328 gJetTOBgen(AjetOutR, AetaIndR, 1, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
329
330 gJetTOBgen(BjetOutL, BetaIndL, 2, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
331 gJetTOBgen(BjetOutR, BetaIndR, 3, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
332
333 gJetTOBgen(CNjetOut, CNetaInd, 4, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
334 gJetTOBgen(CPjetOut, CPetaInd, 5, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
335
337 std::vector<std::unique_ptr<gFEXJetTOB>> tobs_v;
338 tobs_v.resize(14);
339
340
341 ATOB1_dat[0] = 0;
342 BTOB1_dat[0] = 0;
343 CTOB1_dat[0] = 0;
344
345 ATOB2_dat[0] = (( pucA & 0x0000FFFF ) << 8);
346 BTOB2_dat[0] = (( pucB & 0x0000FFFF ) << 8);
347 CTOB2_dat[0] = (( pucC & 0x0000FFFF ) << 8);
348
349
350 tobs_v[0] = std::make_unique<gFEXJetTOB>();
351 tobs_v[0]->setWord(ATOB2_dat[0]);
352 tobs_v[0]->setET(pucA);
353 tobs_v[0]->setEta(0);
354 tobs_v[0]->setPhi(0);
355 tobs_v[0]->setTobID(0);
356 tobs_v[0]->setStatus(1);
357
358 tobs_v[1] = std::make_unique<gFEXJetTOB>();
359 tobs_v[1]->setWord(BTOB2_dat[0]);
360 tobs_v[1]->setET(pucB);
361 tobs_v[1]->setEta(0);
362 tobs_v[1]->setPhi(0);
363 tobs_v[1]->setTobID(0);
364 tobs_v[1]->setStatus(1);
365
366
367
368 ATOB1_dat[1] = 0x00000001;
369 if( gBlockTOBv[0][0] > gJ_ptMinToTopoCounts2 ) ATOB1_dat[1] = ATOB1_dat[1] | 0x00000080;
370 ATOB1_dat[1] = ATOB1_dat[1] | ( ( gBlockTOBv[0][0] & 0x00000FFF ) << 8);
371 ATOB1_dat[1] = ATOB1_dat[1] | ( ( gBlockTOBeta[0][0] & 0x0000003F ) <<20);
372 ATOB1_dat[1] = ATOB1_dat[1] | ( ( gBlockTOBphi[0][0] & 0x0000001F ) <<26);
373
374 tobs_v[2] = std::make_unique<gFEXJetTOB>();
375 tobs_v[2]->setWord(ATOB1_dat[1]);
376 tobs_v[2]->setET(gBlockTOBv[0][0]);
377 tobs_v[2]->setEta(gBlockTOBeta[0][0]);
378 tobs_v[2]->setPhi(gBlockTOBphi[0][0]);
379 tobs_v[2]->setTobID(1);
380 if( gBlockTOBv[0][0] > gJ_ptMinToTopoCounts2 ) tobs_v[2]->setStatus(1);
381 else tobs_v[2]->setStatus(0);
382
383 ATOB2_dat[1] = 0x00000002;
384 if( gBlockTOBv[1][0] > gJ_ptMinToTopoCounts1 ) ATOB2_dat[1] = ATOB2_dat[1] | 0x00000080;
385 ATOB2_dat[1] = ATOB2_dat[1] | ( ( gBlockTOBv[1][0] & 0x00000FFF ) << 8);
386 ATOB2_dat[1] = ATOB2_dat[1] | ( ( gBlockTOBeta[1][0] & 0x0000003F ) <<20);
387 ATOB2_dat[1] = ATOB2_dat[1] | ( ( gBlockTOBphi[1][0] & 0x0000001F ) <<26);
388
389 tobs_v[3] = std::make_unique<gFEXJetTOB>();
390 tobs_v[3]->setWord(ATOB2_dat[1]);
391 tobs_v[3]->setET(gBlockTOBv[1][0]);
392 tobs_v[3]->setEta(gBlockTOBeta[1][0]);
393 tobs_v[3]->setPhi(gBlockTOBphi[1][0]);
394 tobs_v[3]->setTobID(2);
395 if( gBlockTOBv[1][0] > gJ_ptMinToTopoCounts1 ) tobs_v[3]->setStatus(1);
396 else tobs_v[3]->setStatus(0);
397
398
399 BTOB1_dat[1] = 0x00000001;
400 if( gBlockTOBv[2][0] > gJ_ptMinToTopoCounts1 ) BTOB1_dat[1] = BTOB1_dat[1] | 0x00000080;
401 BTOB1_dat[1] = BTOB1_dat[1] | ( ( gBlockTOBv[2][0] & 0x00000FFF ) << 8);
402 BTOB1_dat[1] = BTOB1_dat[1] | ( ( gBlockTOBeta[2][0] & 0x0000003F ) <<20);
403 BTOB1_dat[1] = BTOB1_dat[1] | ( ( gBlockTOBphi[2][0] & 0x0000001F) <<26);
404
405 tobs_v[4] = std::make_unique<gFEXJetTOB>();
406 tobs_v[4]->setWord(BTOB1_dat[1]);
407 tobs_v[4]->setET(gBlockTOBv[2][0]);
408 tobs_v[4]->setEta(gBlockTOBeta[2][0]);
409 tobs_v[4]->setPhi(gBlockTOBphi[2][0]);
410 tobs_v[4]->setTobID(1);
411 if( gBlockTOBv[2][0] > gJ_ptMinToTopoCounts1 ) tobs_v[4]->setStatus(1);
412 else tobs_v[4]->setStatus(0);
413
414
415 BTOB2_dat[1] = 0x00000002;
416 if( gBlockTOBv[3][0] > gJ_ptMinToTopoCounts2 ) BTOB2_dat[1] = BTOB2_dat[1] | 0x00000080;
417 BTOB2_dat[1] = BTOB2_dat[1] | ( ( gBlockTOBv[3][0] & 0x00000FFF ) << 8);
418 BTOB2_dat[1] = BTOB2_dat[1] | ( ( gBlockTOBeta[3][0] & 0x0000003F ) <<20);
419 BTOB2_dat[1] = BTOB2_dat[1] | ( ( gBlockTOBphi[3][0] & 0x0000001F ) <<26);
420
421 tobs_v[5] = std::make_unique<gFEXJetTOB>();
422 tobs_v[5]->setWord(BTOB2_dat[1]);
423 tobs_v[5]->setET(gBlockTOBv[3][0]);
424 tobs_v[5]->setEta(gBlockTOBeta[3][0]);
425 tobs_v[5]->setPhi(gBlockTOBphi[3][0]);
426 tobs_v[5]->setTobID(2);
427 if( gBlockTOBv[3][0] > gJ_ptMinToTopoCounts2 ) tobs_v[5]->setStatus(1);
428 else tobs_v[5]->setStatus(0);
429
430
431 CTOB1_dat[1] = 0x00000001;
432 if( gBlockTOBv[4][0] > gJ_ptMinToTopoCounts1 ) CTOB1_dat[1] = CTOB1_dat[1] | 0x00000080;
433 CTOB1_dat[1] = CTOB1_dat[1] | ( ( gBlockTOBv[4][0] & 0x00000FFF ) << 8);
434 CTOB1_dat[1] = CTOB1_dat[1] | ( ( gBlockTOBeta[4][0] & 0x0000003F ) <<20);
435 CTOB1_dat[1] = CTOB1_dat[1] | ( ( gBlockTOBphi[4][0] & 0x0000001F) <<26);
436
437
438 CTOB2_dat[1] = 0x00000002;
439 if( gBlockTOBv[5][0] > gJ_ptMinToTopoCounts2) CTOB2_dat[1] = CTOB2_dat[1] | 0x00000080;
440 CTOB2_dat[1] = CTOB2_dat[1] | ( ( gBlockTOBv[5][0] & 0x00000FFF ) << 8);
441 CTOB2_dat[1] = CTOB2_dat[1] | ( ( gBlockTOBeta[5][0] & 0x0000003F ) <<20);
442 CTOB2_dat[1] = CTOB2_dat[1] | ( ( gBlockTOBphi[5][0] & 0x0000001F ) <<26);
443
444
445
446
447 ATOB1_dat[2] = 0x00000003;
448 if( gBlockTOBv[0][1] > gJ_ptMinToTopoCounts2 ) ATOB1_dat[2] = ATOB1_dat[2] | 0x00000080;
449 ATOB1_dat[2] = ATOB1_dat[2] | ( ( gBlockTOBv[0][1] & 0x00000FFF ) << 8);
450 ATOB1_dat[2] = ATOB1_dat[2] | ( ( gBlockTOBeta[0][1] & 0x0000003F ) <<20);
451 ATOB1_dat[2] = ATOB1_dat[2] | ( ( gBlockTOBphi[0][1] & 0x0000001F ) <<26);
452
453 tobs_v[6] = std::make_unique<gFEXJetTOB>();
454 tobs_v[6]->setWord(ATOB1_dat[2]);
455 tobs_v[6]->setET(gBlockTOBv[0][1]);
456 tobs_v[6]->setEta(gBlockTOBeta[0][1]);
457 tobs_v[6]->setPhi(gBlockTOBphi[0][1]);
458 tobs_v[6]->setTobID(3);
459 if( gBlockTOBv[0][1] > gJ_ptMinToTopoCounts2 ) tobs_v[6]->setStatus(1);
460 else tobs_v[6]->setStatus(0);
461
462
463 ATOB2_dat[2] = 0x00000004;
464 if( gBlockTOBv[1][1] > gJ_ptMinToTopoCounts1 ) ATOB2_dat[2] = ATOB2_dat[2] | 0x00000080;
465 ATOB2_dat[2] = ATOB2_dat[2] | ( ( gBlockTOBv[1][1] & 0x00000FFF ) << 8);
466 ATOB2_dat[2] = ATOB2_dat[2] | ( ( gBlockTOBeta[1][1] & 0x0000003F ) <<20);
467 ATOB2_dat[2] = ATOB2_dat[2] | ( ( gBlockTOBphi[1][1] & 0x0000001F ) <<26);
468
469 tobs_v[7] = std::make_unique<gFEXJetTOB>();
470 tobs_v[7]->setWord(ATOB2_dat[2]);
471 tobs_v[7]->setET(gBlockTOBv[1][1]);
472 tobs_v[7]->setEta(gBlockTOBeta[1][1]);
473 tobs_v[7]->setPhi(gBlockTOBphi[1][1]);
474 tobs_v[7]->setTobID(4);
475 if( gBlockTOBv[1][1] > gJ_ptMinToTopoCounts1 ) tobs_v[7]->setStatus(1);
476 else tobs_v[7]->setStatus(0);
477
478
479 BTOB1_dat[2] = 0x00000003;
480 if( gBlockTOBv[2][1] > gJ_ptMinToTopoCounts1 ) BTOB1_dat[2] = BTOB1_dat[2] | 0x00000080;
481 BTOB1_dat[2] = BTOB1_dat[2] | ( ( gBlockTOBv[2][1] & 0x00000FFF ) << 8);
482 BTOB1_dat[2] = BTOB1_dat[2] | ( ( gBlockTOBeta[2][1] & 0x0000003F ) <<20);
483 BTOB1_dat[2] = BTOB1_dat[2] | ( ( gBlockTOBphi[2][1] & 0x0000001F ) <<26);
484
485 tobs_v[8] = std::make_unique<gFEXJetTOB>();
486 tobs_v[8]->setWord(BTOB1_dat[2]);
487 tobs_v[8]->setET(gBlockTOBv[2][1]);
488 tobs_v[8]->setEta(gBlockTOBeta[2][1]);
489 tobs_v[8]->setPhi(gBlockTOBphi[2][1]);
490 tobs_v[8]->setTobID(3);
491 if( gBlockTOBv[2][1] > gJ_ptMinToTopoCounts1 ) tobs_v[8]->setStatus(1);
492 else tobs_v[8]->setStatus(0);
493
494
495 BTOB2_dat[2] = 0x00000004;
496 if( gBlockTOBv[3][1] > gJ_ptMinToTopoCounts2 ) BTOB2_dat[2] = BTOB2_dat[2] | 0x00000080;
497 BTOB2_dat[2] = BTOB2_dat[2] | ( ( gBlockTOBv[3][1] & 0x00000FFF ) << 8);
498 BTOB2_dat[2] = BTOB2_dat[2] | ( ( gBlockTOBeta[3][1] & 0x0000003F ) <<20);
499 BTOB2_dat[2] = BTOB2_dat[2] | ( ( gBlockTOBphi[3][1] & 0x0000001F ) <<26);
500
501 tobs_v[9] = std::make_unique<gFEXJetTOB>();
502 tobs_v[9]->setWord(BTOB2_dat[2]);
503 tobs_v[9]->setET(gBlockTOBv[3][1]);
504 tobs_v[9]->setEta(gBlockTOBeta[3][1]);
505 tobs_v[9]->setPhi(gBlockTOBphi[3][1]);
506 tobs_v[9]->setTobID(4);
507 if( gBlockTOBv[3][1] > gJ_ptMinToTopoCounts2 ) tobs_v[9]->setStatus(1);
508 else tobs_v[9]->setStatus(0);
509
510
511 CTOB1_dat[2] = 0x00000003;
512 if( gBlockTOBv[4][1] > gJ_ptMinToTopoCounts1 ) CTOB1_dat[2] = CTOB1_dat[2] | 0x00000080;
513 CTOB1_dat[2] = CTOB1_dat[2] | ( ( gBlockTOBv[4][1] & 0x00000FFF ) << 8);
514 CTOB1_dat[2] = CTOB1_dat[2] | ( ( gBlockTOBeta[4][1] & 0x0000003F ) <<20);
515 CTOB1_dat[2] = CTOB1_dat[2] | ( ( gBlockTOBphi[4][1] & 0x0000001F ) <<26);
516
517 CTOB2_dat[2] = 0x00000004;
518 if( gBlockTOBv[5][1] > gJ_ptMinToTopoCounts2 ) CTOB2_dat[2] = CTOB2_dat[2] | 0x00000080;
519 CTOB2_dat[2] = CTOB2_dat[2] | ( ( gBlockTOBv[5][1] & 0x00000FFF ) << 8);
520 CTOB2_dat[2] = CTOB2_dat[2] | ( ( gBlockTOBeta[5][1] & 0x0000003F ) <<20);
521 CTOB2_dat[2] = CTOB2_dat[2] | ( ( gBlockTOBphi[5][1] & 0x0000001F ) <<26);
522
523
524
525
526
527
528
529
530 int tobvShift = 8;
531 int tobvMask = 0x00000FFF;
532
533
534 ATOB1_dat[3] = 0x00000005;
535 if( gJetTOBv[0] > gLJ_ptMinToTopoCounts2 ) ATOB1_dat[3] = ATOB1_dat[3] | 0x00000080;
536 ATOB1_dat[3] = ATOB1_dat[3] | ( ( gJetTOBv[0] & tobvMask) << tobvShift);
537 ATOB1_dat[3] = ATOB1_dat[3] | ( ( gJetTOBeta[0] & 0x0000003F ) <<20);
538 ATOB1_dat[3] = ATOB1_dat[3] | ( ( gJetTOBphi[0] & 0x0000001F ) <<26);
539
540 tobs_v[10] = std::make_unique<gFEXJetTOB>();
541 tobs_v[10]->setWord(ATOB1_dat[3]);
542 tobs_v[10]->setET(gJetTOBv[0]);
543 tobs_v[10]->setEta(gJetTOBeta[0]);
544 tobs_v[10]->setPhi(gJetTOBphi[0]);
545 tobs_v[10]->setTobID(5);
546 if(gJetTOBv[0] > gLJ_ptMinToTopoCounts2 ) tobs_v[10]->setStatus(1);
547 else tobs_v[10]->setStatus(0);
548
549
550 ATOB2_dat[3] = 0x00000006;
551 if( gJetTOBv[1] > gLJ_ptMinToTopoCounts1 ) ATOB2_dat[3] = ATOB2_dat[3] | 0x00000080;
552 ATOB2_dat[3] = ATOB2_dat[3] | ( ( gJetTOBv[1] & tobvMask ) << tobvShift);
553 ATOB2_dat[3] = ATOB2_dat[3] | ( ( gJetTOBeta[1] & 0x0000003F ) <<20);
554 ATOB2_dat[3] = ATOB2_dat[3] | ( ( gJetTOBphi[1] & 0x0000001F ) <<26);
555
556 tobs_v[11] = std::make_unique<gFEXJetTOB>();
557 tobs_v[11]->setWord(ATOB2_dat[3]);
558 tobs_v[11]->setET(gJetTOBv[1]);
559 tobs_v[11]->setEta(gJetTOBeta[1]);
560 tobs_v[11]->setPhi(gJetTOBphi[1]);
561 tobs_v[11]->setTobID(6);
562 if( gJetTOBv[1] > gLJ_ptMinToTopoCounts1 ) tobs_v[11]->setStatus(1);
563 else tobs_v[11]->setStatus(0);
564
565
566 BTOB1_dat[3] = 0x00000005;
567 if( gJetTOBv[2] > gLJ_ptMinToTopoCounts1 ) BTOB1_dat[3] = BTOB1_dat[3] | 0x00000080;
568 BTOB1_dat[3] = BTOB1_dat[3] | ( ( gJetTOBv[2] & tobvMask) << tobvShift);
569 BTOB1_dat[3] = BTOB1_dat[3] | ( ( gJetTOBeta[2] & 0x0000003F ) <<20);
570 BTOB1_dat[3] = BTOB1_dat[3] | ( ( gJetTOBphi[2] & 0x0000001F ) <<26);
571
572 tobs_v[12] = std::make_unique<gFEXJetTOB>();
573 tobs_v[12]->setWord(BTOB1_dat[3]);
574 tobs_v[12]->setET(gJetTOBv[2]);
575 tobs_v[12]->setEta(gJetTOBeta[2]);
576 tobs_v[12]->setPhi(gJetTOBphi[2]);
577 tobs_v[12]->setTobID(5);
578 if( gJetTOBv[2] > gLJ_ptMinToTopoCounts1 ) tobs_v[12]->setStatus(1);
579 else tobs_v[12]->setStatus(0);
580
581
582 BTOB2_dat[3] = 0x00000006;
583 if( gJetTOBv[3] > gLJ_ptMinToTopoCounts2 ) BTOB2_dat[3] = BTOB2_dat[3] | 0x00000080;
584 BTOB2_dat[3] = BTOB2_dat[3] | ( ( gJetTOBv[3] & tobvMask ) << tobvShift);
585 BTOB2_dat[3] = BTOB2_dat[3] | ( ( gJetTOBeta[3] & 0x0000003F ) <<20);
586 BTOB2_dat[3] = BTOB2_dat[3] | ( ( gJetTOBphi[3] & 0x0000001F ) <<26);
587
588 tobs_v[13] = std::make_unique<gFEXJetTOB>();
589 tobs_v[13]->setWord(BTOB2_dat[3]);
590 tobs_v[13]->setET(gJetTOBv[3]);
591 tobs_v[13]->setEta(gJetTOBeta[3]);
592 tobs_v[13]->setPhi(gJetTOBphi[3]);
593 tobs_v[13]->setTobID(6);
594 if( gJetTOBv[3] > gLJ_ptMinToTopoCounts2 ) tobs_v[13]->setStatus(1);
595 else tobs_v[13]->setStatus(0);
596
597
598 CTOB1_dat[3] = 0x00000005;
599 if( gJetTOBv[4] > gLJ_ptMinToTopoCounts1 ) CTOB1_dat[3] = CTOB1_dat[3] | 0x00000080;
600 CTOB1_dat[3] = CTOB1_dat[3] | ( ( gJetTOBv[4] & tobvMask) << tobvShift);
601 CTOB1_dat[3] = CTOB1_dat[3] | ( ( gJetTOBeta[4] & 0x0000003F ) <<20);
602 CTOB1_dat[3] = CTOB1_dat[3] | ( ( gJetTOBphi[4] & 0x0000001F ) <<26);
603
604 CTOB2_dat[3] = 0x00000006;
605 if( gJetTOBv[5] > gLJ_ptMinToTopoCounts2 ) CTOB2_dat[3] = CTOB2_dat[3] | 0x00000080;
606 CTOB2_dat[3] = CTOB2_dat[3] | ( ( gJetTOBv[5] & tobvMask ) << tobvShift);
607 CTOB2_dat[3] = CTOB2_dat[3] | ( ( gJetTOBeta[5] & 0x0000003F ) <<20);
608 CTOB2_dat[3] = CTOB2_dat[3] | ( ( gJetTOBphi[5] & 0x0000001F ) <<26);
609
610
611
612
613
614 bool setSat = 0;
615 if ( setSat) {
616 if( gTOBsat[0] ) {
617 ATOB1_dat[1] = ( ATOB1_dat[1] | 0x80000000 );
618 ATOB1_dat[3] = ( ATOB1_dat[3] | 0x80000000 );
619 }
620
621 if( gTOBsat[1] ) {
622 ATOB2_dat[1] = ( ATOB2_dat[1] | 0x80000000 );
623 ATOB2_dat[3] = ( ATOB2_dat[3] | 0x80000000 );
624 }
625
626 if( gTOBsat[2] ) {
627 BTOB1_dat[1] = ( BTOB1_dat[1] | 0x80000000 );
628 BTOB1_dat[3] = ( BTOB1_dat[3] | 0x80000000 );
629 }
630
631 if( gTOBsat[3] ) {
632 BTOB2_dat[1] = ( BTOB2_dat[1] | 0x80000000 );
633 BTOB2_dat[3] = ( BTOB2_dat[3] | 0x80000000 );
634 }
635
636 if( gTOBsat[4] ) {
637 CTOB1_dat[1] = ( CTOB1_dat[1] | 0x80000000 );
638 CTOB1_dat[3] = ( CTOB1_dat[3] | 0x80000000 );
639 }
640
641 if( gTOBsat[5] ) {
642 CTOB2_dat[1] = ( CTOB2_dat[1] | 0x80000000 );
643 CTOB2_dat[3] = ( CTOB2_dat[3] | 0x80000000 );
644 }
645 }
646
647
648
649 ATOB1_dat[4] = 0 ;
650 ATOB2_dat[4] = 0 ;
651 BTOB1_dat[4] = 0 ;
652 BTOB2_dat[4] = 0 ;
653 CTOB1_dat[4] = 0 ;
654 CTOB2_dat[4] = 0 ;
655
656
657
659
660 ATOB1_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
661 ATOB2_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
662 BTOB1_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
663 BTOB2_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
664 CTOB1_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
665 CTOB2_dat[5] = ( (
BCID&0x0000007F)<<8 ) ;
666
667
668 int CRC = 0;
669
670
671 ATOB1_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
672 ATOB2_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
673 BTOB1_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
674 BTOB2_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
675 CTOB1_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
676 CTOB2_dat[6] = 0x000000BC | ( (
BCID&0x0000000F)<<8 ) | (3<<12) | (CRC<<23);
677
678
679
680 return tobs_v;
681
682}
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 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 SaturateJets(gTowersType &jets, const gTowersType &sat, int fpga) 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 addRemoteCNin(gTowersType &jets, const gTowersPartialSums &partial, int ps_upper, int ps_lower, int ps_shift) const
virtual void SaturateBlocks(gTowersType &gBlkSum, const gTowersType &sat, int fpga) 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