ATLAS Offline Software
InsituDataCorrection.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 JETCALIBTOOLS_INSITUDATACORRECTION_H
6 #define JETCALIBTOOLS_INSITUDATACORRECTION_H 1
7 
8 /* Implementation of InsituDataCorrection class
9  * This class will apply the residual offset pile up correction
10  *
11  * Author: Joe Taenzer (joseph.taenzer@cern.ch)
12  * Date: August 15 2013
13  */
14 
15 #include <TROOT.h>
16 #include <TH2.h>
17 #include <TString.h>
19 #include <memory>
20 class TEnv;
21 class TH1;
22 
23 
25  : virtual public ::JetCalibrationStep
26 {
27 
28  public:
30  // optional first and last run arguments are for time-dependent in situ calibration.
31  // If lastRun is 0, all runs are calibrated (i.e. not time-dependent).
32  InsituDataCorrection(const std::string& name, TEnv * config, TString jetAlgo, TString calibAreaTag, bool dev, unsigned int firstRun = 0, unsigned int lastRun = 0);
34 
35  virtual StatusCode initialize() override;
36  virtual StatusCode calibrate(xAOD::Jet& jet, JetEventInfo& jetEventInfo) const override;
37 
38  inline double getRelHistoPtMax(){return m_relhistoPtMax;}
39  inline double getAbsHistoPtMax(){return m_abshistoPtMax;}
40 
41  private:
42  double getInsituCorr(double pt, double eta, const std::string& calibstep) const;
43  double getInsituCorr_JMS(double pt, double mass, double eta, const std::string& calibstep, bool isTAmass) const;
44  std::unique_ptr<const TH2> combineCalibration(const TH2* h2d, const TH1* h);
45  std::unique_ptr<const TH2> invertHistogram(const TH2* h2d);
46 
47  private:
48  TEnv * m_config{};
50  bool m_dev{};
51 
52  std::unique_ptr<const TH2> m_insituCorr;
53  std::unique_ptr<const TH2> m_insituCorr_JMS;
54  std::unique_ptr<const TH2> m_insituCorr_JMS_TA;
57  std::unique_ptr<const TH2> m_insituCorr_ResidualMCbased;
59 
62 
65 
68 
69  unsigned int m_firstRun{};
70  unsigned int m_lastRun{};
71 };
72 
73 #endif
InsituDataCorrection::m_insituPtMax_JMS
double m_insituPtMax_JMS
Definition: InsituDataCorrection.h:55
InsituDataCorrection::combineCalibration
std::unique_ptr< const TH2 > combineCalibration(const TH2 *h2d, const TH1 *h)
Definition: InsituDataCorrection.cxx:407
InsituDataCorrection::m_insituPtMin_ResidualMCbased
double m_insituPtMin_ResidualMCbased
Definition: InsituDataCorrection.h:58
InsituDataCorrection::m_insituCorr
std::unique_ptr< const TH2 > m_insituCorr
Definition: InsituDataCorrection.h:52
InsituDataCorrection::m_insituCorr_JMS_TA
std::unique_ptr< const TH2 > m_insituCorr_JMS_TA
Definition: InsituDataCorrection.h:54
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
InsituDataCorrection
Definition: InsituDataCorrection.h:26
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
InsituDataCorrection::getRelHistoPtMax
double getRelHistoPtMax()
Definition: InsituDataCorrection.h:38
test_pyathena.pt
pt
Definition: test_pyathena.py:11
InsituDataCorrection::initialize
virtual StatusCode initialize() override
Definition: InsituDataCorrection.cxx:44
InsituDataCorrection::m_lastRun
unsigned int m_lastRun
Definition: InsituDataCorrection.h:70
InsituDataCorrection::m_insituMassMax_JMS
double m_insituMassMax_JMS
Definition: InsituDataCorrection.h:55
InsituDataCorrection::m_insituCorr_ResidualMCbased
std::unique_ptr< const TH2 > m_insituCorr_ResidualMCbased
Definition: InsituDataCorrection.h:57
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
InsituDataCorrection::m_jetAlgo
TString m_jetAlgo
Definition: InsituDataCorrection.h:49
InsituDataCorrection::m_insituEtaMax_JMS
double m_insituEtaMax_JMS
Definition: InsituDataCorrection.h:55
JetEventInfo
Definition: JetEventInfo.h:8
InsituDataCorrection::invertHistogram
std::unique_ptr< const TH2 > invertHistogram(const TH2 *h2d)
Definition: InsituDataCorrection.cxx:422
InsituDataCorrection::getInsituCorr_JMS
double getInsituCorr_JMS(double pt, double mass, double eta, const std::string &calibstep, bool isTAmass) const
Definition: InsituDataCorrection.cxx:364
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
InsituDataCorrection::m_applyInsituCaloTAjets
bool m_applyInsituCaloTAjets
Definition: InsituDataCorrection.h:66
InsituDataCorrection::m_relhistoPtMax
double m_relhistoPtMax
Definition: InsituDataCorrection.h:56
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InsituDataCorrection::m_insituEtaMax
double m_insituEtaMax
Definition: InsituDataCorrection.h:55
InsituDataCorrection::calibrate
virtual StatusCode calibrate(xAOD::Jet &jet, JetEventInfo &jetEventInfo) const override
Definition: InsituDataCorrection.cxx:209
InsituDataCorrection::m_applyRelativeandAbsoluteInsitu
bool m_applyRelativeandAbsoluteInsitu
Definition: InsituDataCorrection.h:60
InsituDataCorrection::m_insituEtaMax_ResidualMCbased
double m_insituEtaMax_ResidualMCbased
Definition: InsituDataCorrection.h:58
InsituDataCorrection::m_abshistoPtMax
double m_abshistoPtMax
Definition: InsituDataCorrection.h:56
InsituDataCorrection::m_applyEtaRestrictionRelativeandAbsolute
bool m_applyEtaRestrictionRelativeandAbsolute
Definition: InsituDataCorrection.h:61
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InsituDataCorrection::m_applyEtaRestrictionResidualMCbased
bool m_applyEtaRestrictionResidualMCbased
Definition: InsituDataCorrection.h:64
InsituDataCorrection::m_firstRun
unsigned int m_firstRun
Definition: InsituDataCorrection.h:69
InsituDataCorrection::getAbsHistoPtMax
double getAbsHistoPtMax()
Definition: InsituDataCorrection.h:39
InsituDataCorrection::m_insituMassMin_JMS
double m_insituMassMin_JMS
Definition: InsituDataCorrection.h:55
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
InsituDataCorrection::m_insituPtMax
double m_insituPtMax
Definition: InsituDataCorrection.h:55
h
ReadBchFromCool.lastRun
lastRun
Definition: ReadBchFromCool.py:278
InsituDataCorrection::m_applyInsituJMS
bool m_applyInsituJMS
Definition: InsituDataCorrection.h:67
InsituDataCorrection::InsituDataCorrection
InsituDataCorrection()
Definition: InsituDataCorrection.cxx:16
InsituDataCorrection::m_applyResidualMCbasedInsitu
bool m_applyResidualMCbasedInsitu
Definition: InsituDataCorrection.h:63
InsituDataCorrection::m_insituCorr_JMS
std::unique_ptr< const TH2 > m_insituCorr_JMS
Definition: InsituDataCorrection.h:53
InsituDataCorrection::m_dev
bool m_dev
Definition: InsituDataCorrection.h:50
InsituDataCorrection::~InsituDataCorrection
virtual ~InsituDataCorrection()
InsituDataCorrection::m_config
TEnv * m_config
Definition: InsituDataCorrection.h:48
JetCalibrationStep.h
InsituDataCorrection::m_calibAreaTag
TString m_calibAreaTag
Definition: InsituDataCorrection.h:49
InsituDataCorrection::m_insituPtMin
double m_insituPtMin
Definition: InsituDataCorrection.h:55
InsituDataCorrection::m_insituPtMin_JMS
double m_insituPtMin_JMS
Definition: InsituDataCorrection.h:55
InsituDataCorrection::m_insituPtMax_ResidualMCbased
double m_insituPtMax_ResidualMCbased
Definition: InsituDataCorrection.h:58
InsituDataCorrection::getInsituCorr
double getInsituCorr(double pt, double eta, const std::string &calibstep) const
Definition: InsituDataCorrection.cxx:331
JetCalibrationStep
Definition: JetCalibrationStep.h:20