ATLAS Offline Software
ShowerDepthTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef EGAMMAUTILS_SHOWERDEPTHTOOL_H
6 #define EGAMMAUTILS_SHOWERDEPTHTOOL_H
7 
8 // System include(s).
9 #include <memory>
10 #include <optional>
11 #include <utility>
12 
13 // Forward declaration(s):
14 class TH1;
15 
16 namespace CP {
17 
19  public:
23  bool initialize();
24 
26  float getCorrectedShowerDepthEM1(float etas1, float phi,
27  bool isData = true) const;
28 
30  float getCorrectedShowerDepthEM2(float etas2, float phi,
31  bool isData = true) const;
32 
34  std::pair<float, float> getCorrectedRZ(float eta, float phi,
35  bool isData = true,
36  int sampling = 1) const;
37 
39  float getRZCorrection(float eta, float phi, bool isData = true) const;
40 
42  float getCorrectedEtaDirection(float zvertex, float eta, float phi,
43  bool isData = true, int sampling = 1) const;
44 
46  std::optional<float> getCaloPointingEta(float etas1, float etas2, float phi,
47  bool isData = true) const;
48 
50  static float getShowerDepthEM1(float etas1);
51 
53  static float getShowerDepthEM2(float etas2);
54 
56  static std::pair<float, float> getRZ(float eta, int sampling);
57 
58  static float getEtaDirection(float zvertex, float R, float z);
59 
60  private:
62  static std::unique_ptr<TH1> getHistoFromFile(const char* fileName,
63  const char* histoName);
64 
65  std::unique_ptr<TH1> m_hData;
66  std::unique_ptr<TH1> m_hMC;
67 };
68 
69 } // namespace CP
70 
71 #endif // ELECTRONISOLATIONSELECTION_SHOWERDEPTHTOOL_H
CP::ShowerDepthTool::getShowerDepthEM1
static float getShowerDepthEM1(float etas1)
Shower depth (in mm) vs.
Definition: ShowerDepthTool.cxx:61
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
CP::ShowerDepthTool::getCaloPointingEta
std::optional< float > getCaloPointingEta(float etas1, float etas2, float phi, bool isData=true) const
Eta direction from samplings 1 and 2 (pointing)
Definition: ShowerDepthTool.cxx:120
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
CP::ShowerDepthTool::getRZCorrection
float getRZCorrection(float eta, float phi, bool isData=true) const
Return the calorimeter displacement in R(Z) for barrel (endcap)
Definition: ShowerDepthTool.cxx:151
egammaParameters::zvertex
@ zvertex
pointing z at vertex reconstructed from the cluster
Definition: egammaParamDefs.h:270
CP::ShowerDepthTool::getCorrectedShowerDepthEM1
float getCorrectedShowerDepthEM1(float etas1, float phi, bool isData=true) const
Shower depth (in mm) on EM1 vs.
Definition: ShowerDepthTool.cxx:45
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::ShowerDepthTool::getCorrectedRZ
std::pair< float, float > getCorrectedRZ(float eta, float phi, bool isData=true, int sampling=1) const
Return the shower depth in R,Z considering misalignments.
Definition: ShowerDepthTool.cxx:135
CP::ShowerDepthTool
Definition: ShowerDepthTool.h:18
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
z
#define z
CP::ShowerDepthTool::getRZ
static std::pair< float, float > getRZ(float eta, int sampling)
Shower depth in R,Z for the given sampling.
Definition: ShowerDepthTool.cxx:107
CP::ShowerDepthTool::getCorrectedShowerDepthEM2
float getCorrectedShowerDepthEM2(float etas2, float phi, bool isData=true) const
Shower depth (in mm) on EM2 vs.
Definition: ShowerDepthTool.cxx:51
CP::ShowerDepthTool::ShowerDepthTool
ShowerDepthTool()
CP::ShowerDepthTool::~ShowerDepthTool
~ShowerDepthTool()
CP::ShowerDepthTool::getShowerDepthEM2
static float getShowerDepthEM2(float etas2)
Shower depth (in mm) vs.
Definition: ShowerDepthTool.cxx:83
CP::ShowerDepthTool::m_hMC
std::unique_ptr< TH1 > m_hMC
Definition: ShowerDepthTool.h:66
CP::ShowerDepthTool::getCorrectedEtaDirection
float getCorrectedEtaDirection(float zvertex, float eta, float phi, bool isData=true, int sampling=1) const
Eta direction from zvertex to the shower in the given sampling.
Definition: ShowerDepthTool.cxx:100
TH1
Definition: rootspy.cxx:268
CP::ShowerDepthTool::getEtaDirection
static float getEtaDirection(float zvertex, float R, float z)
Definition: ShowerDepthTool.cxx:190
python.grid.isData
def isData(dataset)
Definition: grid.py:491
CP::ShowerDepthTool::m_hData
std::unique_ptr< TH1 > m_hData
Definition: ShowerDepthTool.h:65
CP::ShowerDepthTool::initialize
bool initialize()
Function initialising the tool.
Definition: ShowerDepthTool.cxx:35
CP::ShowerDepthTool::getHistoFromFile
static std::unique_ptr< TH1 > getHistoFromFile(const char *fileName, const char *histoName)
Return TH1* from file given fileName, histoName.
Definition: ShowerDepthTool.cxx:194