57 ATH_CHECK(m_inputCellContainerKey.initialize());
58 ATH_CHECK(m_inputTileCellContainerKey.initialize(m_use_tileCells));
59 ATH_CHECK(m_inputTriggerTowerContainerKey.initialize(!m_use_tileCells));
61 ATH_CHECK(m_outputClusterName.initialize());
62 return StatusCode::SUCCESS;
67 if (inputCell ==
nullptr)
72 bool correctProv = (inputCell->
provenance() & m_qualBitMask);
77 float inputCell_energy = inputCell->
energy();
78 float inputCell_eta = inputCell->
eta();
79 float inputCell_ET = cosh(inputCell_eta) ? inputCell_energy / cosh(inputCell_eta) : inputCell_energy;
81 bool allowNegs =
false;
84 digitScale = std::abs(digitScale);
87 if (inputCell_ET == 0)
89 else if (digitScale == 0)
91 if (allowNegs || inputCell_ET > 0.)
94 float posOrNeg = inputCell_ET ? inputCell_ET / std::abs(inputCell_ET) : inputCell_ET;
95 inputCell_ET = std::abs(inputCell_ET);
99 if (inputCell_ET > digitThreshold)
100 return inputCell_ET * posOrNeg;
107 float divET = digitScale ? inputCell_ET / digitScale : inputCell_ET;
109 float result = digitScale * roundET;
110 if (digitThreshold == 0)
112 else if (
result >= digitThreshold)
128 if (!scellsHandle.isValid())
130 ATH_MSG_ERROR(
"Failed to retrieve " << m_inputCellContainerKey.key());
131 return StatusCode::FAILURE;
134 if (m_useProvenanceSkim)
136 for (
const CaloCell *scell : *scellsHandle)
137 if (scell->provenance() & m_qualBitMask)
141 scells.
assign(scellsHandle->begin(), scellsHandle->end());
147 auto tileCellHandle =
SG::makeHandle(m_inputTileCellContainerKey, ctx);
148 if (!tileCellHandle.isValid())
150 ATH_MSG_ERROR(
"Failed to retrieve " << m_inputTileCellContainerKey.key());
151 return StatusCode::FAILURE;
153 tileCellCont.
assign(tileCellHandle->begin(), tileCellHandle->end());
157 auto triggerTowerHandle =
SG::makeHandle(m_inputTriggerTowerContainerKey, ctx);
158 if (!triggerTowerHandle.isValid())
160 ATH_MSG_ERROR(
"Failed to retrieve " << m_inputTriggerTowerContainerKey.key());
161 return StatusCode::FAILURE;
163 TTs = triggerTowerHandle.cptr();
165 auto clustersForTau = std::make_unique<xAOD::EmTauRoIContainer>();
166 auto auxClustersForTau = std::make_unique<xAOD::EmTauRoIAuxContainer>();
167 clustersForTau->setStore(auxClustersForTau.get());
170 std::vector<const CaloCell *> allSuperCells(scells.
begin(), scells.
end());
173 TH2F supercellMapEM0(
"SupercellMapEM0",
"Supercell map of EM0", 98, -4.9, 4.9, 64, 0, 2 *
M_PI);
174 TH2F supercellMapEM1(
"SupercellMapEM1",
"Supercell map of EM1", 392, -4.9, 4.9, 64, 0, 2 *
M_PI);
175 TH2F supercellMapEM2(
"SupercellMapEM2",
"Supercell map of EM2", 392, -4.9, 4.9, 64, 0, 2 *
M_PI);
176 TH2F supercellMapEM1_coarse(
"SupercellMapEM1_coarse",
"Supercell map of EM1 coarse", 196, -4.9, 4.9, 64, 0, 2 *
M_PI);
177 TH2F supercellMapEM2_coarse(
"SupercellMapEM2_coarse",
"Supercell map of EM2 coarse", 196, -4.9, 4.9, 64, 0, 2 *
M_PI);
178 TH2F supercellMapEM3(
"SupercellMapEM3",
"Supercell map of EM3", 98, -4.9, 4.9, 64, 0, 2 *
M_PI);
179 TH2F supercellMapHAD(
"SupercellMapHAD",
"Supercell map of HAD", 98, -4.9, 4.9, 64, 0, 2 *
M_PI);
180 TH2F supercellMapTWR(
"SupercellMapTWR",
"Supercell map of TWR", 98, -4.9, 4.9, 64, 0, 2 *
M_PI);
182 int currentSampling = 0;
183 float currentEta = 0;
184 float currentPhi = 0;
185 float currentCellEt = 0;
188 for (
auto scell : allSuperCells)
190 currentSampling = scell->caloDDE()->getSampling();
191 currentEta = scell->eta();
192 currentPhi = TVector2::Phi_0_2pi(scell->phi());
193 currentCellEt = CaloCellET(scell, m_nominalDigitization, m_nominalNoise_thresh);
196 if (currentSampling == 0 || currentSampling == 4)
198 supercellMapEM0.Fill(currentEta, currentPhi, currentCellEt);
200 else if (currentSampling == 1 || currentSampling == 5)
202 supercellMapEM1.Fill(currentEta, currentPhi, currentCellEt);
203 supercellMapEM1_coarse.Fill(currentEta, currentPhi, currentCellEt);
205 else if (currentSampling == 2 || currentSampling == 6)
207 supercellMapEM2.Fill(currentEta, currentPhi, currentCellEt);
208 supercellMapEM2_coarse.Fill(currentEta, currentPhi, currentCellEt);
210 else if (currentSampling == 3 || currentSampling == 7)
212 supercellMapEM3.Fill(currentEta, currentPhi, currentCellEt);
216 supercellMapHAD.Fill(currentEta, currentPhi, currentCellEt);
220 supercellMapTWR.Fill(currentEta, currentPhi, currentCellEt);
228 if (
tt->sampling() != 1 || std::abs(
tt->eta()) > 1.5)
234 float cpET =
tt->cpET() * 500.;
241 supercellMapHAD.Fill(
tt->eta(), TVector2::Phi_0_2pi(
tt->phi()), cpET);
242 supercellMapTWR.Fill(
tt->eta(), TVector2::Phi_0_2pi(
tt->phi()), cpET);
246 std::vector<TLorentzVector> localMaxima;
247 localMaxima.reserve(200);
250 for (
int i = 0;
i < supercellMapTWR.GetNbinsX();
i++)
252 for (
int j = 0; j < supercellMapTWR.GetNbinsY(); j++)
255 double towerET = supercellMapTWR.GetBinContent(
i + 1, j + 1);
262 std::vector<double> binsAbove;
263 binsAbove.reserve(4);
264 std::vector<double> binsBelow;
265 binsBelow.reserve(4);
268 int aboveInPhi = j + 1;
269 if (j == supercellMapTWR.GetNbinsY() - 1)
271 int belowInPhi = j - 1;
273 belowInPhi = supercellMapTWR.GetNbinsY() - 1;
277 binsAbove.push_back(supercellMapTWR.GetBinContent(
i, aboveInPhi + 1));
278 binsAbove.push_back(supercellMapTWR.GetBinContent(
i + 1, aboveInPhi + 1));
279 binsAbove.push_back(supercellMapTWR.GetBinContent(
i + 2, aboveInPhi + 1));
280 binsAbove.push_back(supercellMapTWR.GetBinContent(
i + 2, j + 1));
283 binsBelow.push_back(supercellMapTWR.GetBinContent(
i, belowInPhi + 1));
284 binsBelow.push_back(supercellMapTWR.GetBinContent(
i + 1, belowInPhi + 1));
285 binsBelow.push_back(supercellMapTWR.GetBinContent(
i + 2, belowInPhi + 1));
286 binsBelow.push_back(supercellMapTWR.GetBinContent(
i, j + 1));
291 for (
unsigned int k = 0;
k < binsAbove.size();
k++)
293 if (towerET < binsAbove[
k])
296 for (
unsigned int k = 0;
k < binsBelow.size();
k++)
298 if (towerET <= binsBelow[
k])
304 TLorentzVector myMaximum;
305 myMaximum.SetPtEtaPhiM(towerET, supercellMapTWR.GetXaxis()->GetBinCenter(
i + 1), supercellMapTWR.GetYaxis()->GetBinCenter(j + 1), 0);
306 localMaxima.push_back(myMaximum);
313 for (
int i = 1;
i < supercellMapEM1_coarse.GetNbinsX() + 1;
i++)
315 for (
int j = 1; j < supercellMapEM1_coarse.GetNbinsY() + 1; j++)
317 ATH_MSG_DEBUG(
"supercellMapEM1_coarse.GetBinContent(" <<
i <<
"," << j <<
") " << supercellMapEM1_coarse.GetBinContent(
i, j));
318 ATH_MSG_DEBUG(
"supercellMapEM2_coarse.GetBinContent(" <<
i <<
"," << j <<
") " << supercellMapEM2_coarse.GetBinContent(
i, j));
319 ATH_MSG_DEBUG(
"supercellMapEM2_coarse.GetXaxis()->GetBinCenter(" <<
i <<
") " << supercellMapEM2_coarse.GetXaxis()->GetBinCenter(
i));
320 ATH_MSG_DEBUG(
"supercellMapEM2_coarse.GetYaxis()->GetBinCenter(" << j <<
") " << supercellMapEM2_coarse.GetYaxis()->GetBinCenter(j));
326 for (
auto myMaximum : localMaxima)
329 if (std::abs(myMaximum.Eta()) > 2.5)
335 int i = supercellMapTWR.GetXaxis()->FindFixBin(myMaximum.Eta());
337 int j = supercellMapTWR.GetYaxis()->FindFixBin(TVector2::Phi_0_2pi(myMaximum.Phi()));
339 int i_fine_start = ((
i - 1) * 4) + 1;
342 for (
unsigned int i_off_cand = 0; i_off_cand < 4; i_off_cand++)
344 int i_et = supercellMapEM2.GetBinContent(i_fine_start + i_off_cand, j);
348 i_offset = i_off_cand;
351 int i_fine = i_fine_start + i_offset;
354 int aboveInPhi = j + 1;
355 if (j == supercellMapTWR.GetNbinsY())
359 int belowInPhi = j - 1;
362 belowInPhi = supercellMapTWR.GetNbinsY();
367 std::vector<double> allET;
372 ET = supercellMapTWR.GetBinContent(
i, j);
373 ET += supercellMapTWR.GetBinContent(
i + 1, j);
374 ET += supercellMapTWR.GetBinContent(
i, aboveInPhi);
375 ET += supercellMapTWR.GetBinContent(
i + 1, aboveInPhi);
379 ET = supercellMapTWR.GetBinContent(
i, j);
380 ET += supercellMapTWR.GetBinContent(
i - 1, j);
381 ET += supercellMapTWR.GetBinContent(
i, aboveInPhi);
382 ET += supercellMapTWR.GetBinContent(
i - 1, aboveInPhi);
386 ET = supercellMapTWR.GetBinContent(
i, j);
387 ET += supercellMapTWR.GetBinContent(
i - 1, j);
388 ET += supercellMapTWR.GetBinContent(
i, belowInPhi);
389 ET += supercellMapTWR.GetBinContent(
i - 1, belowInPhi);
393 ET = supercellMapTWR.GetBinContent(
i, j);
394 ET += supercellMapTWR.GetBinContent(
i + 1, j);
395 ET += supercellMapTWR.GetBinContent(
i, belowInPhi);
396 ET += supercellMapTWR.GetBinContent(
i + 1, belowInPhi);
400 double eFEXOldCluster = 0;
401 for (
unsigned int k = 0;
k < allET.size();
k++)
403 if (allET.at(
k) > eFEXOldCluster)
404 eFEXOldCluster = allET.at(
k);
409 bool sumAboveInPhi =
true;
412 double abovePhiCellET = supercellMapEM2.GetBinContent(i_fine, aboveInPhi);
415 double belowPhiCellET = supercellMapEM2.GetBinContent(i_fine, belowInPhi);
418 if (belowPhiCellET > abovePhiCellET)
419 sumAboveInPhi =
false;
422 int offPhiCoordinate = sumAboveInPhi ? aboveInPhi : belowInPhi;
425 double em0OregonET = 0;
426 em0OregonET += supercellMapEM0.GetBinContent(
i, j);
427 em0OregonET += supercellMapEM0.GetBinContent(
i - 1, j);
428 em0OregonET += supercellMapEM0.GetBinContent(
i + 1, j);
429 em0OregonET += supercellMapEM0.GetBinContent(
i, offPhiCoordinate);
430 em0OregonET += supercellMapEM0.GetBinContent(
i - 1, offPhiCoordinate);
431 em0OregonET += supercellMapEM0.GetBinContent(
i + 1, offPhiCoordinate);
434 double em1OregonET = 0;
435 em1OregonET += supercellMapEM1.GetBinContent(i_fine, j);
436 em1OregonET += supercellMapEM1.GetBinContent(i_fine - 1, j);
437 em1OregonET += supercellMapEM1.GetBinContent(i_fine - 2, j);
438 em1OregonET += supercellMapEM1.GetBinContent(i_fine + 1, j);
439 em1OregonET += supercellMapEM1.GetBinContent(i_fine + 2, j);
440 em1OregonET += supercellMapEM1.GetBinContent(i_fine, offPhiCoordinate);
441 em1OregonET += supercellMapEM1.GetBinContent(i_fine - 1, offPhiCoordinate);
442 em1OregonET += supercellMapEM1.GetBinContent(i_fine - 2, offPhiCoordinate);
443 em1OregonET += supercellMapEM1.GetBinContent(i_fine + 1, offPhiCoordinate);
444 em1OregonET += supercellMapEM1.GetBinContent(i_fine + 2, offPhiCoordinate);
447 double em2OregonET = 0;
448 em2OregonET += supercellMapEM2.GetBinContent(i_fine, j);
449 em2OregonET += supercellMapEM2.GetBinContent(i_fine - 1, j);
450 em2OregonET += supercellMapEM2.GetBinContent(i_fine - 2, j);
451 em2OregonET += supercellMapEM2.GetBinContent(i_fine + 1, j);
452 em2OregonET += supercellMapEM2.GetBinContent(i_fine + 2, j);
453 em2OregonET += supercellMapEM2.GetBinContent(i_fine, offPhiCoordinate);
454 em2OregonET += supercellMapEM2.GetBinContent(i_fine - 1, offPhiCoordinate);
455 em2OregonET += supercellMapEM2.GetBinContent(i_fine - 2, offPhiCoordinate);
456 em2OregonET += supercellMapEM2.GetBinContent(i_fine + 1, offPhiCoordinate);
457 em2OregonET += supercellMapEM2.GetBinContent(i_fine + 2, offPhiCoordinate);
460 double em3OregonET = 0;
461 em3OregonET += supercellMapEM3.GetBinContent(
i, j);
462 em3OregonET += supercellMapEM3.GetBinContent(
i - 1, j);
463 em3OregonET += supercellMapEM3.GetBinContent(
i + 1, j);
464 em3OregonET += supercellMapEM3.GetBinContent(
i, offPhiCoordinate);
465 em3OregonET += supercellMapEM3.GetBinContent(
i - 1, offPhiCoordinate);
466 em3OregonET += supercellMapEM3.GetBinContent(
i + 1, offPhiCoordinate);
469 double hadOregonET = 0;
470 hadOregonET += supercellMapHAD.GetBinContent(
i, j);
471 hadOregonET += supercellMapHAD.GetBinContent(
i - 1, j);
472 hadOregonET += supercellMapHAD.GetBinContent(
i + 1, j);
473 hadOregonET += supercellMapHAD.GetBinContent(
i, offPhiCoordinate);
474 hadOregonET += supercellMapHAD.GetBinContent(
i - 1, offPhiCoordinate);
475 hadOregonET += supercellMapHAD.GetBinContent(
i + 1, offPhiCoordinate);
478 double eFEX_OregonET = em0OregonET + em1OregonET + em2OregonET + em3OregonET + hadOregonET;
482 double oreIsoInnerET = 0;
483 oreIsoInnerET += supercellMapEM2.GetBinContent(i_fine, j);
484 oreIsoInnerET += supercellMapEM2.GetBinContent(i_fine - 1, j);
485 oreIsoInnerET += supercellMapEM2.GetBinContent(i_fine + 1, j);
486 oreIsoInnerET += supercellMapEM2.GetBinContent(i_fine, offPhiCoordinate);
487 oreIsoInnerET += supercellMapEM2.GetBinContent(i_fine - 1, offPhiCoordinate);
488 oreIsoInnerET += supercellMapEM2.GetBinContent(i_fine + 1, offPhiCoordinate);
491 double oreIsoOuterET = oreIsoInnerET;
492 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine - 2, j);
493 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine - 3, j);
494 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine - 4, j);
495 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine + 2, j);
496 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine + 3, j);
497 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine + 4, j);
498 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine - 2, offPhiCoordinate);
499 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine - 3, offPhiCoordinate);
500 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine - 4, offPhiCoordinate);
501 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine + 2, offPhiCoordinate);
502 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine + 3, offPhiCoordinate);
503 oreIsoOuterET += supercellMapEM2.GetBinContent(i_fine + 4, offPhiCoordinate);
506 double eFEX_OregonIso = oreIsoOuterET ? oreIsoInnerET / oreIsoOuterET : oreIsoInnerET;
512 bool eFEX_OregonIso_12pass =
true;
513 if (10000. < eFEX_OregonET && 15000. > eFEX_OregonET && eFEX_OregonIso < 0.69)
515 eFEX_OregonIso_12pass =
false;
519 bool eFEX_OregonIso_20pass =
true;
520 if (20000. < eFEX_OregonET && 25000. > eFEX_OregonET && eFEX_OregonIso < 0.61)
522 eFEX_OregonIso_20pass =
false;
537 std::vector<double> E_EM0;
539 E_EM0.push_back(supercellMapEM0.GetBinContent(
i, j));
540 E_EM0.push_back(supercellMapEM0.GetBinContent(
i - 1, j));
541 E_EM0.push_back(supercellMapEM0.GetBinContent(
i - 1, aboveInPhi));
542 E_EM0.push_back(supercellMapEM0.GetBinContent(
i, aboveInPhi));
543 E_EM0.push_back(supercellMapEM0.GetBinContent(
i + 1, aboveInPhi));
544 E_EM0.push_back(supercellMapEM0.GetBinContent(
i + 1, j));
545 E_EM0.push_back(supercellMapEM0.GetBinContent(
i + 1, belowInPhi));
546 E_EM0.push_back(supercellMapEM0.GetBinContent(
i, belowInPhi));
547 E_EM0.push_back(supercellMapEM0.GetBinContent(
i - 1, belowInPhi));
548 std::vector<double> E_EM3;
550 E_EM3.push_back(supercellMapEM3.GetBinContent(
i, j));
551 E_EM3.push_back(supercellMapEM3.GetBinContent(
i - 1, j));
552 E_EM3.push_back(supercellMapEM3.GetBinContent(
i - 1, aboveInPhi));
553 E_EM3.push_back(supercellMapEM3.GetBinContent(
i, aboveInPhi));
554 E_EM3.push_back(supercellMapEM3.GetBinContent(
i + 1, aboveInPhi));
555 E_EM3.push_back(supercellMapEM3.GetBinContent(
i + 1, j));
556 E_EM3.push_back(supercellMapEM3.GetBinContent(
i + 1, belowInPhi));
557 E_EM3.push_back(supercellMapEM3.GetBinContent(
i, belowInPhi));
558 E_EM3.push_back(supercellMapEM3.GetBinContent(
i - 1, belowInPhi));
559 std::vector<double> E_HAD;
561 E_HAD.push_back(supercellMapHAD.GetBinContent(
i, j));
562 E_HAD.push_back(supercellMapHAD.GetBinContent(
i - 1, j));
563 E_HAD.push_back(supercellMapHAD.GetBinContent(
i - 1, aboveInPhi));
564 E_HAD.push_back(supercellMapHAD.GetBinContent(
i, aboveInPhi));
565 E_HAD.push_back(supercellMapHAD.GetBinContent(
i + 1, aboveInPhi));
566 E_HAD.push_back(supercellMapHAD.GetBinContent(
i + 1, j));
567 E_HAD.push_back(supercellMapHAD.GetBinContent(
i + 1, belowInPhi));
568 E_HAD.push_back(supercellMapHAD.GetBinContent(
i, belowInPhi));
569 E_HAD.push_back(supercellMapHAD.GetBinContent(
i - 1, belowInPhi));
570 std::vector<double> E_EM12_central;
571 E_EM12_central.reserve(5);
572 std::vector<double> E_EM12_above;
573 E_EM12_above.reserve(6);
574 std::vector<double> E_EM12_below;
575 E_EM12_below.reserve(6);
576 float seedEta = supercellMapTWR.GetXaxis()->GetBinCenter(
i);
577 int EM2seedBin = supercellMapEM2_coarse.GetXaxis()->FindBin(seedEta - 0.025);
580 E_EM12_central.push_back(supercellMapEM2_coarse.GetBinContent(EM2seedBin - 2, j) + supercellMapEM2_coarse.GetBinContent(EM2seedBin - 1, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin - 2, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin - 1, j));
581 E_EM12_central.push_back(supercellMapEM2_coarse.GetBinContent(EM2seedBin - 1, j) + supercellMapEM2_coarse.GetBinContent(EM2seedBin - 0, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin - 1, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin - 0, j));
582 E_EM12_central.push_back(supercellMapEM2_coarse.GetBinContent(EM2seedBin - 0, j) + supercellMapEM2_coarse.GetBinContent(EM2seedBin + 1, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin - 0, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin + 1, j));
583 E_EM12_central.push_back(supercellMapEM2_coarse.GetBinContent(EM2seedBin + 1, j) + supercellMapEM2_coarse.GetBinContent(EM2seedBin + 2, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin + 1, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin + 2, j));
584 E_EM12_central.push_back(supercellMapEM2_coarse.GetBinContent(EM2seedBin + 2, j) + supercellMapEM2_coarse.GetBinContent(EM2seedBin + 3, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin + 2, j) + supercellMapEM1_coarse.GetBinContent(EM2seedBin + 3, j));
586 for (
int k = -2;
k <= 3;
k++)
588 E_EM12_above.push_back(supercellMapEM2_coarse.GetBinContent(EM2seedBin +
k, aboveInPhi) + supercellMapEM1_coarse.GetBinContent(EM2seedBin +
k, aboveInPhi));
589 E_EM12_below.push_back(supercellMapEM2_coarse.GetBinContent(EM2seedBin +
k, belowInPhi) + supercellMapEM1_coarse.GetBinContent(EM2seedBin +
k, belowInPhi));
592 sort(E_EM0.begin(), E_EM0.end());
593 sort(E_EM3.begin(), E_EM3.end());
594 sort(E_HAD.begin(), E_HAD.end());
595 sort(E_EM12_central.begin(), E_EM12_central.end());
596 sort(E_EM12_above.begin(), E_EM12_above.end());
597 sort(E_EM12_below.begin(), E_EM12_below.end());
602 eFEX_BC = E_EM0.at(E_EM0.size() - 1) + E_EM0.at(E_EM0.size() - 2) + E_EM0.at(E_EM0.size() - 3);
604 eFEX_BC += E_EM3.at(E_EM3.size() - 1) + E_EM3.at(E_EM3.size() - 2);
606 eFEX_BC += E_HAD.at(E_HAD.size() - 1) + E_HAD.at(E_HAD.size() - 2) + E_HAD.at(E_HAD.size() - 3);
607 eFEX_BC += E_EM12_central.at(E_EM12_central.size() - 1);
608 eFEX_BC += E_EM12_above.at(E_EM12_above.size() - 1);
609 eFEX_BC += E_EM12_below.at(E_EM12_below.size() - 1);
612 float nomeFEX_BCiso = 0;
613 nomeFEX_BCiso += E_EM12_central.at(E_EM12_central.size() - 1);
614 nomeFEX_BCiso += E_EM12_above.at(E_EM12_above.size() - 1);
615 nomeFEX_BCiso += E_EM12_below.at(E_EM12_below.size() - 1);
616 nomeFEX_BCiso += E_EM0.at(E_EM0.size() - 1);
617 nomeFEX_BCiso += E_EM0.at(E_EM0.size() - 2);
618 nomeFEX_BCiso += E_EM0.at(E_EM0.size() - 3);
619 nomeFEX_BCiso += E_EM3.at(E_EM3.size() - 1);
620 nomeFEX_BCiso += E_EM3.at(E_EM3.size() - 2);
623 denBCiso += supercellMapTWR.GetBinContent(
i, j);
624 denBCiso += supercellMapTWR.GetBinContent(
i - 1, j);
625 denBCiso += supercellMapTWR.GetBinContent(
i + 1, j);
626 denBCiso += supercellMapTWR.GetBinContent(
i, j + 1);
627 denBCiso += supercellMapTWR.GetBinContent(
i - 1, j + 1);
628 denBCiso += supercellMapTWR.GetBinContent(
i + 1, j + 1);
629 denBCiso += supercellMapTWR.GetBinContent(
i, j - 1);
630 denBCiso += supercellMapTWR.GetBinContent(
i - 1, j - 1);
631 denBCiso += supercellMapTWR.GetBinContent(
i + 1, j - 1);
633 float eFEX_BCiso = denBCiso ? nomeFEX_BCiso / denBCiso : nomeFEX_BCiso;
636 bool eFEX_BCiso_12pass =
true;
637 if (10000. < eFEX_BC && 15000. > eFEX_BC && eFEX_BCiso < 0.38)
639 eFEX_BCiso_12pass =
false;
643 bool eFEX_BCiso_20pass =
true;
644 if (20000. < eFEX_BC && 25000. > eFEX_BC && eFEX_BCiso < 0.18)
646 eFEX_BCiso_20pass =
false;
651 int em2i = supercellMapEM2.GetXaxis()->FindFixBin(myMaximum.Eta() + 0.05);
653 int em2j = supercellMapEM2.GetYaxis()->FindFixBin(TVector2::Phi_0_2pi(myMaximum.Phi()));
655 float maximumET = supercellMapEM2.GetBinContent(em2i, em2j);
656 int maximumCell = em2i;
659 for (
int k = -2;
k < 2;
k++)
661 float ETvalue = supercellMapEM2.GetBinContent(em2i +
k, em2j);
662 if (ETvalue > maximumET)
665 maximumCell = em2i +
k;
671 float nextET = supercellMapEM2.GetBinContent(maximumCell + 1, em2j);
672 nextET = ((supercellMapEM2.GetBinContent(maximumCell - 1, em2j) > nextET) ? supercellMapEM2.GetBinContent(maximumCell - 1, em2j) : nextET);
673 nextET = ((supercellMapEM2.GetBinContent(maximumCell, em2j + 1) > nextET) ? supercellMapEM2.GetBinContent(maximumCell, em2j + 1) : nextET);
674 nextET = ((supercellMapEM2.GetBinContent(maximumCell, em2j - 1) > nextET) ? supercellMapEM2.GetBinContent(maximumCell, em2j - 1) : nextET);
676 float numerator = maximumET + nextET;
680 float phicenter = supercellMapEM2.GetYaxis()->GetBinCenter(em2j);
681 for (
int eta = -6; eta < 6; eta++)
682 for (
int phi = -1; phi < 2; phi++)
683 denominator += supercellMapEM2.GetBinContent(em2i + eta, supercellMapEM2.GetYaxis()->FindFixBin(TVector2::Phi_0_2pi(phicenter + (phi * 0.1))));
688 clustersForTau->push_back(clForTau);
689 clForTau->
setEta(myMaximum.Eta());
690 clForTau->
setPhi(myMaximum.Phi());
692 decR3ClusterET(*clForTau) = eFEXOldCluster;
693 decR3OreClusterET(*clForTau) = eFEX_OregonET;
694 decR3BCClusterET(*clForTau) = eFEX_BC;
695 decR3BCClusterIso(*clForTau) = denBCiso > 0 ? eFEX_BCiso : 0;
696 decR3OreClusterIso(*clForTau) = oreIsoOuterET > 0 ? eFEX_OregonIso : 0;
698 decR3OreIsoPass12(*clForTau) = eFEX_OregonIso_12pass;
699 decR3OreIsoPass20(*clForTau) = eFEX_OregonIso_20pass;
700 decR3BCIsoPass12(*clForTau) = eFEX_BCiso_12pass;
701 decR3BCIsoPass20(*clForTau) = eFEX_BCiso_20pass;
706 ATH_CHECK(writeHandle.record(std::move(clustersForTau), std::move(auxClustersForTau)));
707 return StatusCode::SUCCESS;