ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloClusterCorrection
src
CaloSwEta1b_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: CaloSwEta1b_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 1 as a function of eta
14
(Tuned using 50 GeV Et photons)
15
base class: CaloClusterCorrection
16
Correction tuned on G3 samples.
17
18
Atrecon Orig: emreco/qeta1b.age
19
20
Updated: May 10, 2000 (SR, HM)
21
Migrated to Athena Framework from PASO
22
23
Updated: Jan 5, 2001 (HM)
24
QA.
25
26
Updated: Feb 28, 2003 (MW)
27
barrel goes only up to eta=1.475, not 1.5
28
29
Updated: May 5, 2004 (Sven Menke)
30
base class changed from algo to tool
31
32
Updated: June, 2004 (sss)
33
Use ToolWithConstants to get correction constants.
34
********************************************************************/
35
#include "
CaloSwEta1b_g3.h
"
36
#include "
CaloClusterCorrection/interpolate.h
"
37
#include <cmath>
38
39
using
xAOD::CaloCluster
;
40
using
CaloClusterCorr::interpolate
;
41
42
const
float
CaloSwEta1b_g3::s_strip_granularity
= 0.003125;
// 0.025/8
43
44
// make correction to one cluster.
45
void
CaloSwEta1b_g3::makeCorrection
(
const
Context& myctx,
46
CaloCluster
* lar_cluster)
const
47
{
48
// Only for barrel
49
if
(!lar_cluster->
inBarrel
())
50
return
;
51
52
const
CxxUtils::Array<2>
correction =
m_correction
(myctx);
53
const
CxxUtils::Array<1>
correction_bins =
m_correction_bins
(myctx);
54
const
int
correction_degree =
m_correction_degree
(myctx);
55
assert (correction.size(1)-1 == correction_bins.
size
());
56
57
float
eta
= lar_cluster->
etaSample
(CaloSampling::EMB1);
58
if
(
eta
== -999.)
return
;
59
float
aeta = fabs(
eta
);
60
float
u1 = fmod(aeta,
s_strip_granularity
);
61
62
// we evaluate the s-shape in each eta range
63
64
unsigned
int
shape[] = {correction_bins.
size
(), 2};
65
CaloRec::WritableArrayData<2>
w (shape);
66
67
for
(
unsigned
int
i=0; i<correction_bins.
size
(); i++) {
68
w[i][0] = correction_bins[i];
69
w[i][1] = interpolate (correction, u1, correction_degree, i+1);
70
};
71
72
// finally we interpolate for the actual eta2
73
float
deta =
m_correction_coef
(myctx) * interpolate (w, aeta,
m_interp_degree
(myctx));
74
if
(
eta
< 0)
75
deta = -deta;
76
77
// Make the correction
78
lar_cluster->
setEta
( CaloSampling::EMB1,
eta
- deta);
79
}
80
81
82
const
std::string&
CaloSwEta1b_g3::toolType
()
const
83
{
84
static
const
std::string typeName =
"CaloSwEta_g3"
;
85
return
typeName;
86
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
CaloSwEta1b_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
CaloSwEta1b_g3::m_correction_bins
Constant< CxxUtils::Array< 1 > > m_correction_bins
Definition
CaloSwEta1b_g3.h:60
CaloSwEta1b_g3::s_strip_granularity
static const float s_strip_granularity
Definition
CaloSwEta1b_g3.h:66
CaloSwEta1b_g3::toolType
virtual const std::string & toolType() const override
Definition
CaloSwEta1b_g3.cxx:82
CaloSwEta1b_g3::m_correction_degree
Constant< int > m_correction_degree
Definition
CaloSwEta1b_g3.h:61
CaloSwEta1b_g3::m_interp_degree
Constant< int > m_interp_degree
Definition
CaloSwEta1b_g3.h:62
CaloSwEta1b_g3::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
Definition
CaloSwEta1b_g3.cxx:45
CaloSwEta1b_g3::m_correction_coef
Constant< float > m_correction_coef
Definition
CaloSwEta1b_g3.h:63
CaloSwEta1b_g3::m_correction
Constant< CxxUtils::Array< 2 > > m_correction
Definition
CaloSwEta1b_g3.h:59
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