ATLAS Offline Software
egammaSuperClusterBuilderBase.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
10 
15 #include "xAODEgamma/EgammaEnums.h"
19 #include "xAODTracking/Vertex.h"
20 
21 #include "CaloGeoHelpers/proxim.h"
22 #include "FourMomUtils/P4Helpers.h"
23 
24 #include <cmath>
25 #include <optional>
26 #include <utility>
27 
29 
30 namespace {
48 std::pair<const double, const double>
49 etaphi_range(const CaloDetDescrManager& dd_man,
50  double eta,
51  double phi,
52  CaloCell_ID::CaloSample sampling,
53  const CaloDetDescrElement* elt)
54 {
55  // Should be smaller than the eta half-width of any cell.
56  constexpr double eps = 0.001;
57 
58  // Now look in the negative eta direction, on the low (left) side.
59  const CaloDetDescrElement* elt_l = dd_man.get_element_raw(sampling, eta - elt->deta() - eps, phi);
60  double deta_l = elt_l ? std::abs(eta - elt_l->eta_raw()) + eps : 0.;
61 
62  // Now look in the positive eta direction, on the high (right) side.
63  const CaloDetDescrElement* elt_r = dd_man.get_element_raw(sampling, eta + elt->deta() + eps, phi);
64  double deta_r = elt_r ? std::abs(eta - elt_r->eta_raw()) + eps : 0.;
65 
66  // Now for the phi variation.
67  // The phi size can change as a function of eta, but not of phi.
68  // Thus we have to look again at the adjacent eta cells, and
69  // take the largest variation.
70 
71  // Now look in the negative eta direction, on the low-eta () side.
72  elt_l = dd_man.get_element_raw(sampling, eta - elt->deta() - eps, CaloPhiRange::fix(phi - elt->dphi() - eps));
73  double dphi_l = elt_l ? std::abs(CaloPhiRange::fix(phi - elt_l->phi_raw())) + eps : 0.;
74 
75  // Now look in the positive eta direction, on the positive (down) side.
76  elt_r = dd_man.get_element_raw(sampling, eta + elt->deta() + eps, CaloPhiRange::fix(phi - elt->dphi() - eps));
77  double dphi_r = elt_r ? std::abs(CaloPhiRange::fix(phi - elt_r->phi_raw())) + eps : 0.;
78 
79  // Total is twice the maximum.
80  return {2 * std::max(deta_r, deta_l), 2 * std::max(dphi_l, dphi_r)};
81 }
82 
93 void
94 fillPositionsInCalo(xAOD::CaloCluster* cluster, const CaloDetDescrManager& mgr)
95 {
96  const bool isBarrel = xAOD::EgammaHelpers::isBarrel(cluster);
99  // eta and phi of the cluster in the calorimeter frame
100  double eta;
101  double phi;
103  mgr, sample, cluster->eta(), cluster->phi(), eta, phi);
106  // eta in the second sampling
108  mgr, sample, cluster->etaBE(2), cluster->phiBE(2), eta, phi);
111  // eta in the first sampling
114  mgr, sample, cluster->etaBE(1), cluster->phiBE(1), eta, phi);
117 }
119 void
120 makeCorrection1(xAOD::CaloCluster* cluster,
121  const CaloDetDescrManager& mgr,
123 {
124  const double clusterEtaMax = cluster->etamax(sample);
125  const double clusterPhiMax = cluster->phimax(sample);
126 
127  // Protections.
128  if (clusterEtaMax == -999. || clusterPhiMax == -999.) {
129  return;
130  }
131  if (std::abs(clusterEtaMax) < 1E-6 && std::abs(clusterPhiMax) < 1E-6) {
132  return;
133  }
134 
135  // Get the hottest in raw co-ordinates
136  // We have two kinds of enums ...
137  const CaloCell_ID::CaloSample xsample =
139 
140  const CaloDetDescrElement* dde = mgr.get_element(xsample,
141  clusterEtaMax,
142  clusterPhiMax);
143 
144  if (!dde) {
145  return;
146  }
147 
148  double etamax = dde->eta_raw();
149  double phimax = dde->phi_raw();
150 
151  const CaloDetDescrElement* elt = mgr.get_element_raw(xsample, etamax, phimax);
152  if (!elt) {
153  return;
154  }
155 
156  // Now Locate the +-1 range, use raw co-ordinates here.
157  auto [detastr, dphistr] = etaphi_range(mgr, etamax, phimax, xsample, elt);
158 
159  // Given the range refine the position employing the smaller window
160  if (detastr > 0 && dphistr > 0) {
162  const auto* const cellLink = cluster->getCellLinks();
163  helper.fill(cellLink->begin(),
164  cellLink->end(),
165  etamax,
166  phimax,
167  detastr,
168  dphistr,
169  sample);
170 
171  // Here is where we (re-)fill the eta in the 1st sampling
172  if (helper.etam() != -999.) {
173  // This is "real" atlas co-ordinates
174  cluster->setEta(sample, helper.etam());
175  }
176  }
177 }
178 
180 void
181 refineEta1Position(xAOD::CaloCluster* cluster, const CaloDetDescrManager& mgr)
182 {
183  // This only makes sense if we have cells there
184  if (!cluster->hasSampling(CaloSampling::EMB1) &&
185  !cluster->hasSampling(CaloSampling::EME1)) {
186  return;
187  }
188  // Now calculare the position using cells in barrel or endcap or both
189  const double aeta = std::abs(cluster->etaBE(2));
190  if (aeta < 1.6 && cluster->hasSampling(CaloSampling::EMB1)) {
191  makeCorrection1(cluster, mgr, CaloSampling::EMB1);
192  }
193  if (aeta > 1.3 && cluster->hasSampling(CaloSampling::EME1)) {
194  makeCorrection1(cluster, mgr, CaloSampling::EME1);
195  }
196 }
197 
198 } // end of anonymous namespace
199 
200 /*
201  * Gaudi Algorithm implementation
202  */
204  const std::string& name,
205  ISvcLocator* pSvcLocator)
206  : AthReentrantAlgorithm(name, pSvcLocator)
207 {
208 }
209 
212 {
218 
223  // The +- to account for the different L3 eta granularity
225  // the + is to account for different L0/L1 phi granularity
227 
232 
233  if (m_addCellsWindowEtaCellsBarrel % 2 == 0 ||
235  ATH_MSG_FATAL("For adding cells relative to the hottest cell to be "
236  "symmetric in eta, the AddCells "
237  "window size needs to be odd");
238 
239  return StatusCode::FAILURE;
240  }
242  ATH_CHECK(m_MVACalibSvc.retrieve());
243 
244  if (!m_egammaCheckEnergyDepositTool.empty()) {
246  } else {
248  }
249  if (!m_egammaCellRecoveryTool.empty()) {
251  } else {
252  m_egammaCellRecoveryTool.disable();
253  }
254 
255  ATH_MSG_INFO("e/gamma super clusters"
256  << '\n'
257  << "--> Eta Window size for L0/L1/L2 cells : "
258  << " Barrel +- " << m_addCellsWindowEtaBarrel << " ,EndCap +- "
259  << m_addCellsWindowEtaEndcap << '\n'
260  << "--> Eta Window size for L3 cells : "
261  << " Barrel +- "
263  << " ,EndCap +- "
265  << " -> Phi window is fully dynamic for L2/L3" << '\n'
266  << " -> L0/L1 cells in phi will be collected in a Window : "
267  << "(L2 neg extend - " << m_extraL0L1PhiSize << " , "
268  << "L2 pos extend + " << m_extraL0L1PhiSize << ")");
269 
270  return StatusCode::SUCCESS;
271 }
272 
274 egammaSuperClusterBuilderBase::execute(const EventContext& ctx) const
275 {
277  ctx);
278  // check is only used for serial running; remove when MT scheduler used
279  ATH_CHECK(egammaRecs.isValid());
280 
281  // Have to register cluster container in order to properly get cluster
282  // links.
283  SG::WriteHandle<xAOD::CaloClusterContainer> outputClusterContainer(
285 
287 
288  // Create the new Electron Super Cluster based EgammaRecContainer
291  ATH_CHECK(newEgammaRecs.record(std::make_unique<EgammaRecContainer>()));
292 
293  size_t inputSize = egammaRecs->size();
294  outputClusterContainer->reserve(inputSize);
295  newEgammaRecs->reserve(inputSize);
296 
297  std::optional<SG::WriteHandle<xAOD::CaloClusterContainer>> precorrClustersH;
298  if (!m_precorrClustersKey.empty()) {
299  precorrClustersH.emplace(m_precorrClustersKey, ctx);
301  precorrClustersH->ptr()->reserve(inputSize);
302  }
303 
304  // The calo Det Descr manager
305  SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle{
307  };
308  ATH_CHECK(caloDetDescrMgrHandle.isValid());
309  const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
310 
311  // If no input return
312  if (egammaRecs->empty()) {
313  return StatusCode::SUCCESS;
314  }
315 
316  // Figure the cellCont we need to point to
317  const DataLink<CaloCellContainer>& cellCont =
318  (*egammaRecs)[0]->caloCluster()->getCellLinks()->getCellContainerLink();
319 
320  // Loop over input egammaRec objects, build superclusters.
321  size_t numInput = egammaRecs->size();
322  std::vector<bool> isUsed(numInput, false);
323  std::vector<bool> isUsedRevert(numInput, false);
324 
325  for (std::size_t i = 0; i < egammaRecs->size(); ++i) {
326  if (isUsed[i]) {
327  continue;
328  }
329  const auto* egRec = (*egammaRecs)[i];
330  // check for good seed cluster
331  const xAOD::CaloCluster* clus = egRec->caloCluster();
332  if (!seedClusterSelection(clus)) {
333  continue;
334  }
335 
336  if (!egammaRecPassesSelection(egRec)) {
337  continue;
338  }
339 
340  // save status in case we fail to create supercluster
341  isUsedRevert = isUsed;
342  // Mark seed as used,
343  isUsed[i] = true;
344 
345  // Start accumulating the clusters from the seed
346  std::vector<const xAOD::CaloCluster*> accumulatedClusters;
347  accumulatedClusters.push_back(clus);
348 
349  // Now we find all the secondary cluster for this seed
350  // and we accumulate them
351  const std::vector<std::size_t> secondaryIndices =
352  searchForSecondaryClusters(i, egammaRecs.cptr(), isUsed);
353  for (const auto& secClusIndex : secondaryIndices) {
354  const auto* const secRec = (*egammaRecs)[secClusIndex];
355  accumulatedClusters.push_back(secRec->caloCluster());
356  }
357  ATH_MSG_DEBUG("Total clusters " << accumulatedClusters.size());
358 
359  // Create the new cluster
360  std::unique_ptr<xAOD::CaloCluster> newCluster =
361  createNewCluster(ctx,
362  accumulatedClusters,
363  cellCont,
364  *calodetdescrmgr,
365  getEgammaRecType(egRec),
366  precorrClustersH ? precorrClustersH->ptr() : nullptr);
367 
368  // If we failed to create a cluster revert isUsed for the cluster
369  if (newCluster) {
370  outputClusterContainer->push_back(std::move(newCluster));
371  }
372  else {
373  isUsed.swap(isUsedRevert);
374  continue;
375  }
376 
377  // Add the cluster links to the super cluster
379  *outputClusterContainer, outputClusterContainer->size() - 1, ctx);
380  std::vector<ElementLink<xAOD::CaloClusterContainer>> elClusters{
381  clusterLink
382  };
383 
384  // Make egammaRec object, and push it back into output container.
385  auto newEgRec = std::make_unique<egammaRec>(*egRec);
386  newEgRec->setCaloClusters(elClusters);
387  newEgammaRecs->push_back(std::move(newEgRec));
388  } // End loop on egammaRecs
389 
390  ATH_CHECK(redoMatching(ctx, newEgammaRecs));
391 
392  return StatusCode::SUCCESS;
393 }
394 
395 bool
397  return true;
398 }
399 
400 StatusCode
402  [[maybe_unused]] const EventContext &ctx,
403  [[maybe_unused]] SG::WriteHandle<EgammaRecContainer> &newEgammaRecs
404 ) const {
405  return StatusCode::SUCCESS;
406 }
407 
408 bool
410  const xAOD::CaloCluster* ref,
411  const xAOD::CaloCluster* clus) const
412 {
413  auto inRange = [](float eta1, float phi1,
414  float eta2, float phi2,
415  float etaWindow, float phiWindow) {
416 
417  const float dEta = std::abs(eta1 - eta2);
418  const float dPhi = std::abs(P4Helpers::deltaPhi(phi1, phi2));
419 
420  return dEta < etaWindow && dPhi < phiWindow;
421  };
422 
423  // First the case where the seed is both endcap and barrel, i.e. in the crack
424  // Check around both measurements of the seed
425  if (ref->hasSampling(CaloSampling::EMB2) &&
426  ref->hasSampling(CaloSampling::EME2)) {
427  const bool inRangeBarrel = inRange(ref->eta(),
428  ref->phi(),
429  clus->eta(),
430  clus->phi(),
433 
434  const bool inRangeEndcap = inRange(ref->eta(),
435  ref->phi(),
436  clus->eta(),
437  clus->phi(),
440 
441  const bool inRangeBarrelL2 = inRange(ref->etaSample(CaloSampling::EMB2),
442  ref->phiSample(CaloSampling::EMB2),
443  clus->eta(),
444  clus->phi(),
447 
448  const bool inRangeEndcapL2 = inRange(ref->etaSample(CaloSampling::EME2),
449  ref->phiSample(CaloSampling::EME2),
450  clus->eta(),
451  clus->phi(),
454 
455  // Matches any in case of split
456  return inRangeBarrel || inRangeEndcap || inRangeBarrelL2 || inRangeEndcapL2;
457  }
458 
459  if (xAOD::EgammaHelpers::isBarrel(clus)) {
460  return inRange(ref->eta(),
461  ref->phi(),
462  clus->eta(),
463  clus->phi(),
466  }
467 
468  return inRange(ref->eta(),
469  ref->phi(),
470  clus->eta(),
471  clus->phi(),
474 }
475 
476 std::unique_ptr<xAOD::CaloCluster>
478  const EventContext& ctx,
479  const std::vector<const xAOD::CaloCluster*>& clusters,
480  const DataLink<CaloCellContainer>& cellCont,
481  const CaloDetDescrManager& mgr,
483  xAOD::CaloClusterContainer* precorrClusters) const
484 {
485  if (clusters.empty()) {
486  ATH_MSG_ERROR("Missing the seed cluster! Should not happen.");
487  return nullptr;
488  }
489 
490  // create a new empty cluster
491  // collection will own it if
492  auto newCluster = CaloClusterStoreHelper::makeCluster(cellCont);
493 
494  if (!newCluster) {
495  ATH_MSG_ERROR("CaloClusterStoreHelper::makeCluster failed.");
496  return nullptr;
497  }
498  //
499  newCluster->setClusterSize(xAOD::CaloCluster::SuperCluster);
500  // Let's try to find the eta and phi of the hottest cell in L2.
501  // This will be used as the center for restricting the cluster size.
503 
504  // Set the eta0/phi0 based on the references, but in raw coordinates
505  if (cp0.emaxB >= cp0.emaxEC) {
506  newCluster->setEta0(cp0.etaB);
507  newCluster->setPhi0(cp0.phiB);
508  } else {
509  newCluster->setEta0(cp0.etaEC);
510  newCluster->setPhi0(cp0.phiEC);
511  }
512 
513  // Actually fill the cluster here
514  if (fillClusterConstrained(*newCluster, clusters, cp0).isFailure()) {
515  return nullptr;
516  }
517  // Apply SW-style summation of TileGap3 cells (if necessary).
518  float eta0 = std::abs(newCluster->eta0());
519  // In Run2, we did not impose restriction to include TG3 cells at this level.
520  // It should have been [1.37,1.63]. It has no impact on performance as TG3 was
521  // only used in energy calibration BDT in [1.4,1.6].
522  // In Run three we restrict to [1.37,1.75]
523  if (!m_useExtendedTG3 ||
524  (eta0 > s_ClEtaMinForTG3cell && eta0 < s_ClEtaMaxForTG3cell)) {
525  if (addTileGap3CellsinWindow(*newCluster, mgr).isFailure()) {
526  ATH_MSG_ERROR("Problem with the input cluster when running "
527  "AddTileGap3CellsinWindow?");
528 
529  return nullptr;
530  }
531  }
533  CaloClusterKineHelper::calculateKine(newCluster.get(), true, true);
534 
535  // If adding all EM cells we are somehow below the seed threshold then remove
536  if (newCluster->et() < m_EtThresholdCut) {
537  return nullptr;
538  }
539 
540  // Check to see if cluster pases basic requirements. If not, kill it.
541  if (!m_egammaCheckEnergyDepositTool.empty() &&
542  !m_egammaCheckEnergyDepositTool->checkFractioninSamplingCluster(
543  newCluster.get())) {
544  return nullptr;
545  }
546 
547  // Apply correction calibration
548  if (calibrateCluster(ctx, newCluster.get(), mgr, egType, precorrClusters)
549  .isFailure()) {
550  ATH_MSG_WARNING("There was problem calibrating the object");
551  return nullptr;
552  }
553 
554  // Avoid negative energy clusters
555  if (newCluster->et() < 0) {
556  return nullptr;
557  }
558 
559  if (m_linkToConstituents) {
560  // EDM vector to constituent clusters
561  std::vector<ElementLink<xAOD::CaloClusterContainer>> constituentLinks;
562  for (const xAOD::CaloCluster* cluster : clusters) {
564  cluster->getSisterClusterLink();
565 
566  // Set the element Link to the constitents
567  if (sisterCluster) {
568  constituentLinks.push_back(sisterCluster);
569  } else {
570  ATH_MSG_WARNING("No sister Link available");
571  }
572  }
573  // Set the link from the super cluster to the constituents (accumulated)
574  // clusters used.
575  static const SG::AuxElement::Accessor<
576  std::vector<ElementLink<xAOD::CaloClusterContainer>>>
577  caloClusterLinks("constituentClusterLinks");
578  caloClusterLinks(*newCluster) = constituentLinks;
579  }
580  // return the new cluster
581  return newCluster;
582 }
583 
584 bool
586  const xAOD::CaloCluster* clus) const
587 {
588  // The seed should have 2nd sampling
589  if (!clus->hasSampling(CaloSampling::EMB2) &&
591  return false;
592  }
593  const double eta2 = std::abs(clus->etaBE(2));
594  if (eta2 > 10) {
595  return false;
596  }
597  // Accordeon Energy samplings 1 to 3
598  const double EMAccEnergy =
599  clus->energyBE(1) + clus->energyBE(2) + clus->energyBE(3);
600  const double EMAccEt = EMAccEnergy / cosh(eta2);
601  // Require minimum energy for supercluster seeding.
602  return EMAccEt >= m_EtThresholdCut;
603 }
604 
607  xAOD::CaloCluster& tofill,
608  const std::vector<const xAOD::CaloCluster*>& clusters,
609  const CookieCutterHelpers::CentralPosition& cp0) const
610 {
611  const float addCellsWindowEtaBarrel = m_addCellsWindowEtaBarrel;
612  const float addCellsWindowEtaEndcap = m_addCellsWindowEtaEndcap;
613  const float addCellsWindowL3EtaBarrel =
615  const float addCellsWindowL3EtaEndcap =
617 
618  // Loop for L2/L3
619  for (const xAOD::CaloCluster* tocheck : clusters) {
620  xAOD::CaloCluster::const_cell_iterator cell_itr = tocheck->begin();
621  xAOD::CaloCluster::const_cell_iterator cell_end = tocheck->end();
622  // Loop over cells
623  for (; cell_itr != cell_end; ++cell_itr) {
624  // sanity check on the cell
625  const CaloCell* cell = *cell_itr;
626  if (!cell) {
627  continue;
628  }
629  const CaloDetDescrElement* dde = cell->caloDDE();
630  if (!dde) {
631  continue;
632  }
633  // we want only LAREM
634  if (!(dde->getSubCalo() == CaloCell_ID::LAREM)) {
635  continue;
636  }
637  // we want L2 or L3 cells
638  const auto sampling = dde->getSampling();
639  const bool isL2Cell =
640  (CaloCell_ID::EMB2 == sampling || CaloCell_ID::EME2 == sampling);
641  const bool isL3Cell =
642  (CaloCell_ID::EMB3 == sampling || CaloCell_ID::EME3 == sampling);
643 
644  if ((!isL2Cell) && (!isL3Cell)) {
645  continue;
646  }
647  // Also exclude the inner wheel Endcap
648  if (dde->is_lar_em_endcap_inner()) {
649  continue;
650  }
651 
652  bool inEtaRange = false;
653  // Check if is inside the eta range wrt to the hottest
654  // cell(s) for the cluster we construct
655  if (cp0.emaxB > 0) { // barrel
656  if (isL2Cell &&
657  (std::abs(cp0.etaB - dde->eta_raw()) < addCellsWindowEtaBarrel)) {
658  inEtaRange = true;
659  }
660  if (isL3Cell &&
661  (std::abs(cp0.etaB - dde->eta_raw()) < addCellsWindowL3EtaBarrel)) {
662  inEtaRange = true;
663  }
664  }
665  if (cp0.emaxEC > 0) { // endcap
666  if (isL2Cell &&
667  (std::abs(cp0.etaEC - dde->eta_raw()) < addCellsWindowEtaEndcap)) {
668  inEtaRange = true;
669  }
670  if (isL3Cell && (std::abs(cp0.etaEC - dde->eta_raw()) <
671  addCellsWindowL3EtaEndcap)) {
672  inEtaRange = true;
673  }
674  }
675  if (!inEtaRange) {
676  continue;
677  }
678  tofill.addCell(cell_itr.index(), cell_itr.weight());
679  } // Loop over cells for L2/L3
680  } // Loop over clusters for L2/L3
681 
682  // We should have a size here
683  if (tofill.size() == 0) {
684  return StatusCode::FAILURE;
685  }
686  // Now calculate the cluster size in 2nd layer
687  // use that for constraining the L0/L1 cells we add
688  const CookieCutterHelpers::PhiSize phiSize(cp0, tofill);
689  const float phiPlusB = cp0.phiB + phiSize.plusB + m_extraL0L1PhiSize;
690  const float phiMinusB = cp0.phiB - phiSize.minusB - m_extraL0L1PhiSize;
691  const float phiPlusEC = cp0.phiEC + phiSize.plusEC + m_extraL0L1PhiSize;
692  const float phiMinusEC = cp0.phiEC - phiSize.minusEC - m_extraL0L1PhiSize;
693 
694  // Loop for L0/L1
695  for (const xAOD::CaloCluster* tocheck : clusters) {
696  xAOD::CaloCluster::const_cell_iterator cell_itr = tocheck->begin();
697  xAOD::CaloCluster::const_cell_iterator cell_end = tocheck->end();
698  // Loop over cells
699  for (; cell_itr != cell_end; ++cell_itr) {
700  // sanity check on the cell
701  const CaloCell* cell = *cell_itr;
702  if (!cell) {
703  continue;
704  }
705  const CaloDetDescrElement* dde = cell->caloDDE();
706  if (!dde) {
707  continue;
708  }
709 
710  // only deal with L1 or PS
711  const auto sampling = dde->getSampling();
712  const bool isL0L1Cell =
713  (CaloCell_ID::EMB1 == sampling || CaloCell_ID::EME1 == sampling ||
714  CaloCell_ID::PreSamplerB == sampling ||
715  CaloCell_ID::PreSamplerE == sampling);
716  if (!isL0L1Cell) {
717  continue;
718  }
719 
720  bool inEtaRange = false;
721  // Check if is inside the eta range wrt to the hottest
722  // cell(s) for the cluster we construct
723  if (cp0.emaxB > 0) { // barrel
724  if (std::abs(cp0.etaB - dde->eta_raw()) < addCellsWindowEtaBarrel) {
725  inEtaRange = true;
726  }
727  }
728  if (cp0.emaxEC > 0) { // endcap
729  if (std::abs(cp0.etaEC - dde->eta_raw()) < addCellsWindowEtaEndcap) {
730  inEtaRange = true;
731  }
732  }
733  if (!inEtaRange) {
734  continue;
735  }
736 
737  // Add L0/L1 when we are in the narrow range
738  bool inPhiRange = false;
739  if (cp0.emaxB > 0) { // barrel
740  const double cell_phi = proxim(dde->phi_raw(), cp0.phiB);
741  if (cell_phi > phiMinusB && cell_phi < phiPlusB) {
742  inPhiRange = true;
743  }
744  }
745  if (cp0.emaxEC > 0) { // endcap
746  const double cell_phi = proxim(dde->phi_raw(), cp0.phiEC);
747  if (cell_phi > phiMinusEC && cell_phi < phiPlusEC) {
748  inPhiRange = true;
749  }
750  }
751  if (!inPhiRange) {
752  continue;
753  }
754 
755  tofill.addCell(cell_itr.index(), cell_itr.weight());
756  } // Cell Loop for L0/L1
757  } // Cluster loop for L0/L1
758 
759  if (!m_egammaCellRecoveryTool.empty()) {
761  if (cp0.emaxB > cp0.emaxEC) {
762  info.etamax = cp0.etaB;
763  info.phimax = cp0.phiB;
764  } else {
765  info.etamax = cp0.etaEC;
766  info.phimax = cp0.phiEC;
767  }
768  if (m_egammaCellRecoveryTool->execute(tofill,info).isFailure()) {
769  ATH_MSG_WARNING("Issue trying to recover cells");
770  }
771 
772  // And finally add the recovered cells
773  const CaloCellContainer* inputcells =
774  tofill.getCellLinks()->getCellContainer();
775  for (const auto *c : info.addedCells) {
776  int index = inputcells->findIndex(c->caloDDE()->calo_hash());
777  tofill.addCell(index, 1.);
778  }
779  }
780 
781  return StatusCode::SUCCESS;
782 }
783 
786  xAOD::CaloCluster& tofill,
787  const CaloDetDescrManager& mgr) const
788 {
789 
790  double searchWindowEta = m_useExtendedTG3 ? 0.35 : 0.2;
791  constexpr double searchWindowPhi = 2 * M_PI / 64.0 + M_PI / 64; // ~ 0.15 rad
792  std::vector<const CaloCell*> cells;
793  cells.reserve(16);
794  const CaloCellContainer* inputcells =
795  tofill.getCellLinks()->getCellContainer();
796 
797  if (!inputcells) {
798  ATH_MSG_ERROR("No cell container in addRemainingCellsToCluster?");
799  return StatusCode::FAILURE;
800  }
801 
802  CaloCellList myList(&mgr, inputcells);
803 
804  const std::vector<CaloSampling::CaloSample> samples = {
806  };
807 
808  for (auto samp : samples) {
809  // quite slow
810  myList.select(
811  tofill.eta0(), tofill.phi0(), searchWindowEta, searchWindowPhi, samp);
812  cells.insert(cells.end(), myList.begin(), myList.end());
813  }
814 
815  for (const auto* cell : cells) {
816  if (!cell) {
817  continue;
818  }
819  const CaloDetDescrElement* dde = cell->caloDDE();
820  if (!dde) {
821  continue;
822  }
823 
825  float minEta = s_TG3Run2E4cellEtaMin;
826  if (m_useExtendedTG3) {
827  minEta = s_TG3Run3E3cellEtaMin;
828  // if |eta2| < 1.56, keep only E3, else keep E3+E4.
829  // |eta2| uses as the eta of the highest energy cell in layer 2 as proxy
830  if (std::abs(tofill.eta0()) > 1.56) {
832  }
833  }
834  float cellaEtaRaw = std::abs(dde->eta_raw());
835  if (cellaEtaRaw >= minEta && cellaEtaRaw <= maxEta) {
836  int index = inputcells->findIndex(dde->calo_hash());
837  tofill.addCell(index, 1.);
838  }
839  }
840  return StatusCode::SUCCESS;
841 }
842 
845  const EventContext& ctx,
846  xAOD::CaloCluster* newCluster,
847  const CaloDetDescrManager& mgr,
849  xAOD::CaloClusterContainer* precorrClusters) const
850 {
851 
852  refineEta1Position(newCluster, mgr);
853  // Save the state before the corrections
854  newCluster->setAltE(newCluster->e());
855  newCluster->setAltEta(newCluster->eta());
856  newCluster->setAltPhi(newCluster->phi());
857  // first do the corrections
858  if (precorrClusters) {
859  precorrClusters->push_back(std::make_unique<xAOD::CaloCluster>());
860  *precorrClusters->back() = *newCluster;
861  }
863  ctx, newCluster, egType, xAOD::EgammaHelpers::isBarrel(newCluster)));
864  double aeta = std::abs(newCluster->eta());
865  if (aeta > 10) {
866  ATH_MSG_DEBUG("Too large eta after S-shape corrections. "
867  "SuperCluster rejected");
868  return StatusCode::FAILURE;
869  }
870  newCluster->setRawE(newCluster->e());
871  newCluster->setRawEta(newCluster->eta());
872  newCluster->setRawPhi(newCluster->phi());
873  //
874  fillPositionsInCalo(newCluster, mgr);
875  ATH_CHECK(m_MVACalibSvc->execute(*newCluster, egType));
876 
877  return StatusCode::SUCCESS;
878 }
879 
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
grepfile.info
info
Definition: grepfile.py:38
CaloDetDescrElement::deta
float deta() const
cell deta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
CaloClusterStoreHelper::makeCluster
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
Definition: CaloClusterStoreHelper.cxx:13
xAOD::CaloCluster_v1::phimax
float phimax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
Definition: CaloCluster_v1.cxx:589
xAOD::CaloCluster_v1::phi0
flt_t phi0() const
Returns raw of cluster seed.
CookieCutterHelpers::CentralPosition
Find the reference position (eta, phi) relative to which cells are restricted.
Definition: CookieCutterHelpers.h:19
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
CaloClusterKineHelper.h
egammaSuperClusterBuilderBase::m_addCellsWindowEtaCellsBarrel
Gaudi::Property< int > m_addCellsWindowEtaCellsBarrel
Size of windows et eta in which cells of topoclusters are added for the barrel (units of 2nd layer ce...
Definition: egammaSuperClusterBuilderBase.h:329
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
CookieCutterHelpers::PhiSize::minusEC
float minusEC
Definition: CookieCutterHelpers.h:53
CaloDetDescrElement::is_lar_em_endcap_inner
bool is_lar_em_endcap_inner() const
cell belongs to the inner wheel of EM end cap
Definition: CaloDetDescrElement.cxx:114
egammaSuperClusterBuilderBase::m_MVACalibSvc
ServiceHandle< IegammaMVASvc > m_MVACalibSvc
Handle to the MVA calibration service.
Definition: egammaSuperClusterBuilderBase.h:369
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
egammaSuperClusterBuilderBase::m_searchWindowPhiEndcap
float m_searchWindowPhiEndcap
Definition: egammaSuperClusterBuilderBase.h:198
egammaSuperClusterBuilderBase::m_searchWindowEtaBarrel
float m_searchWindowEtaBarrel
Definition: egammaSuperClusterBuilderBase.h:195
CaloCellList::begin
list_iterator begin() const
Definition: CaloCellList.h:87
egammaSuperClusterBuilderBase::egammaRecPassesSelection
virtual bool egammaRecPassesSelection(const egammaRec *egRec) const
Definition: egammaSuperClusterBuilderBase.cxx:396
CaloCellList
Definition: CaloCellList.h:40
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
max
#define max(a, b)
Definition: cfImp.cxx:41
egammaSuperClusterBuilderBase::m_clusterCorrectionTool
ToolHandle< IegammaSwTool > m_clusterCorrectionTool
Tool to handle cluster corrections.
Definition: egammaSuperClusterBuilderBase.h:375
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellList::select
void select(double eta, double phi, double deta, double dphi)
Definition: CaloCellList.cxx:67
CaloClusterStoreHelper::AddContainerWriteHandle
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
Definition: CaloClusterStoreHelper.cxx:53
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
egammaSuperClusterBuilderBase::s_TG3Run3E3cellEtaMin
static constexpr float s_TG3Run3E3cellEtaMin
Definition: egammaSuperClusterBuilderBase.h:139
CaloCellList.h
xAOD::CaloCluster_v1::ETA2CALOFRAME
@ ETA2CALOFRAME
Eta of sampling 2 in the calo frame (for egamma)
Definition: CaloCluster_v1.h:191
egammaSuperClusterBuilderBase::m_addCellsWindowEtaBarrel
float m_addCellsWindowEtaBarrel
Definition: egammaSuperClusterBuilderBase.h:271
IegammaCellRecoveryTool::Info
Definition: IegammaCellRecoveryTool.h:36
egammaSuperClusterBuilderBase::initialize
virtual StatusCode initialize() override
should be called by the derived class in the initialize phase
Definition: egammaSuperClusterBuilderBase.cxx:211
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
xAOD::CaloCluster_v1::ETA1CALOFRAME
@ ETA1CALOFRAME
Eta of sampling 1 in the calo frame (for egamma)
Definition: CaloCluster_v1.h:189
proxim
double proxim(double b, double a)
Definition: proxim.h:17
xAOD::CaloCluster_v1::setAltEta
void setAltEta(flt_t)
Set for signal state ALTCALIBRATED.
Definition: CaloCluster_v1.cxx:333
M_PI
#define M_PI
Definition: ActiveFraction.h:11
xAOD::CaloCluster_v1::SuperCluster
@ SuperCluster
Definition: CaloCluster_v1.h:107
xAOD::CaloCluster_v1::insertMoment
void insertMoment(MomentType type, double value)
Definition: CaloCluster_v1.cxx:754
egammaSuperClusterBuilderBase::createNewCluster
std::unique_ptr< xAOD::CaloCluster > createNewCluster(const EventContext &ctx, const std::vector< const xAOD::CaloCluster * > &clusters, const DataLink< CaloCellContainer > &cellCont, const CaloDetDescrManager &mgr, xAOD::EgammaParameters::EgammaType egType, xAOD::CaloClusterContainer *precorrClusters) const
Add new supercluster ,created out of the input clusters, to the newClusters collections.
Definition: egammaSuperClusterBuilderBase.cxx:477
egammaSuperClusterBuilderBase::s_cellPhiSize
static constexpr float s_cellPhiSize
Definition: egammaSuperClusterBuilderBase.h:137
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
xAOD::CaloCluster_v1::phiBE
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:680
egammaSuperClusterBuilderBase::s_TG3Run3E4cellEtaMax
static constexpr float s_TG3Run3E4cellEtaMax
Definition: egammaSuperClusterBuilderBase.h:138
egammaSuperClusterBuilderBase::m_outputSuperClusterCollectionName
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outputSuperClusterCollectionName
Key for output clusters.
Definition: egammaSuperClusterBuilderBase.h:178
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
CaloClusterAuxContainer.h
xAOD::CaloCluster_v1::etamax
float etamax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
Definition: CaloCluster_v1.cxx:576
xAOD::CaloCluster_v1::PHI1CALOFRAME
@ PHI1CALOFRAME
Phi of sampling 1 in the calo frame (for egamma)
Definition: CaloCluster_v1.h:190
egammaSuperClusterBuilderBase::getEgammaRecType
virtual xAOD::EgammaParameters::EgammaType getEgammaRecType(const egammaRec *egRec) const =0
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
egammaSuperClusterBuilderBase::m_egammaCheckEnergyDepositTool
ToolHandle< IegammaCheckEnergyDepositTool > m_egammaCheckEnergyDepositTool
Pointer to the egammaCheckEnergyDepositTool.
Definition: egammaSuperClusterBuilderBase.h:383
egammaSuperClusterBuilderBase::m_addCellsWindowEtaCellsEndcap
Gaudi::Property< int > m_addCellsWindowEtaCellsEndcap
Size of windows et eta in which cells of topoclusters are edded for the endcap (units of 2nd layer ce...
Definition: egammaSuperClusterBuilderBase.h:338
CaloDetDescrElement::eta_raw
float eta_raw() const
cell eta_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:350
PUfitVar::maxEta
constexpr float maxEta
Definition: GepMETPufitAlg.cxx:13
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
CaloDetDescrElement::getSubCalo
CaloCell_ID::SUBCALO getSubCalo() const
cell subcalo
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:433
xAOD::EgammaParameters::EgammaType
EgammaType
Definition: EgammaEnums.h:17
xAOD::EgammaHelpers::isBarrel
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel
Definition: EgammaxAODHelpers.cxx:33
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
egammaSuperClusterBuilderBase::execute
virtual StatusCode execute(const EventContext &ctx) const override
should be called by the derived class in the execute phase
Definition: egammaSuperClusterBuilderBase.cxx:274
CaloCellList::end
list_iterator end() const
Definition: CaloCellList.h:93
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:644
egammaSuperClusterBuilderBase::addTileGap3CellsinWindow
StatusCode addTileGap3CellsinWindow(xAOD::CaloCluster &tofill, const CaloDetDescrManager &mgr) const
add all tile Gap 3 cells in a window.
Definition: egammaSuperClusterBuilderBase.cxx:785
egammaSuperClusterBuilderBase::m_linkToConstituents
Gaudi::Property< bool > m_linkToConstituents
Decorate the supercluster with links to the component topoclusters.
Definition: egammaSuperClusterBuilderBase.h:280
egammaSuperClusterBuilderBase::m_caloDetDescrMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Definition: egammaSuperClusterBuilderBase.h:162
proxim.h
egammaSuperClusterBuilderBase::matchesInWindow
bool matchesInWindow(const xAOD::CaloCluster *ref, const xAOD::CaloCluster *clus) const
Is clus in window center around ref?
Definition: egammaSuperClusterBuilderBase.cxx:409
CookieCutterHelpers::PhiSize::plusB
float plusB
Definition: CookieCutterHelpers.h:50
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: P4Helpers.h:34
egammaSuperClusterBuilderBase::m_egammaCellRecoveryTool
ToolHandle< IegammaCellRecoveryTool > m_egammaCellRecoveryTool
Pointer to the egammaCellRecoveryTool.
Definition: egammaSuperClusterBuilderBase.h:391
EgammaxAODHelpers.h
egammaSuperClusterBuilderBase::m_searchWindowPhiCellsEndcap
Gaudi::Property< int > m_searchWindowPhiCellsEndcap
Size of topocluster search window in phi for the end-cap.
Definition: egammaSuperClusterBuilderBase.h:320
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
xAOD::CaloCluster_v1::setRawE
void setRawE(flt_t)
Set Energy for signal state UNCALIBRATED.
Definition: CaloCluster_v1.cxx:284
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
lumiFormat.i
int i
Definition: lumiFormat.py:85
egammaSuperClusterBuilderBase::redoMatching
virtual StatusCode redoMatching(const EventContext &ctx, SG::WriteHandle< EgammaRecContainer > &newEgammaRecs) const
Definition: egammaSuperClusterBuilderBase.cxx:401
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CookieCutterHelpers::PhiSize::plusEC
float plusEC
Definition: CookieCutterHelpers.h:52
egammaSuperClusterBuilderBase::egammaSuperClusterBuilderBase
egammaSuperClusterBuilderBase(const std::string &name, ISvcLocator *pSvcLocator)
Protected constructor since this class should not be instantiated by itself.
Definition: egammaSuperClusterBuilderBase.cxx:203
CaloCluster.h
CookieCutterHelpers::CentralPosition::etaB
float etaB
Definition: CookieCutterHelpers.h:20
xAOD::CaloCluster_v1::getSisterClusterLink
const ElementLink< xAOD::CaloClusterContainer_v1 > & getSisterClusterLink() const
Get a link to a 'sister' cluster (eg the non-calibrated counterpart)
Definition: CaloCluster_v1.cxx:969
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:538
PhotonxAODHelpers.h
xAOD::CaloCluster_v1::size
size_t size() const
size method (forwarded from CaloClusterCellLink obj)
Definition: CaloCluster_v1.cxx:996
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
xAOD::CaloCluster_v1::setAltE
void setAltE(flt_t)
Set Energy for signal state ALTCALIBRATED.
Definition: CaloCluster_v1.cxx:328
xAOD::CaloCluster_v1::setRawEta
void setRawEta(flt_t)
Set for signal state UNCALIBRATED.
Definition: CaloCluster_v1.cxx:289
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
egammaSuperClusterBuilderBase::m_searchWindowPhiBarrel
float m_searchWindowPhiBarrel
Definition: egammaSuperClusterBuilderBase.h:196
CaloClusterCorr::etaphi_range
void etaphi_range(const CaloDetDescrManager &dd_man, double eta, double phi, CaloCell_ID::CaloSample sampling, double &deta, double &dphi)
Return eta/phi ranges encompassing +- 1 cell.
Definition: CaloFillRectangularCluster.cxx:64
CookieCutterHelpers::PhiSize::minusB
float minusB
Definition: CookieCutterHelpers.h:51
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
egammaSuperClusterBuilderBase::m_searchWindowEtaCellsBarrel
Gaudi::Property< int > m_searchWindowEtaCellsBarrel
Size of topocluster search window in eta for the barrel.
Definition: egammaSuperClusterBuilderBase.h:296
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Vertex.h
egammaSuperClusterBuilderBase::s_TG3Run2E4cellEtaMin
static constexpr float s_TG3Run2E4cellEtaMin
Definition: egammaSuperClusterBuilderBase.h:141
CaloPhiRange::fix
static double fix(double phi)
Definition: CaloPhiRange.cxx:14
xAOD::CaloCluster_v1::getCellLinks
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
Definition: CaloCluster_v1.cxx:905
egammaSuperClusterBuilderBase::m_precorrClustersKey
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_precorrClustersKey
Optional key for pre-correction clusters.
Definition: egammaSuperClusterBuilderBase.h:186
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::EgammaHelpers::summaryValueInt
int summaryValueInt(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, int deflt=-999)
return the summary value for a TrackParticle or default value (-999) (to be used mostly in python whe...
Definition: EgammaxAODHelpers.cxx:161
inRange
bool inRange(const double *boundaries, const double value, const double tolerance=0.02)
Definition: LArSCIdVsIdTest.cxx:5
P4Helpers.h
CaloCellDetPos::getDetPosition
static bool getDetPosition(const CaloDetDescrManager &mgr, CaloCell_ID::CaloSample sam, double etaAtlas, double phiAtlas, double &etaDet, double &phiDet)
get Detector level eta-phi position from Atlas level (aligned) position
Definition: CaloCellDetPos.cxx:13
egammaSuperClusterBuilderBase::m_addCellsWindowEtaEndcap
float m_addCellsWindowEtaEndcap
Definition: egammaSuperClusterBuilderBase.h:272
egammaSuperClusterBuilderBase::m_inputEgammaRecContainerKey
SG::ReadHandleKey< EgammaRecContainer > m_inputEgammaRecContainerKey
Key for input egammaRec container.
Definition: egammaSuperClusterBuilderBase.h:155
egammaSuperClusterBuilderBase::m_extraL3EtaSize
float m_extraL3EtaSize
Definition: egammaSuperClusterBuilderBase.h:276
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
egammaSuperClusterBuilderBase.h
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CookieCutterHelpers::CentralPosition::phiB
float phiB
Definition: CookieCutterHelpers.h:21
CookieCutterHelpers::PhiSize
Find the size of the cluster in phi using L2 cells.
Definition: CookieCutterHelpers.h:49
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
xAOD::CaloCluster_v1::PHICALOFRAME
@ PHICALOFRAME
Phi in the calo frame (for egamma)
Definition: CaloCluster_v1.h:188
CookieCutterHelpers::CentralPosition::phiEC
float phiEC
Definition: CookieCutterHelpers.h:24
CaloClusterStoreHelper.h
egammaSuperClusterBuilderBase::searchForSecondaryClusters
virtual std::vector< std::size_t > searchForSecondaryClusters(std::size_t egammaInd, const EgammaRecContainer *egammaRecs, std::vector< bool > &isUsed) const =0
TrackParticle.h
EgammaEnums.h
egammaSuperClusterBuilderBase::s_TG3Run2E4cellEtaMax
static constexpr float s_TG3Run2E4cellEtaMax
Definition: egammaSuperClusterBuilderBase.h:140
CaloDetDescrElement::dphi
float dphi() const
cell dphi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:358
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
xAOD::CaloCluster_v1::eta0
flt_t eta0() const
Returns raw of cluster seed.
egammaSuperClusterBuilderBase::s_cellEtaSize
static constexpr float s_cellEtaSize
Definition: egammaSuperClusterBuilderBase.h:136
egammaSuperClusterBuilderBase::m_EtThresholdCut
Gaudi::Property< float > m_EtThresholdCut
Seed selection requirements.
Definition: egammaSuperClusterBuilderBase.h:147
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ref
const boost::regex ref(r_ef)
CaloLayerCalculator
Definition: CaloLayerCalculator.h:82
xAOD::CaloCluster_v1::PHI2CALOFRAME
@ PHI2CALOFRAME
Phi of sampling 2 in the calo frame (for egamma)
Definition: CaloCluster_v1.h:192
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
egammaSuperClusterBuilderBase::m_extraL0L1PhiSize
float m_extraL0L1PhiSize
Definition: egammaSuperClusterBuilderBase.h:274
xAOD::CaloCluster_v1::addCell
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
Definition: CaloCluster_v1.h:771
egammaSuperClusterBuilderBase::calibrateCluster
StatusCode calibrateCluster(const EventContext &ctx, xAOD::CaloCluster *newCluster, const CaloDetDescrManager &mgr, const xAOD::EgammaParameters::EgammaType egType, xAOD::CaloClusterContainer *precorrClusters) const
function to calibrate the new clusters energy
Definition: egammaSuperClusterBuilderBase.cxx:844
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
xAOD::CaloCluster_v1::energyBE
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:630
python.LArCondContChannels.isBarrel
isBarrel
Definition: LArCondContChannels.py:659
CaloCellContainer::findIndex
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
Definition: CaloCellContainer.cxx:363
CaloClusterKineHelper::calculateKine
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
Definition: CaloClusterKineHelper.cxx:223
CookieCutterHelpers::CentralPosition::emaxB
float emaxB
Definition: CookieCutterHelpers.h:22
egammaSuperClusterBuilderBase::seedClusterSelection
bool seedClusterSelection(const xAOD::CaloCluster *clus) const
check if we pass the basic criteria for a seed cluster
Definition: egammaSuperClusterBuilderBase.cxx:585
egammaRec
Definition: egammaRec.h:31
egammaSuperClusterBuilderBase::m_extraL0L1PhiSizeCells
Gaudi::Property< int > m_extraL0L1PhiSizeCells
"When adding L0 (PS) and L1 cells, how much wider than the L2 size of the cluster is the acceptance i...
Definition: egammaSuperClusterBuilderBase.h:348
egammaRecContainer.h
egammaSuperClusterBuilderBase::s_ClEtaMinForTG3cell
static constexpr float s_ClEtaMinForTG3cell
Definition: egammaSuperClusterBuilderBase.h:143
xAOD::CaloCluster_v1::setEta
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
Definition: CaloCluster_v1.cxx:541
xAOD::CaloCluster_v1::hasSampling
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
Definition: CaloCluster_v1.h:890
xAOD::CaloCluster_v1::ETACALOFRAME
@ ETACALOFRAME
Eta in the calo frame (for egamma)
Definition: CaloCluster_v1.h:187
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
egammaSuperClusterBuilderBase::m_searchWindowPhiCellsBarrel
Gaudi::Property< int > m_searchWindowPhiCellsBarrel
Size of topocluster search window in phi for the barrel.
Definition: egammaSuperClusterBuilderBase.h:304
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:527
xAOD::CaloCluster_v1::setAltPhi
void setAltPhi(flt_t)
Set for signal state ALTCALIBRATED.
Definition: CaloCluster_v1.cxx:338
CaloDetDescrManager_Base::get_element_raw
const CaloDetDescrElement * get_element_raw(CaloCell_ID::CaloSample sample, double eta, double phi) const
Get element from raw quantities (to build real fixed size clusters)
Definition: CaloDetDescrManager.cxx:349
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
egammaSuperClusterBuilderBase::m_useExtendedTG3
Gaudi::Property< bool > m_useExtendedTG3
Use extended TG3 definition (only after Run 2)
Definition: egammaSuperClusterBuilderBase.h:288
egammaSuperClusterBuilderBase::fillClusterConstrained
StatusCode fillClusterConstrained(xAOD::CaloCluster &tofill, const std::vector< const xAOD::CaloCluster * > &clusters, const CookieCutterHelpers::CentralPosition &cp0) const
Fill super cluster constraining its size in eta,phi around the overall hottest cell and the its L2 si...
Definition: egammaSuperClusterBuilderBase.cxx:606
python.compressB64.c
def c
Definition: compressB64.py:93
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
CookieCutterHelpers::CentralPosition::emaxEC
float emaxEC
Definition: CookieCutterHelpers.h:25
egammaSuperClusterBuilderBase::m_searchWindowEtaEndcap
float m_searchWindowEtaEndcap
Definition: egammaSuperClusterBuilderBase.h:197
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
egammaSuperClusterBuilderBase::m_searchWindowEtaCellsEndcap
Gaudi::Property< int > m_searchWindowEtaCellsEndcap
Size of topocluster search window in eta for the end-cap.
Definition: egammaSuperClusterBuilderBase.h:312
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
egammaSuperClusterBuilderBase::m_extraL3EtaSizeCells
Gaudi::Property< int > m_extraL3EtaSizeCells
"When adding L3 cells, how much wider in eta than the L2
Definition: egammaSuperClusterBuilderBase.h:359
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
egammaSuperClusterBuilderBase::s_ClEtaMaxForTG3cell
static constexpr float s_ClEtaMaxForTG3cell
Definition: egammaSuperClusterBuilderBase.h:144
xAOD::CaloCluster_v1::setRawPhi
void setRawPhi(flt_t)
Set for signal state UNCALIBRATED.
Definition: CaloCluster_v1.cxx:294
CookieCutterHelpers::CentralPosition::etaEC
float etaEC
Definition: CookieCutterHelpers.h:23
CaloDetDescrElement::phi_raw
float phi_raw() const
cell phi_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:352
CaloLayerCalculator.h
Calculate total energy, position, etc. for a given layer of a cluster.
egammaSuperClusterBuilderBase::m_outputEgammaRecContainerKey
SG::WriteHandleKey< EgammaRecContainer > m_outputEgammaRecContainerKey
Key for output egammaRec container.
Definition: egammaSuperClusterBuilderBase.h:170