ATLAS Offline Software
HITowerWeightTool.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 HIEVENTUTILS_HITOWERWEIGHTTOOL_H
6 #define HIEVENTUTILS_HITOWERWEIGHTTOOL_H
7 
10 
11 #include <TH3F.h>
12 #include <TFile.h>
13 #include <string>
14 #include <map>
15 
16 
18 // Tool that gets the tower weights for by tower by tower
19 // difference in response during the HI jet reconstruction.
21 
22 class HITowerWeightTool : public extends<AthAlgTool, IHITowerWeightTool>
23 {
24  public:
25  HITowerWeightTool(const std::string& type, const std::string& name, const IInterface* parent);
26  virtual ~HITowerWeightTool() = default;
27  virtual StatusCode initialize() override;
28 
29  virtual float getEtaPhiResponse(float eta, float phi, int runIndex) const override;
30  virtual float getEtaPhiOffset(float eta, float phi, int runIndex) const override;
31  virtual float getWeight(float eta, float phi, int sampling) const override;
32  virtual float getWeightEta(float eta, float phi, int sampling) const override;
33  virtual float getWeightPhi(float eta, float phi, int sampling) const override;
34  virtual float getWeightMag(float eta, float phi, int sampling) const override;
35  virtual int getRunIndex(const EventContext& ctx) const override;
36 
37  private:
38  Gaudi::Property<bool> m_applycorrection{this, "ApplyCorrection", true , "If false, unit weigts are applied"};
39  // 226000-MC; 287931-PbPb 2015, 338037-XeXe 2017, 367384-PbPb 2018, 440101-PbPb 2022
40  Gaudi::Property<std::vector<int>> m_defaultRunNumbers{this, "DefaultRunNumbers", {226000,287931,338037,367384,440101} , "List of run numbers that will be used if the event run number is not found in the InputFile"};
41  Gaudi::Property<std::string> m_inputFile{this, "InputFile", "cluster.geo.HIJING_2018.root","File containing cluster geometric moments."};
42  Gaudi::Property<std::string> m_configDir{this, "ConfigDir", "HIJetCorrection/","Directory containing configuration file."};
43 
44  TH3F* m_h3W;
45  TH3F* m_h3Eta;
46  TH3F* m_h3Phi;
47  TH3F* m_h3Mag;
50  std::map<unsigned int, int> m_runMap;
51 };
52 
53 #endif
HITowerWeightTool::getEtaPhiResponse
virtual float getEtaPhiResponse(float eta, float phi, int runIndex) const override
Definition: HITowerWeightTool.cxx:38
HITowerWeightTool::m_h3Phi
TH3F * m_h3Phi
Definition: HITowerWeightTool.h:46
HITowerWeightTool::m_h3EtaPhiOffset
TH3F * m_h3EtaPhiOffset
Definition: HITowerWeightTool.h:49
HITowerWeightTool::m_inputFile
Gaudi::Property< std::string > m_inputFile
Definition: HITowerWeightTool.h:41
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
HITowerWeightTool::m_h3EtaPhiResponse
TH3F * m_h3EtaPhiResponse
Definition: HITowerWeightTool.h:48
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
HITowerWeightTool::getWeightMag
virtual float getWeightMag(float eta, float phi, int sampling) const override
Definition: HITowerWeightTool.cxx:32
HITowerWeightTool::m_h3W
TH3F * m_h3W
Definition: HITowerWeightTool.h:44
HITowerWeightTool::getWeightEta
virtual float getWeightEta(float eta, float phi, int sampling) const override
Definition: HITowerWeightTool.cxx:24
HITowerWeightTool::getWeight
virtual float getWeight(float eta, float phi, int sampling) const override
Definition: HITowerWeightTool.cxx:20
HITowerWeightTool::m_defaultRunNumbers
Gaudi::Property< std::vector< int > > m_defaultRunNumbers
Definition: HITowerWeightTool.h:40
HITowerWeightTool::m_applycorrection
Gaudi::Property< bool > m_applycorrection
Definition: HITowerWeightTool.h:38
HITowerWeightTool::HITowerWeightTool
HITowerWeightTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: HITowerWeightTool.cxx:8
HITowerWeightTool::getWeightPhi
virtual float getWeightPhi(float eta, float phi, int sampling) const override
Definition: HITowerWeightTool.cxx:28
HITowerWeightTool::getRunIndex
virtual int getRunIndex(const EventContext &ctx) const override
Definition: HITowerWeightTool.cxx:58
HITowerWeightTool::m_runMap
std::map< unsigned int, int > m_runMap
Definition: HITowerWeightTool.h:50
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HITowerWeightTool
Definition: HITowerWeightTool.h:23
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
IHITowerWeightTool.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
HITowerWeightTool::m_h3Eta
TH3F * m_h3Eta
Definition: HITowerWeightTool.h:45
HITowerWeightTool::~HITowerWeightTool
virtual ~HITowerWeightTool()=default
HITowerWeightTool::m_configDir
Gaudi::Property< std::string > m_configDir
Definition: HITowerWeightTool.h:42
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HITowerWeightTool::initialize
virtual StatusCode initialize() override
Definition: HITowerWeightTool.cxx:106
HITowerWeightTool::m_h3Mag
TH3F * m_h3Mag
Definition: HITowerWeightTool.h:47
HITowerWeightTool::getEtaPhiOffset
virtual float getEtaPhiOffset(float eta, float phi, int runIndex) const override
Definition: HITowerWeightTool.cxx:48