ATLAS Offline Software
CaloScaleCluster.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
12 #include "CaloScaleCluster.h"
14 #include <cmath>
15 
16 
17 using xAOD::CaloCluster;
19 
20 
42  CaloCluster* cluster,
43  const CaloDetDescrElement* /*elt*/,
44  float /*eta*/,
45  float adj_eta,
46  float /*phi*/,
47  float /*adj_phi*/,
48  CaloSampling::CaloSample /*samp*/)
49  const
50 {
52 
53  float adj_aeta = std::abs (adj_eta);
54  float fac;
55  if (std::abs (adj_eta) > m_etamax (myctx)) {
56  fac = correction[correction.size()-1][1];
57  }
58  else {
59  // The rfac-v5 tables contain a couple spurious zeros
60  // (from empty bins)? If we don't do anything, this correction will blow
61  // up in the immediate vicinity of those points. Work around by replacing
62  // the zeros with an average of the adjacent points, by setting
63  // fixZero=true in the interpolate call.
64  fac = interpolate (correction, adj_aeta, m_degree (myctx),
65  1, CaloRec::Array<1>(), -1,
66  /*fixZero=*/ true);
67  }
68  cluster->setE (cluster->e() / fac);
69 }
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloScaleCluster.h
Scale cluster energy by an eta-dependent factor.
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CxxUtils::Array< 2 >
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
CaloScaleCluster::m_correction
Constant< CxxUtils::Array< 2 > > m_correction
Calibration constant: tabulated arrays of function parameters.
Definition: CaloScaleCluster.h:76
CaloCluster::setE
virtual void setE(double e)
Set energy.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:767
CaloScaleCluster::makeTheCorrection
virtual void makeTheCorrection(const Context &myctx, xAOD::CaloCluster *cluster, const CaloDetDescrElement *elt, float eta, float adj_eta, float phi, float adj_phi, CaloSampling::CaloSample samp) const override
Virtual function for the correction-specific code.
Definition: CaloScaleCluster.cxx:41
CaloClusterCorr::interpolate
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > &regions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.
Definition: interpolate.cxx:75
CaloCluster::e
virtual double e() const
Retrieve energy independent of signal state.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:753
CaloUtils::ToolConstantsContext
Context object for retrieving ToolConstant values.
Definition: ToolWithConstants.h:61
interpolate.h
Polynomial interpolation in a table.
CaloScaleCluster::m_degree
Constant< int > m_degree
Calibration constant: degree of the polynomial interpolation.
Definition: CaloScaleCluster.h:80
CaloScaleCluster::m_etamax
Constant< float > m_etamax
Calibration constant: maximum eta for which this correction is defined.
Definition: CaloScaleCluster.h:84