ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloClusterCorrection
src
CaloPhiParabola.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
7
NAME: CaloPhiParabola.cxx
8
PACKAGE: offline/Calorimter/CaloClusterCorrection
9
10
AUTHORS: Mohamed Aharrouche
11
CREATED: Jan 25, 2006
12
13
PURPOSE: corrects for the parabolic behavior in the E vs Phi curve
14
15
********************************************************************/
16
#include "
CaloPhiParabola.h
"
17
#include "
CaloDetDescr/CaloDetDescrManager.h
"
18
#include "
CaloClusterCorrection/interpolate.h
"
19
#include "CLHEP/Units/PhysicalConstants.h"
20
#include <cmath>
21
22
23
using
xAOD::CaloCluster
;
24
using
CaloClusterCorr::interpolate
;
25
26
void
CaloPhiParabola::makeTheCorrection
(
const
Context& myctx,
27
CaloCluster
* cluster,
28
const
CaloDetDescrElement
*
/*elt*/
,
29
float
/*eta*/
,
30
float
/*adj_eta*/
,
31
float
/*phi*/
,
32
float
/*adj_phi*/
,
33
CaloSampling::CaloSample
/*samp*/
)
34
const
35
{
36
const
CxxUtils::Array<2>
correction =
m_correction
(myctx);
37
const
CxxUtils::Array<1>
energies =
m_energies
(myctx);
38
const
int
degree =
m_degree
(myctx);
39
40
//
41
float
coefs[3];
42
43
unsigned
int
n_samples = energies.
size
();
44
if
(n_samples == 0) {
45
ATH_MSG_ERROR
(
"Empty energies vector"
);
46
return
;
47
}
48
49
unsigned
int
shape[] = {n_samples, 4};
50
CaloRec::WritableArrayData<2>
pol2Parm (shape);
51
52
53
for
(
unsigned
int
i=0;i<n_samples;i++)
54
{
55
pol2Parm[i][0] = energies[i];
56
for
(
unsigned
int
j=0;j<3;j++)
57
{
58
pol2Parm[i][j+1] = correction[i][j];
59
}
60
}
61
62
63
float
energy = cluster->
e
();
64
for
(
unsigned
int
k=0; k<3;k++)
65
{
66
if
(energy < energies[0])
67
coefs[k] = pol2Parm[0][k+1];
68
else
if
(energy > energies[n_samples-1])
69
coefs[k] = pol2Parm[n_samples-1][k+1];
70
else
71
coefs[k] = interpolate (pol2Parm, energy, degree, k+1);
72
}
73
74
//
75
float
phi2 = cluster->
phiBE
(2);
76
77
float
mod = coefs[0]+coefs[1]*phi2+coefs[2]*phi2*phi2;
78
79
//
80
setenergy
(cluster, cluster->
e
() / mod);
81
}
82
83
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloPhiParabola.h
CaloClusterCorrection::setenergy
virtual void setenergy(xAOD::CaloCluster *cluster, float energy) const
Definition
CaloClusterCorrection.cxx:93
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::phiBE
double phiBE(int sampling) const
EMB/EMEC combined barycenter .
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:1209
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloPhiParabola::m_correction
Constant< CxxUtils::Array< 2 > > m_correction
Definition
CaloPhiParabola.h:40
CaloPhiParabola::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
CaloPhiParabola.cxx:26
CaloPhiParabola::m_degree
Constant< int > m_degree
Definition
CaloPhiParabola.h:42
CaloPhiParabola::m_energies
Constant< CxxUtils::Array< 1 > > m_energies
Definition
CaloPhiParabola.h:41
CaloSampling::CaloSample
CaloSample
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
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