ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaUtils
Root
electronPearShapeAlignmentCorrection.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
egammaUtils/electronPearShapeAlignmentCorrection.h
"
6
#include "
PathResolver/PathResolver.h
"
7
#include "TFile.h"
8
9
namespace
{
10
char
const
*
const
s_histoName =
"sdeta"
;
11
}
12
13
electronPearShapeAlignmentCorrection::electronPearShapeAlignmentCorrection
(
14
const
std::string& infile)
15
{
16
const
std::string path =
"EGammaVariableCorrection/"
+ infile;
17
std::unique_ptr<TFile>
file
=
18
std::make_unique<TFile>(
PathResolverFindCalibFile
(path).c_str());
19
if
(!
file
) {
20
throw
std::runtime_error(
21
"cannot find input file for pear shape correction"
);
22
}
23
24
m_sdeta
= std::unique_ptr<TH2>(
dynamic_cast<
TH2*
>
(
file
->Get(s_histoName)));
25
if
(!
m_sdeta
) {
26
throw
std::runtime_error(
"cannot find histogram for pear shape correction"
);
27
}
28
m_sdeta
->SetDirectory(
nullptr
);
29
}
30
31
double
32
electronPearShapeAlignmentCorrection::getDeltaEtaDistortion
(
33
const
float
eta
,
34
const
float
phi
)
const
35
{
36
const
int
binEta =
m_sdeta
->GetXaxis()->FindBin(
eta
);
37
const
int
binPhi =
m_sdeta
->GetYaxis()->FindBin(
phi
);
38
const
double
dEtaDistortion =
m_sdeta
->GetBinContent(binEta, binPhi);
39
return
dEtaDistortion;
40
}
41
42
double
43
electronPearShapeAlignmentCorrection::getDeltaEtaCorrection
(
44
const
float
eta
,
45
const
float
phi
)
const
46
{
47
return
(-1. *
getDeltaEtaDistortion
(
eta
,
phi
));
48
}
49
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
PathResolver.h
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition
PathResolver.cxx:325
electronPearShapeAlignmentCorrection::m_sdeta
std::unique_ptr< TH2 > m_sdeta
Definition
electronPearShapeAlignmentCorrection.h:34
electronPearShapeAlignmentCorrection::getDeltaEtaDistortion
double getDeltaEtaDistortion(const float eta, const float phi) const
get the correction to deltaEta
Definition
electronPearShapeAlignmentCorrection.cxx:32
electronPearShapeAlignmentCorrection::getDeltaEtaCorrection
double getDeltaEtaCorrection(const float eta, const float phi) const
Definition
electronPearShapeAlignmentCorrection.cxx:43
electronPearShapeAlignmentCorrection::electronPearShapeAlignmentCorrection
electronPearShapeAlignmentCorrection(const std::string &infile="rel22_210510/pearshapedistortion.root")
constructor (initialization reading a root file)
Definition
electronPearShapeAlignmentCorrection.cxx:13
electronPearShapeAlignmentCorrection.h
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.17.0