ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloClusterCorrection
src
CaloTopoEMsshape.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
7
NAME: CaloTopoEsshape.cxx
8
PACKAGE: offline/Calorimeter/CaloClusterCorrection
9
10
AUTHORS: M.Boonekamp & N.Kerschen
11
CREATED: March 2005
12
13
PURPOSE: correction for the phi offset due to accordion structure
14
base class: CaloClusterCorrection (Algorithm)
15
16
Updated: March 12, 2005 (MB)
17
corrections for the TopoCluster
18
********************************************************************/
19
20
#include "
CaloTopoEMsshape.h
"
21
#include "
CaloGeoHelpers/CaloPhiRange.h
"
22
#include "GaudiKernel/MsgStream.h"
23
#include <cmath>
24
25
26
// make correction to one cluster
27
void
CaloTopoEMsshape::makeTheCorrection
(
const
Context& myctx,
28
xAOD::CaloCluster
* cluster,
29
const
CaloDetDescrElement
* elt,
30
float
eta
,
31
float
adj_eta,
32
float
/*phi*/
,
33
float
/*adj_phi*/
,
34
CaloSampling::CaloSample
/*samp*/
)
const
35
{
36
float
qsshape = 0.;
37
float
aeta = fabs(adj_eta);
38
int
iEtaBin = (int)(aeta/
m_Granularity
(myctx));
39
// u is the normalized coordinate along eta (within a cell)
40
// -0.5 < u < 0.5
41
float
u = (
eta
- elt->
eta
()) / elt->
deta
();
42
if
(elt->
eta_raw
() < 0) u = -u;
43
if
(u > 0.5) u = 0.5;
44
else
if
(u < -0.5) u = -0.5;
45
// compute CaloSampling
46
CaloSampling::CaloSample
samp = (
CaloSampling::CaloSample
)elt->
getSampling
();
47
48
ATH_MSG_DEBUG
(
" ... s-shapes BEGIN ; u = "
<< u <<
" "
<<
eta
<<
" "
<< adj_eta <<
" "
<< elt->
eta
() <<
" "
<< elt->
deta
() <<
endmsg
);
49
ATH_MSG_DEBUG
(
" ... e, eta, phi "
<< cluster->
e
() <<
" "
<< cluster->
eta
() <<
" "
<< cluster->
phi
() <<
" "
<< samp <<
endmsg
);
50
51
const
CxxUtils::Array<1>
EtaFrontier =
m_EtaFrontier
(myctx);
52
53
// Compute the correction
54
if
(aeta < EtaFrontier[0] || (aeta > EtaFrontier[1] && aeta < EtaFrontier[2]))
55
{
56
if
(samp == CaloSampling::EMB2 || samp == CaloSampling::EME2)
57
{
58
qsshape =
m_P0
(myctx)[iEtaBin]*0.01*std::atan(
m_P1
(myctx)[iEtaBin]*u)
59
+
m_P2
(myctx)[iEtaBin]*0.01*u +
m_P3
(myctx)[iEtaBin]*1e-3*fabs(u)
60
+
m_P4
(myctx)[iEtaBin]*1e-3;
61
}
62
else
// wrong samp value
63
{
64
return
;
65
}
66
}
67
else
// wrong eta value
68
{
69
return
;
70
}
71
72
// Print out the function for debugging
73
ATH_MSG_DEBUG
(
" ... S shape "
<< qsshape <<
" "
<< u <<
" "
<<
eta
<<
" "
<< elt->
eta
()
74
<<
" "
<< adj_eta <<
" "
<< aeta <<
" "
<< iEtaBin <<
" "
<< samp <<
endmsg
);
75
76
// Apply the correction
77
// ... there was a sign mistake here
79
if
(
eta
> 0) qsshape = -qsshape;
80
cluster->
setEta
(samp,
eta
+ qsshape);
81
82
ATH_MSG_DEBUG
(
" ... s-shapes END"
<<
endmsg
);
83
ATH_MSG_DEBUG
(
" ... e, eta, phi "
<< cluster->
e
() <<
" "
<< cluster->
eta
() <<
" "
<< cluster->
phi
() <<
" "
<< samp <<
endmsg
);
84
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
CaloPhiRange.h
CaloPhiRange class declaration.
CaloTopoEMsshape.h
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::eta_raw
float eta_raw() const
cell eta_raw
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:350
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
CaloDetDescrElement::eta
float eta() const
cell eta
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::deta
float deta() const
cell deta
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
CaloSampling::CaloSample
CaloSample
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloTopoEMsshape::m_EtaFrontier
Constant< CxxUtils::Array< 1 > > m_EtaFrontier
Definition
CaloTopoEMsshape.h:52
CaloTopoEMsshape::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
Virtual function for the correction-specific code.
Definition
CaloTopoEMsshape.cxx:27
CaloTopoEMsshape::m_Granularity
Constant< float > m_Granularity
Definition
CaloTopoEMsshape.h:53
CaloTopoEMsshape::m_P4
Constant< CxxUtils::Array< 1 > > m_P4
Definition
CaloTopoEMsshape.h:51
CaloTopoEMsshape::m_P2
Constant< CxxUtils::Array< 1 > > m_P2
Definition
CaloTopoEMsshape.h:49
CaloTopoEMsshape::m_P3
Constant< CxxUtils::Array< 1 > > m_P3
Definition
CaloTopoEMsshape.h:50
CaloTopoEMsshape::m_P0
Constant< CxxUtils::Array< 1 > > m_P0
Definition
CaloTopoEMsshape.h:47
CaloTopoEMsshape::m_P1
Constant< CxxUtils::Array< 1 > > m_P1
Definition
CaloTopoEMsshape.h:48
CxxUtils::Array
Read-only multidimensional array.
Definition
Control/CxxUtils/CxxUtils/Array.h:135
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition
CaloCluster_v1.cxx:251
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition
CaloCluster_v1.cxx:265
xAOD::CaloCluster_v1::setEta
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
Definition
CaloCluster_v1.cxx:534
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition
CaloCluster_v1.cxx:256
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