ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloClusterCorrection
src
CaloSwEta2b_g3.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
7
NAME: CaloSwEta2b_g3.cxx
8
PACKAGE: offline/Calorimeter/CaloClusterCorrection
9
10
AUTHORS: H. Ma, S. Rajagopalan
11
CREATED: Dec. 15, 1999
12
13
PURPOSE: S-shape corrections in sampling 2 as a function of eta
14
for barrel EM calorimeter.
15
(Tuned using 50 GeV Et photons)
16
base class: CaloClusterCorrection
17
Correction tuned on G3 samples.
18
19
Atrecon Orig: emreco/qeta2b.age
20
21
Updated: May 10, 2000 (SR, HM)
22
Migrated to Athena Framework from PASO
23
24
Updated: Jan 5, 2001 (HM)
25
QA.
26
27
Updated: Feb 28, 2003 (MW)
28
barrel goes only up to eta=1.475, not 1.5
29
30
Updated: May 5, 2004 (Sven Menke)
31
base class changed from algo to tool
32
33
Updated: June, 2004 (sss)
34
Use ToolWithConstants to get correction constants.
35
********************************************************************/
36
37
#include "
CaloSwEta2b_g3.h
"
38
#include "
CaloClusterCorrection/interpolate.h
"
39
#include <cmath>
40
41
using
xAOD::CaloCluster
;
42
using
CaloClusterCorr::interpolate
;
43
44
// granularity of middle EM barrel layer
45
46
const
float
CaloSwEta2b_g3::s_middle_layer_granularity
= 0.025;
47
48
49
void
CaloSwEta2b_g3::makeCorrection
(
const
Context& myctx,
50
CaloCluster
* cluster)
const
51
{
52
// Only for barrel
53
if
(!cluster->
inBarrel
())
54
return
;
55
56
const
CxxUtils::Array<2>
correction =
m_correction
(myctx);
57
const
CxxUtils::Array<2>
residuals =
m_residuals
(myctx);
58
const
CxxUtils::Array<1>
residual_bins =
m_residual_bins
(myctx);
59
const
int
correction_degree =
m_correction_degree
(myctx);
60
const
int
residual_eval_degree =
m_residual_eval_degree
(myctx);
61
const
int
residual_degree =
m_residual_degree
(myctx);
62
const
float
correction_coef =
m_correction_coef
(myctx);
63
const
float
residual_coef =
m_residual_coef
(myctx);
64
65
assert (residuals.
size
(1)-1 == residual_bins.
size
());
66
67
// eta of second sampling
68
float
eta
= cluster->
etaSample
(CaloSampling::EMB2);
69
if
(
eta
== -999.)
return
;
70
float
aeta = fabs(
eta
);
71
72
// u2 is the distance to the inner edge of the cell (granularity 0.025)
73
float
u2 = fmod(aeta,
s_middle_layer_granularity
) ;
74
75
// First order (average) S-shape correction
76
float
deta = correction_coef * interpolate (correction,
77
u2,
78
correction_degree);
79
80
// Residual S-shape correction: six ranges in eta from 0 to 1.2
81
// Evaluated by 2nd order interpolation between 10 tabulated values
82
83
// first we evaluate our residual in each eta range, given u2
84
85
unsigned
int
shape[] = {residual_bins.
size
(), 2};
86
CaloRec::WritableArrayData<2>
w (shape);
87
88
for
(
unsigned
int
i=0; i < residual_bins.
size
(); i++) {
89
w[i][0] = residual_bins[i];
90
w[i][1] = interpolate (residuals,
91
u2,
92
residual_eval_degree,
93
i+1);
94
}
95
96
// finally we interpolate (2nd order) for the actual eta
97
98
deta += residual_coef * interpolate (w,
99
aeta,
100
residual_degree);
101
if
(
eta
< 0)
102
deta = -deta;
103
104
// make correction to second sampling
105
cluster->
setEta
(CaloSampling::EMB2,
eta
- deta);
106
}
107
108
109
const
std::string&
CaloSwEta2b_g3::toolType
()
const
110
{
111
static
const
std::string typeName =
"CaloSwEta_g3"
;
112
return
typeName;
113
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
CaloSwEta2b_g3.h
CaloCluster
Principal data class for CaloCell clusters.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
CaloCluster::setEta
virtual void setEta(double eta)
Set eta.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:769
CaloCluster::etaSample
double etaSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:991
CaloCluster::inBarrel
bool inBarrel() const
Returns true if at least one clustered cell in EMB.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:926
CaloSwEta2b_g3::m_residual_coef
Constant< float > m_residual_coef
Definition
CaloSwEta2b_g3.h:66
CaloSwEta2b_g3::m_residual_eval_degree
Constant< int > m_residual_eval_degree
Definition
CaloSwEta2b_g3.h:63
CaloSwEta2b_g3::m_correction
Constant< CxxUtils::Array< 2 > > m_correction
Definition
CaloSwEta2b_g3.h:59
CaloSwEta2b_g3::m_residual_degree
Constant< int > m_residual_degree
Definition
CaloSwEta2b_g3.h:64
CaloSwEta2b_g3::m_residual_bins
Constant< CxxUtils::Array< 1 > > m_residual_bins
Definition
CaloSwEta2b_g3.h:61
CaloSwEta2b_g3::toolType
virtual const std::string & toolType() const override
Definition
CaloSwEta2b_g3.cxx:109
CaloSwEta2b_g3::s_middle_layer_granularity
static const float s_middle_layer_granularity
Definition
CaloSwEta2b_g3.h:69
CaloSwEta2b_g3::m_correction_degree
Constant< int > m_correction_degree
Definition
CaloSwEta2b_g3.h:62
CaloSwEta2b_g3::m_correction_coef
Constant< float > m_correction_coef
Definition
CaloSwEta2b_g3.h:65
CaloSwEta2b_g3::m_residuals
Constant< CxxUtils::Array< 2 > > m_residuals
Definition
CaloSwEta2b_g3.h:60
CaloSwEta2b_g3::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
Definition
CaloSwEta2b_g3.cxx:49
CxxUtils::Array
Read-only multidimensional array.
Definition
Control/CxxUtils/CxxUtils/Array.h:135
CxxUtils::Array::size
unsigned int size(unsigned int dim=0) const
Return the size of the array along one dimension.
CxxUtils::WritableArrayData
Definition
Control/CxxUtils/CxxUtils/Array.h:775
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