34 declareInterface<IjFEXFPGA>(
this);
49 return StatusCode::SUCCESS;
56 return StatusCode::SUCCESS;
89 return StatusCode::FAILURE;
114 std::vector<int> pileup_ID;
115 std::vector<int> pileup_HAD_jet;
116 std::vector<int> pileup_EM_jet;
117 std::vector<int> pileup_Total_jet;
118 std::vector<int> pileup_HAD_met;
119 std::vector<int> pileup_EM_met;
120 std::vector<int> pileup_Total_met;
123 pileup_ID.push_back(
key);
124 pileup_HAD_jet.push_back(
val[0]);
127 pileup_HAD_met.push_back(
val[1]);
135 inputOutputCollection->
addValue_pileup(
"pileup_rho_EM", pileup_rho[0]);
136 inputOutputCollection->
addValue_pileup(
"pileup_rho_HAD1", pileup_rho[1]);
137 inputOutputCollection->
addValue_pileup(
"pileup_rho_HAD2", pileup_rho[2]);
138 inputOutputCollection->
addValue_pileup(
"pileup_rho_HAD3", pileup_rho[3]);
139 inputOutputCollection->
addValue_pileup(
"pileup_rho_FCAL", pileup_rho[4]);
140 inputOutputCollection->
addValue_pileup(
"pileup_map_ID" , std::move(pileup_ID));
141 inputOutputCollection->
addValue_pileup(
"pileup_map_Et_values_HAD_jet" , std::move(pileup_HAD_jet));
142 inputOutputCollection->
addValue_pileup(
"pileup_map_Et_values_EM_jet" , std::move(pileup_EM_jet));
143 inputOutputCollection->
addValue_pileup(
"pileup_map_Et_values_Total_jet", std::move(pileup_Total_jet));
144 inputOutputCollection->
addValue_pileup(
"pileup_map_Et_values_HAD_met" , std::move(pileup_HAD_met));
145 inputOutputCollection->
addValue_pileup(
"pileup_map_Et_values_EM_met" , std::move(pileup_EM_met));
146 inputOutputCollection->
addValue_pileup(
"pileup_map_Et_values_Total_met", std::move(pileup_Total_met));
160 std::unique_ptr<jFEXTOB> jXE_tob = std::make_unique<jFEXTOB>();
163 std::unique_ptr<jFEXTOB> jTE_tob = std::make_unique<jFEXTOB>();
167 int hemisphere =
m_id == 0 ? 1 : -1;
184 for(
int mphi = 0; mphi <= max_phi_it; mphi++) {
185 for(
int meta = 0; meta <= max_eta_it; meta++) {
212 std::tuple<int,bool> jTElow;
213 std::tuple<int,bool> jTEhigh;
231 ATH_MSG_DEBUG(
"================ Central Algorithms ================");
246 int TT_seed_ID[3][3]= {{0}};
247 int TT_First_ETring[36]= {0};
248 int First_ETring_it = 0;
250 int Jet_SearchWindow[7][7] = {{0}};
251 int Jet_SearchWindowDisplaced[7][7] = {{0}};
252 int largeRCluster_IDs[15][15]= {{0}};
255 for(
int i = -7;
i< 8;
i++ ) {
256 for(
int j = -7; j< 8; j++) {
258 if(std::abs(
i)<4 && std::abs(j)<4) {
305 std::unique_ptr<jFEXTOB> jJ_tob = std::make_unique<jFEXTOB>();
307 if ( SRJet_tobword != 0 ){
314 std::unique_ptr<jFEXTOB> jLJ_tob = std::make_unique<jFEXTOB>();
326 if ( is_tau_LocalMax ) {
334 std::unique_ptr<jFEXTOB> jTau_tob = std::make_unique<jFEXTOB>();
337 if ( jTau_tobword != 0 ){
370 std::unique_ptr<jFEXTOB> jJ_tob = std::make_unique<jFEXTOB>();
373 if ( SRFCAL_Jet_tobword != 0 ){
381 std::unique_ptr<jFEXTOB> jLJ_tob = std::make_unique<jFEXTOB>();
383 if ( LRFCAL_Jet_tobword != 0 )
m_LRJet_tobwords.push_back(std::move(jLJ_tob));
401 std::vector<int> Ciso;
402 std::vector<int> Chad1;
403 std::vector<int> Chad2;
417 Ciso.push_back(wp_loose.iso_fw());
418 Ciso.push_back(wp_medium.iso_fw());
419 Ciso.push_back(wp_tight.iso_fw());
420 Chad1.push_back(wp_loose.frac_fw());
421 Chad1.push_back(wp_medium.frac_fw());
422 Chad1.push_back(wp_tight.frac_fw());
423 Chad2.push_back(wp_loose.frac2_fw());
424 Chad2.push_back(wp_medium.frac2_fw());
425 Chad2.push_back(wp_tight.frac2_fw());
426 int Cval[9] = {Ciso[0], Ciso[1], Ciso[2], Chad1[0], Chad1[1], Chad1[2], Chad2[0], Chad2[1], Chad2[2]};
428 elCluster.
setup(Cval,jFEXETResolution);
435 std::vector<uint32_t> FwdEltob_aux{FwdEl_tobword,TTID};
436 if ( FwdEl_tobword != 0 && etEM>minEtThreshold)
m_FwdEl_tobwords.push_back(FwdEltob_aux);
455 for(
int j=4; j<17; j++) {
460 ATH_MSG_DEBUG(
"============================ jFEXtauAlgo ============================");
463 for(
int mphi = 8; mphi < 24; mphi++) {
464 for(
int meta = 8; meta < max_meta; meta++) {
466 bool is_tau_LocalMax =
m_jFEXtauAlgoTool->isSeedLocalMaxima_fwd(jTowersIDs[mphi][meta]);
469 if ( is_tau_LocalMax ) {
473 std::unique_ptr<jFEXTOB> jTau_tob = std::make_unique<jFEXTOB>();
475 if ( jTau_tobword != 0 ){
482 return StatusCode::SUCCESS;
488 const int cols =
sizeof tmp_jTowersIDs_subset[0] /
sizeof tmp_jTowersIDs_subset[0][0];
492 ATH_MSG_DEBUG(
"\n==== jFEXFPGA ========= FPGA (" <<
m_id <<
") [on jFEX " <<
m_jfexid <<
"] IS RESPONSIBLE FOR jTOWERS :");
494 for (
int thisRow=
rows-1; thisRow>=0; thisRow--){
495 for (
int thisCol=0; thisCol<
cols; thisCol++){
506 const int cols =
sizeof tmp_jTowersIDs_subset[0] /
sizeof tmp_jTowersIDs_subset[0][0];
511 ATH_MSG_DEBUG(
"\n==== jFEXFPGA ========= FPGA (" <<
m_id <<
") [on jFEX " <<
m_jfexid <<
"] IS RESPONSIBLE FOR jTOWERS :");
513 for (
int thisRow=
rows-1; thisRow>=0; thisRow--) {
514 for (
int thisCol=0; thisCol<
cols; thisCol++) {
515 if(thisCol !=
cols-1) {
529 std::vector<std::unique_ptr<jFEXTOB>> tobsSort;
534 tobsSort.push_back(std::move(j));
536 std::sort (tobsSort.begin(), tobsSort.end(), std::bind(
TOBetSort<std::unique_ptr<jFEXTOB>>, std::placeholders::_1, std::placeholders::_2,
FEXAlgoSpaceDefs::jJ_etBit, 0x7ff));
546 std::vector<std::unique_ptr<jFEXTOB>> tobsSort;
551 tobsSort.push_back(std::move(j));
553 std::sort (tobsSort.begin(), tobsSort.end(), std::bind(
TOBetSort<std::unique_ptr<jFEXTOB>>, std::placeholders::_1, std::placeholders::_2,
FEXAlgoSpaceDefs::jLJ_etBit, 0x1fff));
564 ATH_MSG_DEBUG(
"number of Forward Elec tobs: " << tobsSort.size() <<
" in FPGA: " <<
m_id<<
" before truncation");
566 std::sort (tobsSort.begin(), tobsSort.end(),
etFwdElSort);
575 std::vector<std::unique_ptr<jFEXTOB>> tobsSort;
580 tobsSort.push_back(std::move(j));
589 std::vector<std::unique_ptr<jFEXTOB>> tobsSort;
594 tobsSort.push_back(std::move(j));
605 std::vector<std::unique_ptr<jFEXTOB>> tobsSort;
610 tobsSort.push_back(std::move(j));
625 ATH_MSG_DEBUG(
"In jFEXFPGA::getTTowerET_EM, TTower ID not found in map: " << TTID );
638 ATH_MSG_DEBUG(
"In jFEXFPGA::getTTowerET_HAD, TTower ID not found in map: " << TTID );
660 ATH_MSG_DEBUG(
"In jFEXFPGA::getTTowerET_forMET (EM energy), TTower ID not found in map: " << TTID );
670 ATH_MSG_DEBUG(
"In jFEXFPGA::getTTowerET_forMET (HAD energy), TTower ID not found in map: " << TTID );
675 return tmp_EM + tmp_HAD;