ATLAS Offline Software
Loading...
Searching...
No Matches
EtaJESCorrection.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef JETCALIBTOOLS_ETAJESCORRECTION_H
6#define JETCALIBTOOLS_ETAJESCORRECTION_H 1
7
8/* Implementation of EtaJESCorrection class
9 * This class will apply the absolute EtaJES correction
10 *
11 * Author: Joe Taenzer (joseph.taenzer@cern.ch)
12 * Date: August 19 2013
13 */
14
15#include "TH1.h"
16#include "TString.h"
17#include <string>
18#include <vector>
19#include <memory>
20class TEnv;
21class TAxis;
22
23
25
27 : virtual public ::JetCalibrationStep
28{
29
30 public:
32 EtaJESCorrection(const std::string& name, TEnv * config, TString jetAlgo, TString calibAreaTag, bool mass, bool dev);
33 virtual ~EtaJESCorrection();
34
35 virtual StatusCode initialize() override;
36 virtual StatusCode calibrate(xAOD::Jet& jet, JetEventInfo&) const override;
37
38 private:
39 double getJES(double E_uncorr, double eta_det) const;
40 double getLowPtJES(double E_uncorr, double eta_det) const;
41 double getEtaCorr(double E_corr, double eta_det) const;
42 double getMassCorr(double E_corr, double eta_det) const;
43 double getLogPolN(const double *factors, double x) const;
44 double getLogPolNSlope(const double *factors, double x) const;
45 double getSplineCorr(const int etaBin, double E) const;
46 double getSplineSlope(const int ieta, const double minE) const;
47 void loadSplineHists(const TString & fileName, const std::string &etajes_name = "etaJes");
48
49 int getEtaBin(double eta_det) const;
50
51 private:
52 TEnv * m_config{};
53 TString m_jetAlgo;
55 bool m_mass{};
56 bool m_dev{};
58 bool m_isSpline{};
59
60 TString m_jesDesc;
62 unsigned int m_lowPtExtrap{};
63 double m_lowPtMinR{};
68
69 TAxis * m_etaBinAxis{};
70
71 // 90 eta bins, and up to 9 parameter for the pol-fit
72 const static unsigned int s_nEtaBins=90;
73 const static unsigned int s_nParMin=7;
74 const static unsigned int s_nParMax=9;
75 unsigned int m_nPar{}; // number of parameters in config file
85
86 // When using p-splines, the calibrations are stored as a finely binned TH1 for simplicity.
87 // This avoids importing new packages into Athena.
88 std::vector<std::unique_ptr<TH1> > m_etajesFactors;
89
90
91};
92
93#endif
#define x
double m_JESFactors[s_nEtaBins][s_nParMax]
virtual StatusCode calibrate(xAOD::Jet &jet, JetEventInfo &) const override
unsigned int m_lowPtExtrap
virtual StatusCode initialize() override
double getSplineSlope(const int ieta, const double minE) const
static const unsigned int s_nEtaBins
double m_JES_MinPt_Slopes[s_nEtaBins]
double m_JES_MinPt_R[s_nEtaBins]
double m_JMSFactors[s_nEtaBins][s_nParMax]
double getLogPolNSlope(const double *factors, double x) const
double getJES(double E_uncorr, double eta_det) const
static const unsigned int s_nParMax
double m_energyFreezeJES[s_nEtaBins]
double getEtaCorr(double E_corr, double eta_det) const
double getLowPtJES(double E_uncorr, double eta_det) const
double m_JES_MinPt_Param1[s_nEtaBins]
void loadSplineHists(const TString &fileName, const std::string &etajes_name="etaJes")
Loads the calib constants from histograms in TFile named fileName.
double getSplineCorr(const int etaBin, double E) const
static const unsigned int s_nParMin
double getMassCorr(double E_corr, double eta_det) const
std::vector< std::unique_ptr< TH1 > > m_etajesFactors
double m_etaCorrFactors[s_nEtaBins][s_nParMax]
double m_JES_MinPt_Param2[s_nEtaBins]
unsigned int m_nPar
int getEtaBin(double eta_det) const
double m_JES_MinPt_E[s_nEtaBins]
double getLogPolN(const double *factors, double x) const
JetCalibrationStep(const char *name="JetCalibrationStep")
Jet_v1 Jet
Definition of the current "jet version".