ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloClusterCorrection
src
CaloScaleCluster.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
10
11
12
#include "
CaloScaleCluster.h
"
13
#include "
CaloClusterCorrection/interpolate.h
"
14
#include <cmath>
15
16
17
using
xAOD::CaloCluster
;
18
using
CaloClusterCorr::interpolate
;
19
20
41
void
CaloScaleCluster::makeTheCorrection
(
const
Context& myctx,
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
{
51
const
CxxUtils::Array<2>
correction =
m_correction
(myctx);
52
if
(correction.size() == 0) {
53
ATH_MSG_ERROR
(
"Empty correction array"
);
54
return
;
55
}
56
57
float
adj_aeta = std::abs (adj_eta);
58
float
fac;
59
if
(std::abs (adj_eta) >
m_etamax
(myctx)) {
60
fac = correction[correction.size()-1][1];
61
}
62
else
{
63
// The rfac-v5 tables contain a couple spurious zeros
64
// (from empty bins)? If we don't do anything, this correction will blow
65
// up in the immediate vicinity of those points. Work around by replacing
66
// the zeros with an average of the adjacent points, by setting
67
// fixZero=true in the interpolate call.
68
fac = interpolate (correction, adj_aeta,
m_degree
(myctx),
69
1,
CaloRec::Array<1>
(), -1,
70
/*fixZero=*/
true
);
71
}
72
cluster->
setE
(cluster->
e
() / fac);
73
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
CaloScaleCluster.h
Scale cluster energy by an eta-dependent factor.
CaloCluster
Principal data class for CaloCell clusters.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
CaloCluster::e
virtual double e() const
Retrieve energy independent of signal state.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:753
CaloCluster::setE
virtual void setE(double e)
Set energy.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:767
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloSampling::CaloSample
CaloSample
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloScaleCluster::m_correction
Constant< CxxUtils::Array< 2 > > m_correction
Calibration constant: tabulated arrays of function parameters.
Definition
CaloScaleCluster.h:76
CaloScaleCluster::m_etamax
Constant< float > m_etamax
Calibration constant: maximum eta for which this correction is defined.
Definition
CaloScaleCluster.h:84
CaloScaleCluster::m_degree
Constant< int > m_degree
Calibration constant: degree of the polynomial interpolation.
Definition
CaloScaleCluster.h:80
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
CxxUtils::Array
Read-only multidimensional array.
Definition
Control/CxxUtils/CxxUtils/Array.h:135
interpolate.h
Polynomial interpolation in a table.
CaloClusterCorr::interpolate
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > ®ions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.
Definition
interpolate.cxx:74
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
Generated on
for ATLAS Offline Software by
1.17.0