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