12 std::pair<const double, const double>
20 constexpr double eps = 0.001;
24 double deta_l = elt_l ? std::abs(
eta - elt_l->
eta_raw()) + eps : 0.;
28 double deta_r = elt_r ? std::abs(
eta - elt_r->
eta_raw()) + eps : 0.;
44 return {2 * std::max(deta_r, deta_l), 2 * std::max(dphi_l, dphi_r)};
51 const bool isEndcap = cluster->
inEndcap();
52 if (isBarrel && isEndcap) {
53 isBarrel = cluster->
eSample(CaloSampling::EMB2)
54 >= cluster->
eSample(CaloSampling::EME2);
57 isBarrel ? CaloCell_ID::EMB2 : CaloCell_ID::EME2;
71 sample = isBarrel ? CaloCell_ID::EMB1 : CaloCell_ID::EME1;
83 const double clusterEtaMax = cluster->
etamax(sample);
84 const double clusterPhiMax = cluster->
phimax(sample);
87 if (clusterEtaMax == -999. || clusterPhiMax == -999.) {
90 if (std::abs(clusterEtaMax) < 1E-6 && std::abs(clusterPhiMax) < 1E-6) {
97 (sample == CaloSampling::EMB1) ? CaloCell_ID::EMB1 : CaloCell_ID::EME1;
107 double etamax = dde->
eta_raw();
108 double phimax = dde->
phi_raw();
116 auto [detastr, dphistr] =
etaphi_range(mgr, etamax, phimax, xsample, elt);
119 if (detastr > 0 && dphistr > 0) {
122 helper.fill(cellLink->begin(),
131 if (helper.etam() != -999.) {
133 cluster->
setEta(sample, helper.etam());
147 const double aeta = std::abs(cluster->
etaBE(2));
148 if (aeta < 1.6 && cluster->hasSampling(CaloSampling::EMB1)) {
151 if (aeta > 1.3 && cluster->
hasSampling(CaloSampling::EME1)) {
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Calculate total energy, position, etc. for a given layer of a cluster.
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
CaloSampling::CaloSample CaloSample
This class groups all DetDescr information related to a CaloCell.
float eta_raw() const
cell eta_raw
float dphi() const
cell dphi
float phi_raw() const
cell phi_raw
float deta() const
cell deta
This class provides the client interface for accessing the detector description information common to...
static double fix(double phi)
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
virtual double eta() const
The pseudorapidity ( ) of the particle.
void insertMoment(MomentType type, double value)
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
float eSample(const CaloSample sampling) const
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
virtual double phi() const
The azimuthal angle ( ) of the particle.
float etamax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
@ ETA2CALOFRAME
Eta of sampling 2 in the calo frame (for egamma)
@ ETACALOFRAME
Eta in the calo frame (for egamma)
@ PHI2CALOFRAME
Phi of sampling 2 in the calo frame (for egamma)
@ PHI1CALOFRAME
Phi of sampling 1 in the calo frame (for egamma)
@ PHICALOFRAME
Phi in the calo frame (for egamma)
@ ETA1CALOFRAME
Eta of sampling 1 in the calo frame (for egamma)
float phimax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
void fillPositionsInCalo(xAOD::CaloCluster *cluster, const CaloDetDescrManager &mgr)
Function to decorate the calo cluster with position variables.
std::pair< const double, const double > etaphi_range(const CaloDetDescrManager &mgr, double eta, double phi, CaloCell_ID::CaloSample sampling, const CaloDetDescrElement *elt)
Duplicate code.
void refineEta1Position(xAOD::CaloCluster *cluster, const CaloDetDescrManager &mgr)
function to refine position in eta1
void makeCorrection1(xAOD::CaloCluster *cluster, const CaloDetDescrManager &mgr, const CaloSampling::CaloSample sample)
functions to make 1st sampling (strips) specific corrections
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.