ATLAS Offline Software
Loading...
Searching...
No Matches
egammaClusterCookieCut Namespace Reference

Classes

struct  CookieCutPars

Functions

std::unique_ptr< xAOD::CaloClustercookieCut (const xAOD::CaloCluster &cluster, const CaloDetDescrManager &mgr, const DataLink< CaloCellContainer > &cellCont, const egammaClusterCookieCut::CookieCutPars &pars)

Function Documentation

◆ cookieCut()

std::unique_ptr< xAOD::CaloCluster > egammaClusterCookieCut::cookieCut ( const xAOD::CaloCluster & cluster,
const CaloDetDescrManager & mgr,
const DataLink< CaloCellContainer > & cellCont,
const egammaClusterCookieCut::CookieCutPars & pars )

Definition at line 28 of file egammaClusterCookieCut.cxx.

33 {
34 if (!cluster.hasSampling(CaloSampling::EME2) &&
35 !cluster.hasSampling(CaloSampling::FCAL0)) {
36 return nullptr;
37 }
38
40
41 const bool isEC = cp0.emaxEC >= cp0.emaxF;
42 const float eta = isEC ? cp0.etaEC : cp0.etaF;
43 const float phi = isEC ? cp0.phiEC : cp0.phiF;
44
45 auto newCluster = CaloClusterStoreHelper::makeCluster(cellCont);
46
47 if (!newCluster) {
48 return nullptr;
49 }
50
51 CaloClusterCellLink* newCellLinks = newCluster->getOwnCellLinks();
52 if (!pars.recomputeMoments) {
53 copyMoments(cluster,
54 newCluster,
66 }
67
68 const CaloClusterCellLink* cellLinks = cluster.getCellLinks();
69 CaloClusterCellLink::const_iterator cellItr = cellLinks->begin();
70 CaloClusterCellLink::const_iterator cellEnd = cellLinks->end();
71
72 for (; cellItr != cellEnd; ++cellItr) {
73 const float deltaEta = std::abs(eta - cellItr->eta());
74 const float deltaPhi = std::abs(P4Helpers::deltaPhi(phi, cellItr->phi()));
75
76 const float deltaEta2 = deltaEta * deltaEta;
77 const float deltaPhi2 = deltaPhi * deltaPhi;
78
79 const bool excludeCell = isEC ?
80 (deltaEta >= pars.maxDelEta || deltaPhi >= pars.maxDelPhi) :
81 (deltaEta2 + deltaPhi2 >= pars.maxDelR2);
82
83 if (!excludeCell) {
84 double w = pars.fixCellWeights ? 1. : cellItr.weight();
85 newCellLinks->addCell(cellItr.index(), w);
86 }
87 }
88
89 CaloClusterKineHelper::calculateKine(newCluster.get(), true, true);
90
91 return newCluster;
92}
Scalar eta() const
pseudorapidity method
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
virtual double phi() const override final
get phi (through CaloDetDescrElement)
Definition CaloCell.h:375
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition CaloCell.h:382
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.
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
@ SECOND_ENG_DENS
Second Moment in E/V.
@ SECOND_LAMBDA
Second Moment in .
@ LATERAL
Normalized lateral moment.
@ LONGITUDINAL
Normalized longitudinal moment.
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
@ SECOND_R
Second Moment in .
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ SIGNIFICANCE
Cluster significance.
@ CENTER_Z
Cluster Centroid ( )
@ CENTER_X
Cluster Centroid ( )
@ CENTER_Y
Cluster Centroid ( )
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition P4Helpers.h:66
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition P4Helpers.h:34
@ deltaEta2
difference between the cluster eta (second sampling) and the eta of the track extrapolated to the sec...
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
Find the reference position (eta, phi) relative to which cells are restricted.