ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloClusterCorrection
src
CaloTopoEMphioff.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: CaloTopoEMphioff.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 "
CaloTopoEMphioff.h
"
21
#include "CLHEP/Units/SystemOfUnits.h"
22
#include "
CaloDetDescr/CaloDetDescrManager.h
"
23
#include "
CaloGeoHelpers/CaloPhiRange.h
"
24
#include <cmath>
25
26
using
CLHEP::GeV;
27
28
29
// make correction to one cluster
30
void
CaloTopoEMphioff::makeTheCorrection
(
const
Context& myctx,
31
xAOD::CaloCluster
* cluster,
32
const
CaloDetDescrElement
* elt,
33
float
/*eta*/
,
34
float
adj_eta,
35
float
phi
,
36
float
/*adj_phi*/
,
37
CaloSampling::CaloSample
/*samp*/
)
const
38
{
39
float
qphioff = 0.;
40
float
aeta = fabs(adj_eta);
41
float
eclus = cluster->
e
() * (1./
GeV
);
42
int
iEtaBin = (int)(aeta/
m_Granularity
(myctx));
43
// compute CaloSampling
44
CaloSampling::CaloSample
samp = (
CaloSampling::CaloSample
)elt->
getSampling
();
45
46
if
(eclus <= 0)
47
return
;
48
49
ATH_MSG_DEBUG
(
" ... phi-off BEGIN"
<<
endmsg
);
50
ATH_MSG_DEBUG
(
" ... e, eta, phi "
<< cluster->
e
() <<
" "
<< cluster->
eta
() <<
" "
<< cluster->
phi
() <<
" "
<< samp <<
endmsg
);
51
52
const
CxxUtils::Array<1>
EtaFrontier =
m_EtaFrontier
(myctx);
53
54
// Compute the correction
55
if
(aeta < EtaFrontier[0])
56
{
57
qphioff =
m_EdepA
(myctx)[iEtaBin]/sqrt(eclus) +
m_EdepB
(myctx)[iEtaBin];
58
}
59
else
if
(aeta < EtaFrontier[2])
60
{
61
qphioff =
m_EdepA
(myctx)[iEtaBin]/eclus +
m_EdepB
(myctx)[iEtaBin];
62
qphioff = -qphioff;
63
if
(aeta > EtaFrontier[1]) qphioff -=
m_EndcapOffset
(myctx);
64
}
65
else
if
(aeta < EtaFrontier[3])
66
{
67
qphioff =
m_EdepA
(myctx)[iEtaBin]*eclus +
m_EdepB
(myctx)[iEtaBin];
68
qphioff -=
m_EndcapOffset
(myctx);
69
}
70
else
// wrong eta value
71
{
72
return
;
73
}
74
75
// Flip the sign, if needed.
76
if
(
m_FlipPhi
(myctx) && elt->
eta_raw
() < 0)
77
qphioff = -qphioff;
78
79
// Print out the function for debugging
80
ATH_MSG_DEBUG
(
" ... Phi off "
<< qphioff <<
" "
<< adj_eta <<
" "
<< eclus <<
" "
<< iEtaBin <<
endmsg
);
81
82
// Apply the correction
83
phi
=
CaloPhiRange::fix
(
phi
+ qphioff);
84
cluster->
setPhi
(samp,
phi
);
85
86
ATH_MSG_DEBUG
(
" ... phi-off END"
<<
endmsg
);
87
ATH_MSG_DEBUG
(
" ... e, eta, phi "
<< cluster->
e
() <<
" "
<< cluster->
eta
() <<
" "
<< cluster->
phi
() <<
" "
<< samp <<
endmsg
);
88
}
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:61
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloPhiRange.h
CaloPhiRange class declaration.
CaloTopoEMphioff.h
GeV
#define GeV
Definition
PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
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
CaloPhiRange::fix
static double fix(double phi)
Definition
CaloPhiRange.cxx:14
CaloSampling::CaloSample
CaloSample
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloTopoEMphioff::m_EdepA
Constant< CxxUtils::Array< 1 > > m_EdepA
Definition
CaloTopoEMphioff.h:56
CaloTopoEMphioff::m_EndcapOffset
Constant< float > m_EndcapOffset
Definition
CaloTopoEMphioff.h:62
CaloTopoEMphioff::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
CaloTopoEMphioff.cxx:30
CaloTopoEMphioff::m_EdepB
Constant< CxxUtils::Array< 1 > > m_EdepB
Definition
CaloTopoEMphioff.h:57
CaloTopoEMphioff::m_EtaFrontier
Constant< CxxUtils::Array< 1 > > m_EtaFrontier
Definition
CaloTopoEMphioff.h:58
CaloTopoEMphioff::m_FlipPhi
Constant< int > m_FlipPhi
Definition
CaloTopoEMphioff.h:61
CaloTopoEMphioff::m_Granularity
Constant< float > m_Granularity
Definition
CaloTopoEMphioff.h:60
CxxUtils::Array
Read-only multidimensional array.
Definition
Control/CxxUtils/CxxUtils/Array.h:135
xAOD::CaloCluster_v1::setPhi
bool setPhi(const CaloSample sampling, const float phi)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
Definition
CaloCluster_v1.cxx:549
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::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