ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalSequentialCorrection.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_GLOBALSEQUENTIALCORRECTION_H
6#define JETCALIBTOOLS_GLOBALSEQUENTIALCORRECTION_H 1
7
8 /*
9 * Class definition of GlobalSequentialCorrection - see Root/GlobalSequentialCorrection.cxx for more details
10 * Joe Taenzer (joseph.taenzer@cern.ch), July 2014
11 */
12
13#include <TEnv.h>
14#include <TAxis.h>
15#include <TH2.h>
16
19
20#include <memory>
21
23 : virtual public ::JetCalibrationStep
24{
25
26 public:
27 //Some convenient typedefs
28 typedef std::vector<std::unique_ptr<const TH2>> VecTH2;
29 typedef std::vector<double> VecD;
30 typedef std::vector<TString> StrV;
31 typedef unsigned int uint;
32
34 GlobalSequentialCorrection(const std::string& name, TEnv * config, TString jetAlgo, const std::string& depth, TString calibAreaTag, bool useOriginVertex, bool dev); //Apply the full GS calibration by default
35
36 virtual StatusCode initialize() override;
37 virtual StatusCode calibrate(xAOD::Jet& jet, JetEventInfo&) const override;
38
39 private:
40 double getTrackWIDTHResponse(double pT, uint etabin, double trackWIDTH) const;
41 double getNTrkResponse(double pT, uint etabin, double nTrk) const;
42 double getTile0Response(double pT, uint etabin, double Tile0) const;
43 double getEM3Response(double pT, uint etabin, double EM3) const;
44 double getChargedFractionResponse(double pT, uint etabin, double ChargedFraction) const;
45 double getPunchThroughResponse(double E, double eta_det, int Nsegments) const;
46 double getCaloWIDTHResponse(double pT, uint etabin, double caloWIDTH) const;
47 double getN90ConstituentsResponse(double pT, uint etabin, double N90Constituents) const;
48 double getTileGap3Response(double pT, uint etabin, double TileGap3) const;
49
50 double getGSCCorrection(xAOD::JetFourMom_t jetP4, double eta,
51 double trackWIDTH, double nTrk, double Tile0, double EM3, int Nsegments, double ChargedFraction, double caloWIDTH, double N90Constituents, double TileGap3) const;
52
53 double getJetPropertyMax(TString jetPropName, unsigned int etabin) {
54 if ( jetPropName.Contains("EM3") && etabin < m_EM3MaxEtaBin ) return m_respFactorsEM3[etabin]->GetYaxis()->GetXmax();
55 else if ( jetPropName.Contains("Tile0") && etabin < m_Tile0MaxEtaBin ) return m_respFactorsTile0[etabin]->GetYaxis()->GetXmax();
56 else if ( jetPropName.Contains("nTrk") && etabin < m_nTrkMaxEtaBin ) return m_respFactorsnTrk[etabin]->GetYaxis()->GetXmax();
57 else if ( jetPropName.Contains("trackWIDTH") && etabin < m_trackWIDTHMaxEtaBin ) return m_respFactorstrackWIDTH[etabin]->GetYaxis()->GetXmax();
58 else if ( jetPropName.Contains("N90Constituents") && etabin < m_N90ConstituentsMaxEtaBin ) return m_respFactorsN90Constituents[etabin]->GetYaxis()->GetXmax();
59 else if ( jetPropName.Contains("caloWIDTH") && etabin < m_caloWIDTHMaxEtaBin ) return m_respFactorscaloWIDTH[etabin]->GetYaxis()->GetXmax();
60 else if ( jetPropName.Contains("TileGap3") && etabin < m_TileGap3MaxEtaBin ) return m_respFactorsTileGap3[etabin]->GetYaxis()->GetXmax();
61 else return 1;
62 }
63
64 void setPunchThroughEtaBins(const VecD& etabins) {
65 if (etabins.size()==0) ATH_MSG_ERROR("Please check that the punch through eta binning is properly set in your config file");
67 }
68
69 void setPunchThroughMinPt(double minPt) {
70 if (minPt < 0) ATH_MSG_ERROR("Error determining the punch through minimum pT");
71 m_punchThroughMinPt = minPt;
72 }
73
74 private:
75
76 double readPtJetPropertyHisto(double pT, double jetProperty,
77 const TH2& respFactors) const;
78
79 private:
81
82 //Private members set in the constructor
83 TEnv * m_config;
85 bool m_dev;
86
87 //Private members set during initialization
89 double m_binSize;
94 bool m_PFlow{false};
95 bool m_caloBased{false};
97 bool m_nTrkwTrk_4PFlow{false};
98 double m_turnOffStartingpT{1200.}, m_turnOffEndpT{2000};
99 bool m_useOriginVertex{false};
100
101};
102
103#endif
Scalar eta() const
pseudorapidity method
#define ATH_MSG_ERROR(x)
double getChargedFractionResponse(double pT, uint etabin, double ChargedFraction) const
void setPunchThroughEtaBins(const VecD &etabins)
double getEM3Response(double pT, uint etabin, double EM3) const
double getGSCCorrection(xAOD::JetFourMom_t jetP4, double eta, double trackWIDTH, double nTrk, double Tile0, double EM3, int Nsegments, double ChargedFraction, double caloWIDTH, double N90Constituents, double TileGap3) const
double getN90ConstituentsResponse(double pT, uint etabin, double N90Constituents) const
double getCaloWIDTHResponse(double pT, uint etabin, double caloWIDTH) const
virtual StatusCode initialize() override
double readPtJetPropertyHisto(double pT, double jetProperty, const TH2 &respFactors) const
virtual StatusCode calibrate(xAOD::Jet &jet, JetEventInfo &) const override
double getTrackWIDTHResponse(double pT, uint etabin, double trackWIDTH) const
double getTileGap3Response(double pT, uint etabin, double TileGap3) const
double getPunchThroughResponse(double E, double eta_det, int Nsegments) const
double getNTrkResponse(double pT, uint etabin, double nTrk) const
double getJetPropertyMax(TString jetPropName, unsigned int etabin)
double getTile0Response(double pT, uint etabin, double Tile0) const
std::vector< std::unique_ptr< const TH2 > > VecTH2
JetCalibrationStep(const char *name="JetCalibrationStep")
std::string depth
tag string for intendation
Definition fastadd.cxx:46
Jet_v1 Jet
Definition of the current "jet version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition JetTypes.h:17