ATLAS Offline Software
Loading...
Searching...
No Matches
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
7#include "TFile.h"
8
9namespace {
10char const * const s_histoName = "sdeta";
11}
12
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
31double
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
42double
44 const float eta,
45 const float phi) const
46{
47 return (-1. * getDeltaEtaDistortion(eta, phi));
48}
49
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
double getDeltaEtaDistortion(const float eta, const float phi) const
get the correction to deltaEta
double getDeltaEtaCorrection(const float eta, const float phi) const
electronPearShapeAlignmentCorrection(const std::string &infile="rel22_210510/pearshapedistortion.root")
constructor (initialization reading a root file)
TFile * file