24 declareInterface<IgFEXJetAlgo>(
this);
32 return StatusCode::SUCCESS;
45 int pucA,
int pucB,
int pucC,
int gLJ_seedThrA,
int gLJ_seedThrB,
int gLJ_seedThrC,
46 int gJ_ptMinToTopoCounts1,
int gJ_ptMinToTopoCounts2,
47 int jetThreshold,
int gLJ_ptMinToTopoCounts1,
int gLJ_ptMinToTopoCounts2,
48 std::array<uint32_t, 7> & ATOB1_dat, std::array<uint32_t, 7> & ATOB2_dat,
49 std::array<uint32_t, 7> & BTOB1_dat, std::array<uint32_t, 7> & BTOB2_dat,
50 std::array<uint32_t, 7> & CTOB1_dat, std::array<uint32_t, 7> & CTOB2_dat)
const {
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}};
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}} }};
77 CNtwr[irow][jcolumn] = Ctwr[irow][jcolumn] ;
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;
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;
138 if (Asat[irow][icolumn] != 0){
155 AjetsRestricted[irow][icolumn] = AjetsAlt[irow][icolumn];
156 BjetsRestricted[irow][icolumn] = BjetsAlt[irow][icolumn];
157 CjetsRestricted[irow][icolumn] = CjetsAlt[irow][icolumn];
164 gBlockAB(Atwr, gBLKA, hasSeedA, gLJ_seedThrA);
170 gBlockAB(Btwr, gBLKB, hasSeedB, gLJ_seedThrB);
176 gBlockAB(Ctwr, gBLKC, hasSeedC, gLJ_seedThrC);
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);
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);
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) ;
202 gBlockMax2(gBLKA, 1, 0, gBlockTOBv[0], gBlockTOBeta[0], gBlockTOBphi[0]);
204 gBlockMax2(gBLKA, 2, 1, gBlockTOBv[1], gBlockTOBeta[1], gBlockTOBphi[1]);
207 gBlockMax2(gBLKB, 3, 0, gBlockTOBv[2], gBlockTOBeta[2], gBlockTOBphi[2]);
209 gBlockMax2(gBLKB, 4, 1, gBlockTOBv[3], gBlockTOBeta[3], gBlockTOBphi[3]);
212 gBlockMax2( gBLKC, 0, 0, gBlockTOBv[4], gBlockTOBeta[4], gBlockTOBphi[4]);
214 gBlockMax2( gBLKC, 5, 1, gBlockTOBv[5], gBlockTOBeta[5], gBlockTOBphi[5]);
271 std::array<int, 32> AjetOutL;
272 std::array<int, 32> AetaIndL;
273 std::array<int, 32> AjetOutR;
274 std::array<int, 32> AetaIndR;
277 jetOutAB(AjetsRestricted, AjetOutL, AetaIndL, AjetOutR, AetaIndR);
279 std::array<int, 32> BjetOutL;
280 std::array<int, 32> BetaIndL;
281 std::array<int, 32> BjetOutR;
282 std::array<int, 32> BetaIndR;
284 jetOutAB(BjetsRestricted, BjetOutL, BetaIndL, BjetOutR, BetaIndR);
286 std::array<int, 32> CNjetOut;
287 std::array<int, 32> CNetaInd;
288 std::array<int, 32> CPjetOut;
289 std::array<int, 32> CPetaInd;
291 jetOutAB(CjetsRestricted, CNjetOut, CNetaInd, CPjetOut, CPetaInd);
295 gJetTOBgen(AjetOutL, AetaIndL, 0, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
296 gJetTOBgen(AjetOutR, AetaIndR, 1, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
298 gJetTOBgen(BjetOutL, BetaIndL, 2, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
299 gJetTOBgen(BjetOutR, BetaIndR, 3, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
301 gJetTOBgen(CNjetOut, CNetaInd, 4, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
302 gJetTOBgen(CPjetOut, CPetaInd, 5, jetThreshold, gJetTOBs, gJetTOBv, gJetTOBeta, gJetTOBphi);
305 std::vector<std::unique_ptr<gFEXJetTOB>> tobs_v;
313 ATOB2_dat[0] = (( pucA & 0x0000FFFF ) << 8);
314 BTOB2_dat[0] = (( pucB & 0x0000FFFF ) << 8);
315 CTOB2_dat[0] = (( pucC & 0x0000FFFF ) << 8);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
499 int tobvMask = 0x00000FFF;
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
585 ATOB1_dat[1] = ( ATOB1_dat[1] | 0x80000000 );
586 ATOB1_dat[3] = ( ATOB1_dat[3] | 0x80000000 );
590 ATOB2_dat[1] = ( ATOB2_dat[1] | 0x80000000 );
591 ATOB2_dat[3] = ( ATOB2_dat[3] | 0x80000000 );
595 BTOB1_dat[1] = ( BTOB1_dat[1] | 0x80000000 );
596 BTOB1_dat[3] = ( BTOB1_dat[3] | 0x80000000 );
600 BTOB2_dat[1] = ( BTOB2_dat[1] | 0x80000000 );
601 BTOB2_dat[3] = ( BTOB2_dat[3] | 0x80000000 );
605 CTOB1_dat[1] = ( CTOB1_dat[1] | 0x80000000 );
606 CTOB1_dat[3] = ( CTOB1_dat[3] | 0x80000000 );
610 CTOB2_dat[1] = ( CTOB2_dat[1] | 0x80000000 );
611 CTOB2_dat[3] = ( CTOB2_dat[3] | 0x80000000 );
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 ) ;
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);
659 typedef std::array<std::array<int, 4>, 4> gTowersNeighbours;
660 gTowersNeighbours NUpDwnR = {{ {{2,3,4,4}}, {{0,2,3,4}}, {{0,0,2,3}}, {{0,0,0,2}} }};
664 gTowersNeighbours NUpDwnL = {{ {{2,0,0,0}}, {{3,2,0,0}}, {{4,3,2,0}}, {{4,4,3,2}} }};
670 rps[irow][rcolumn] = 0;
674 if ( NUpDwnR[rcolumn][lcolumn] > 0 ) {
675 rps[irow][rcolumn] = rps[irow][rcolumn] + twrs[irow][lcolumn+8];
678 for(
int rowOff = 1 ; rowOff < NUpDwnR[rcolumn][lcolumn]+1; rowOff++){
679 int rowModUp = (irow + rowOff)%32;
680 int rowModDn = (irow - rowOff + 32 )%32;
682 rps[irow][rcolumn] = rps[irow][rcolumn] + twrs[rowModUp][lcolumn+8] + twrs[rowModDn][lcolumn+8];
692 lps[irow][rcolumn] = 0;
696 if ( NUpDwnL[rcolumn][lcolumn] > 0 ) {
697 lps[irow][rcolumn] = lps[irow][rcolumn] + twrs[irow][lcolumn];
700 for(
int rowOff = 1 ; rowOff < NUpDwnL[rcolumn][lcolumn]+1; rowOff++){
701 int rowModUp = (irow + rowOff)%32;
702 int rowModDn = (irow - rowOff + 32 )%32;
703 lps[irow][rcolumn] = lps[irow][rcolumn] + twrs[rowModUp][lcolumn] + twrs[rowModDn][lcolumn];
714 typedef std::array<std::array<int, 4>, 4> gTowersNeighbours;
715 gTowersNeighbours NUpDwnR = {{ {{2,3,4,4}}, {{0,2,3,4}}, {{0,0,2,3}}, {{0,0,0,2}} }};
721 rps[irow][rcolumn] = 0;
723 if ( NUpDwnR[rcolumn][lcolumn] > 0 ) {
724 rps[irow][rcolumn] = rps[irow][rcolumn] + twrs[irow][lcolumn+2];
726 for(
int rowOff = 1 ; rowOff < NUpDwnR[rcolumn][lcolumn]+1; rowOff++){
727 int rowModUp = (irow + rowOff)%32;
728 int rowModDn = (irow - rowOff + 32 )%32;
729 rps[irow][rcolumn] = rps[irow][rcolumn] + twrs[rowModUp][lcolumn+2] + twrs[rowModDn][lcolumn+2];
739 typedef std::array<std::array<int, 4>, 4> gTowersNeighbours;
740 gTowersNeighbours NUpDwnL = {{ {{2,0,0,0}}, {{3,2,0,0}}, {{4,3,2,0}}, {{4,4,3,2}} }};
745 lps[irow][rcolumn] = 0;
749 if ( NUpDwnL[rcolumn][lcolumn] > 0 ) {
750 lps[irow][rcolumn] = lps[irow][rcolumn] + twrs[irow][lcolumn];
752 for(
int rowOff = 1 ; rowOff < NUpDwnL[rcolumn][lcolumn]+1; rowOff++){
753 int rowModUp = (irow + rowOff)%32;
754 int rowModDn = (irow - rowOff + 32 )%32;
755 lps[irow][rcolumn] = lps[irow][rcolumn] + twrs[rowModUp][lcolumn] + twrs[rowModDn][lcolumn];
768 std::array<int, 9> NUpDwn = {{2,3,4,4,4,4,4,3,2}};
774 FPGAsum[irow][jcolumn] = 0;
777 for(
int localColumn = 0; localColumn<9; localColumn++){
778 int sumColumn = jcolumn + localColumn - 4;
790 if( (sumColumn >= lmin) && (sumColumn <= lmax) ) {
793 FPGAsum[irow][jcolumn] = FPGAsum[irow][jcolumn] + twrs[irow][sumColumn];
797 for(
int localRow = 1; localRow<=NUpDwn[localColumn]; localRow++){
798 int krowUp = (irow + localRow);
799 if( krowUp > 31 ) krowUp = krowUp - 32;
800 int krowDn = (irow - localRow);
801 if( krowDn < 0 ) krowDn = krowDn + 32;
802 FPGAsum[irow][jcolumn] = FPGAsum[irow][jcolumn] +
803 twrs[krowUp][sumColumn] +
804 twrs[krowDn][sumColumn];
825 unsigned int NUpDwnR[4][4] = { {2,3,4,4}, {0,2,3,4}, {0,0,2,3}, {0,0,0,2} };
829 unsigned int NUpDwnL[4][4] = { {2,0,0,0}, {3,2,0,0}, {4,3,2,0}, {4,4,3,2} };
837 rps[irow][rcolumn] = 0;
841 if ( NUpDwnR[rcolumn][lcolumn] > 0 ) {
843 rps[irow][rcolumn] = rps[irow][rcolumn] + twrs[irow][lcolumn+2];
846 for(
unsigned int rowOff = 1 ; rowOff < NUpDwnR[rcolumn][lcolumn]+1; rowOff++){
847 int rowModUp = (irow + rowOff)%32;
848 int rowModDn = (irow - rowOff + 32 )%32;
850 rps[irow][rcolumn] = rps[irow][rcolumn] + twrs[rowModUp][lcolumn+2] + twrs[rowModDn][lcolumn+2];
860 lps[irow][rcolumn] = 0;
864 if ( NUpDwnL[rcolumn][lcolumn] > 0 ) {
865 lps[irow][rcolumn] = lps[irow][rcolumn] + twrs[irow][lcolumn+6];
868 for(
unsigned int rowOff = 1 ; rowOff < NUpDwnL[rcolumn][lcolumn]+1; rowOff++){
869 int rowModUp = (irow + rowOff)%32;
870 int rowModDn = (irow - rowOff + 32 )%32;
872 lps[irow][rcolumn] = lps[irow][rcolumn] + twrs[rowModUp][lcolumn+6] + twrs[rowModDn][lcolumn+6];
884 jets[irow][2+ipartial] =
jets[irow][2+ipartial] + partial[irow][ipartial];
894 jets[irow][6+ipartial] =
jets[irow][6+ipartial] + partial[irow][ipartial];
903 for(
int irow=0;irow<
rows;irow++){
904 for(
int icolumn=0;icolumn<
cols;icolumn++){
905 jets[irow][icolumn] =
jets[irow][icolumn] - puc;
914 if(
jets[irow][icolumn] < 0)
jets[irow][icolumn] = 0;
924 if(
static_cast<unsigned>(sat[irow][icolumn])) {
926 jets[irow][icolumn] = 0x0003ffff;
935 if(
static_cast<unsigned>(sat[irow][icolumn])) {
936 gBlkSum[irow][icolumn] = 0x00000fff;
946 int rows = twrs.size();
947 int cols = twrs[0].size();
948 for(
int irow = 0; irow <
rows; irow++ ){
949 for(
int jcolumn = 0; jcolumn<
cols; jcolumn++){
951 gBlkSum[irow][jcolumn] = 0;
952 int krowUp = (irow + 1)%32;
953 int krowDn = (irow - 1 +32)%32;
954 if( (jcolumn == 0) || (jcolumn == 6) ) {
956 gBlkSum[irow][jcolumn] =
957 twrs[irow][jcolumn] + twrs[krowUp][jcolumn] + twrs[krowDn][jcolumn] +
958 twrs[irow][jcolumn+1] + twrs[krowUp][jcolumn+1] + twrs[krowDn][jcolumn+1];
959 }
else if( (jcolumn == 5) || (jcolumn == 11)) {
961 gBlkSum[irow][jcolumn] =
962 twrs[irow][jcolumn] + twrs[krowUp][jcolumn] + twrs[krowDn][jcolumn] +
963 twrs[irow][jcolumn-1] + twrs[krowUp][jcolumn-1] + twrs[krowDn][jcolumn-1];
966 gBlkSum[irow][jcolumn] =
967 twrs[irow][jcolumn] + twrs[krowUp][jcolumn] + twrs[krowDn][jcolumn] +
968 twrs[irow][jcolumn-1] + twrs[krowUp][jcolumn-1] + twrs[krowDn][jcolumn-1] +
969 twrs[irow][jcolumn+1] + twrs[krowUp][jcolumn+1] + twrs[krowDn][jcolumn+1];
972 if( gBlkSum[irow][jcolumn] > seedThreshold) {
973 hasSeed[irow][jcolumn] = 1;
975 hasSeed[irow][jcolumn] = 0;
978 if ( gBlkSum[irow][jcolumn] < 0 )
979 gBlkSum[irow][jcolumn] = 0;
991 void gFEXJetAlgo::blkOutAB(
gTowersType & blocks, std::array<int, 32> & jetOutL, std::array<int, 32> & etaIndL, std::array<int, 32> & jetOutR, std::array<int, 32> & etaIndR)
const{
997 for(
unsigned int localEta = 0; localEta<6; localEta++){
998 if( blocks[ieng][localEta] > jetOutL[ieng] ){
999 jetOutL[ieng] = blocks[ieng][localEta];
1000 etaIndL[ieng] = localEta;
1006 for(
unsigned int localEta = 0; localEta<6; localEta++){
1007 if( blocks[ieng][localEta+6] > jetOutR[ieng] ) {
1008 jetOutR[ieng] = blocks[ieng][localEta+6];
1009 etaIndR[ieng] = localEta;
1016 void gFEXJetAlgo::gBlockMax2(
const gTowersType & gBlkSum,
int BjetColumn,
int localColumn, std::array<int, 3> & gBlockV, std::array<int, 3> & gBlockEta, std::array<int, 3> & gBlockPhi)
const {
1031 gBlockMax192(gBlkSumC, gBlockV, gBlockEta, gBlockPhi, 0);
1033 for(
int i = -1;
i<2;
i++){
1034 int iGlobal =
i + gBlockPhi[0];
1036 if ( iGlobal < 0 ) iGlobal = iGlobal + 32;
1037 if ( iGlobal > 31 ) iGlobal = iGlobal - 32;
1039 for(
int j = -1; j<2; j++){
1040 int jGlobal = j + gBlockEta[0];
1041 if( (jGlobal > -1) && (jGlobal < 6) ) {
1042 gBlkSumC[iGlobal][jGlobal] = 0;
1047 gBlockMax192(gBlkSumC, gBlockV, gBlockEta, gBlockPhi, 1);
1050 gBlockEta[0] = gBlockEta[0] + 2 + 6*BjetColumn;
1051 gBlockEta[1] = gBlockEta[1] + 2 + 6*BjetColumn;
1056 std::array<int, 3> & gBlockVp,
1057 std::array<int, 3> & gBlockEtap,
1058 std::array<int, 3> & gBlockPhip,
1093 if( gBlkSum[irow][icolumn] > maxv){
1094 maxv = gBlkSum[irow][icolumn];
1099 for(
int i = 0;
i<96;
i++){
1100 if( inpv[2*
i+1] > inpv[2*
i] ) {
1101 maxv1[
i] = inpv[2*
i+1];
1102 maxi1[
i] = inpi[2*
i+1];
1104 maxv1[
i] = inpv[2*
i];
1105 maxi1[
i] = inpi[2*
i];
1109 for(
int i = 0;
i<48;
i++){
1110 if( maxv1[2*
i+1] > maxv1[2*
i] ) {
1111 maxv2[
i] = maxv1[2*
i+1];
1112 maxi2[
i] = maxi1[2*
i+1];
1114 maxv2[
i] = maxv1[2*
i];
1115 maxi2[
i] = maxi1[2*
i];
1119 for(
int i = 0;
i<24;
i++){
1120 if( maxv2[2*
i+1] > maxv2[2*
i] ) {
1121 maxv3[
i] = maxv2[2*
i+1];
1122 maxi3[
i] = maxi2[2*
i+1];
1124 maxv3[
i] = maxv2[2*
i];
1125 maxi3[
i] = maxi2[2*
i];
1129 for(
int i = 0;
i<12;
i++){
1130 if( maxv3[2*
i+1] > maxv3[2*
i] ) {
1131 maxv4[
i] = maxv3[2*
i+1];
1132 maxi4[
i] = maxi3[2*
i+1];
1134 maxv4[
i] = maxv3[2*
i];
1135 maxi4[
i] = maxi3[2*
i];
1139 for(
int i = 0;
i<6;
i++){
1140 if( maxv4[2*
i+1] > maxv4[2*
i] ) {
1141 maxv5[
i] = maxv4[2*
i+1];
1142 maxi5[
i] = maxi4[2*
i+1];
1144 maxv5[
i] = maxv4[2*
i];
1145 maxi5[
i] = maxi4[2*
i];
1149 for(
int i = 0;
i<3;
i++){
1150 if( maxv5[2*
i+1] > maxv5[2*
i] ) {
1151 maxv6[
i] = maxv5[2*
i+1];
1152 maxi6[
i] = maxi5[2*
i+1];
1154 maxv6[
i] = maxv5[2*
i];
1155 maxi6[
i] = maxi5[2*
i];
1159 if( ( maxv6[1] > maxv6[0] ) && ( maxv6[1] > maxv6[2] ) ) {
1163 if( maxv6[0] > maxv6[2] ){
1173 gBlockVp[
index] = maxvall ;
1174 gBlockEtap[
index] = maxiall/32;
1175 gBlockPhip[
index] = maxiall%32;
1183 for(
int irow = 0; irow <
rows; irow++ ){
1184 for(
int jcolumn = 0; jcolumn <
cols; jcolumn++){
1185 if( hasSeed[irow][jcolumn] == 0 ) {
1188 jets[irow][jcolumn] = 0XFFFFF000;
1196 int ps_upper,
int ps_lower,
int ps_shift)
const {
1200 int rows = partial.size();
1201 int cols = partial[0].size();
1203 for(
int irow=0;irow<
rows;irow++){
1204 for(
int ipartial= 0; ipartial <
cols; ipartial++){
1207 if( partial[irow][ipartial] > ps_upper ) {
1208 truncPart = ps_upper;
1209 }
else if ( partial[irow][ipartial] < ps_lower ) {
1210 truncPart = ps_lower;
1212 truncPart = partial[irow][ipartial];
1215 truncPart = (truncPart >> ps_shift );
1216 truncPart = (truncPart << ps_shift );
1218 jets[irow][8+ipartial] =
jets[irow][8+ipartial] + truncPart;
1224 int ps_upper,
int ps_lower,
int ps_shift)
const {
1226 int rows = partial.size();
1227 int cols = partial[0].size();
1229 for(
int irow=0;irow<
rows;irow++){
1230 for(
int ipartial= 0; ipartial <
cols; ipartial++){
1233 if( partial[irow][ipartial] > ps_upper ) {
1234 truncPart = ps_upper;
1235 }
else if ( partial[irow][ipartial] < ps_lower ) {
1236 truncPart = ps_lower;
1238 truncPart = partial[irow][ipartial];
1241 truncPart = (truncPart >> ps_shift );
1242 truncPart = (truncPart << ps_shift );
1244 jets[irow][ipartial] =
jets[irow][ipartial] + truncPart;
1251 int ps_upper,
int ps_lower,
int ps_shift )
const {
1253 int rows = partial.size();
1254 int cols = partial[0].size();
1256 for(
int irow=0; irow <
rows; irow++){
1257 for(
int ipartial= 0; ipartial <
cols; ipartial++){
1260 if( partial[irow][ipartial] > ps_upper ) {
1261 truncPart = ps_upper;
1262 }
else if ( partial[irow][ipartial] < ps_lower ) {
1263 truncPart = ps_lower;
1265 truncPart = partial[irow][ipartial];
1268 truncPart = (truncPart >> ps_shift );
1269 truncPart = (truncPart << ps_shift );
1271 jets[irow][ipartial+2] =
jets[irow][ipartial+2] + truncPart;
1278 int ps_upper,
int ps_lower,
int ps_shift )
const {
1280 int rows = partial.size();
1281 int cols = partial[0].size();
1283 for(
int irow=0;irow<
rows;irow++){
1284 for(
int ipartial= 0; ipartial <
cols; ipartial++){
1286 if( partial[irow][ipartial] > ps_upper ) {
1287 truncPart = ps_upper;
1288 }
else if ( partial[irow][ipartial] < ps_lower ) {
1289 truncPart = ps_lower;
1291 truncPart = partial[irow][ipartial];
1294 truncPart = (truncPart >> ps_shift );
1295 truncPart = (truncPart << ps_shift );
1297 jets[irow][ipartial+6] =
jets[irow][ipartial+6] + truncPart;
1305 int rows = twrs.size();
1306 int cols = twrs[0].size();
1307 for(
int irow = 0; irow <
rows; irow++ ){
1308 for(
int jcolumn = 0; jcolumn<
cols; jcolumn++){
1309 if( twrs[irow][jcolumn] < jet_threshold+1 ) {
1310 twrs[irow][jcolumn] = 0;
1318 std::array<int, 32> & jetOutL, std::array<int, 32> & etaIndL,
1319 std::array<int, 32> & jetOutR, std::array<int, 32> & etaIndR )
const {
1325 for(
int localEta = 0; localEta<6; localEta++){
1326 if(
jets[ieng][localEta] > jetOutL[ieng] ){
1327 jetOutL[ieng] =
jets[ieng][localEta];
1328 etaIndL[ieng] = localEta;
1337 if( jetOutL[ieng] < 0 ) jetOutL[ieng] = 0;
1343 for(
int localEta = 0; localEta < 6; localEta++){
1344 if(
jets[ieng][localEta+6] > jetOutR[ieng] ){
1345 jetOutR[ieng] =
jets[ieng][localEta+6];
1346 etaIndR[ieng] = localEta;
1351 if( jetOutR[ieng] < 0 ) jetOutR[ieng] = 0;
1365 int rows = twrs.size();
1366 int cols = twrs[0].size();
1369 for(
int irow=0; irow<
rows; irow++){
1370 for(
int icolumn=0; icolumn<
cols; icolumn++){
1371 int fineGT = twrs[irow][icolumn]*inputScale;
1376 if( fineGT < rhoThreshold_Max ) {
1377 pucSum = pucSum + fineGT;
1386 unsigned int oneOverNTab = 69<<25;
1387 if( nSum > 0 && nSum < 385 ) {
1393 int oneOverN = oneOverNTab ;
1396 pucSum = pucSum * oneOverN;
1400 pucSum = ( pucSum >> 14);
1406 const std::array<int, FEXAlgoSpaceDefs::ABCrows>& etaInd,
1407 int TOBnum,
int jetThreshold, std::array<int, FEXAlgoSpaceDefs::gJetTOBfib> & gJetTOBs,
1408 std::array<int, FEXAlgoSpaceDefs::gJetTOBfib> & gJetTOBv,
1409 std::array<int, FEXAlgoSpaceDefs::gJetTOBfib> & gJetTOBeta,
1410 std::array<int, FEXAlgoSpaceDefs::gJetTOBfib> & gJetTOBphi )
const {
1416 if( jetOut[irow] > jetThreshold ) {
1417 jetOutZS[irow] = jetOut[irow];
1419 jetOutZS[irow] = 0 ;
1444 for(
int i=0;
i<16;
i++){
1445 if( jetOut[2*
i + 1] > jetOutZS[2*
i] ){
1446 l1mv[
i] = jetOutZS[2*
i + 1];
1447 l1met[
i] = etaInd[2*
i + 1];
1448 l1mphi[
i] = 2*
i + 1;
1450 l1mv[
i] = jetOutZS[2*
i ];
1451 l1met[
i] = etaInd[2*
i ];
1456 for(
int i=0;
i<8;
i++){
1457 if( l1mv[2*
i + 1] > l1mv[2*
i] ){
1458 l2mv[
i] = l1mv[ 2*
i + 1 ];
1459 l2met[
i] = l1met[ 2*
i + 1];
1460 l2mphi[
i] = l1mphi[2*
i + 1];
1462 l2mv[
i] = l1mv[ 2*
i ];
1463 l2met[
i] = l1met[ 2*
i ];
1464 l2mphi[
i] = l1mphi[2*
i ];
1468 for(
int i=0;
i<4;
i++){
1469 if( l2mv[2*
i + 1] > l2mv[2*
i] ){
1470 l3mv[
i] = l2mv[ 2*
i + 1];
1471 l3met[
i] = l2met[ 2*
i + 1];
1472 l3mphi[
i] = l2mphi[2*
i + 1];
1474 l3mv[
i] = l2mv[2*
i ];
1475 l3met[
i] = l2met[2*
i ];
1476 l3mphi[
i] = l2mphi[2*
i ];
1480 for(
int i=0;
i<2;
i++){
1481 if( l3mv[2*
i + 1] > l3mv[2*
i] ){
1482 l4mv[
i] = l3mv[ 2*
i + 1];
1483 l4met[
i] = l3met[ 2*
i + 1];
1484 l4mphi[
i] = l3mphi[2*
i + 1];
1486 l4mv[
i] = l3mv[2*
i ];
1487 l4met[
i] = l3met[2*
i ];
1488 l4mphi[
i] = l3mphi[2*
i ];
1492 if( l4mv[1] > l4mv[0] ){
1493 if(l4mv[1] > jetThreshold){
1494 gJetTOBv[TOBnum] = l4mv[1];
1495 gJetTOBeta[TOBnum] = l4met[1] + etaOff[TOBnum];
1496 gJetTOBphi[TOBnum] = l4mphi[1];
1497 gJetTOBs[TOBnum] = 1;
1499 gJetTOBv[TOBnum] = l4mv[1];
1500 gJetTOBeta[TOBnum] = l4met[1] + etaOff[TOBnum];
1501 gJetTOBphi[TOBnum] = l4mphi[1];
1502 gJetTOBs[TOBnum] = 0;
1505 if(l4mv[0] > jetThreshold){
1506 gJetTOBv[TOBnum] = l4mv[0];
1507 gJetTOBeta[TOBnum] = l4met[0] + etaOff[TOBnum];
1508 gJetTOBphi[TOBnum] = l4mphi[0];
1509 gJetTOBs[TOBnum] = 1;
1511 gJetTOBv[TOBnum] = l4mv[0];
1512 gJetTOBeta[TOBnum] = l4met[0] + etaOff[TOBnum];
1513 gJetTOBphi[TOBnum] = l4mphi[0];
1514 gJetTOBs[TOBnum] = 0;