ATLAS Offline Software
Loading...
Searching...
No Matches
Pileup1DResidualCalibStep.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_JETPILEUP1DRESIDUALCALIBSTEP_H
6#define JETCALIBTOOLS_JETPILEUP1DRESIDUALCALIBSTEP_H 1
7
8/* Pileup1DResidualCalibStep performs the 1 step of the jet calibration
9 *
10 * - area subtraction in the form pT_corr = pT - rho xpT_area
11 * - residual correction (1D version)
12 *
13 * Date: Jan 2024
14 */
15
19
20#include "AsgTools/AsgTool.h"
21#include "AsgTools/ToolHandle.h"
26
27
29class TAxis;
30
31namespace PUCorrection {
33}
34
36 virtual public IJetCalibStep
37{
38
40
41 public:
42 Pileup1DResidualCalibStep(const std::string& name="Pileup1DResidualCalibStep");
43
44 virtual StatusCode initialize() override;
45
46 // Apply calibration to jet inside given JetContainer (IJetCalibStep interface)
47 virtual StatusCode calibrate(xAOD::JetContainer& jetCont) const override;
48
49 // residual calculation (made public for debuging ?)
50 double getResidualOffset ( double abseta, double mu, double NPV, int nJet, bool MuOnly, bool NOnly ) const;
51
52 private:
53
54 // Internl helper function
55 double getResidualOffsetET(double abseta, double mu, double NPV, int nJet, bool MuOnly, bool NOnly,
56 const std::vector<double>& OffsetMu,
57 const std::vector<double>& OffsetNPV,
58 const std::vector<double>& OffsetNjet,
59 const TAxis *OffsetBins) const;
60
61
62 double getNPVBeamspotCorrection(double NPV) const;
63
64
65
66
67 Gaudi::Property<bool> m_isData{this, "IsData", false, ""};
68 Gaudi::Property<bool> m_doJetArea{this, "DoJetArea", false, "doc"};
69
70 SG::ReadDecorHandleKey<xAOD::EventInfo> m_muKey {this, "averageInteractionsPerCrossingKey",
71 "EventInfo.averageInteractionsPerCrossing","Decoration for Average Interaction Per Crossing"};
72
73
75 SG::ReadHandleKey<xAOD::VertexContainer> m_pvKey{this, "PrimaryVerticesContainerName", "PrimaryVertices"};
76
77
78 Gaudi::Property<bool> m_doMuOnly{this, "ApplyOnlyMuResidual", false, "doc"}; // only used in ResidualOffsetCorrection
79 Gaudi::Property<bool> m_doNPVOnly{this, "ApplyOnlyNPVResidual", false, "doc"}; // only used in ResidualOffsetCorrection
80 Gaudi::Property<bool> m_doNJetOnly{this, "ApplyOnlyNJetResidual", false, "doc"}; // only used in ResidualOffsetCorrection
81
82 Gaudi::Property<float> m_NPV_ref{this , "DefaultNPVRef", -99., ""};
83 Gaudi::Property<float> m_mu_ref{this , "DefaultMuRef", -99., ""};
84 Gaudi::Property<float> m_nJet_ref{this , "DefaultNjetRef", -99., ""};
85 Gaudi::Property<float> m_muSF{this , "MuScaleFactor", 1., ""};
86
88 "","a jet container such as HLT_xAOD__JetContainer_a4tcemsubjesISFS"};
89
90 Gaudi::Property<bool> m_useNjet{this , "UseNjet", false, ""};
91 Gaudi::Property<int> m_njetThreshold{this , "nJetThreshold", 20, ""};
92
93
94 Gaudi::Property<std::string> m_calibFile {this, "CalibFile", "none", "residual offset calib file"};
95
96 Gaudi::Property<std::string> m_corrName {this, "CorrectionName", "none", ""};
97 Gaudi::Property<std::string> m_corrDesc {this, "CorrectionDesc", "none", ""};
98
99 Gaudi::Property<std::vector<double> > m_offsetEtaBins{this, "AbsEtaBins", {} ,""};
100 Gaudi::Property<std::vector<double> > m_resOffsetMu{this, "MuTerm", {} ,""};
101 Gaudi::Property<std::vector<double> > m_resOffsetNjet{this, "nJetTerm", {} ,""};
102 Gaudi::Property<std::vector<double> > m_resOffsetNPV{this, "NPVTerm", {} ,""};
103 TAxis* m_resOffsetBins =nullptr;
104
105
106 Gaudi::Property<bool> m_applyNPVBeamspotCorrection{this, "ApplyNPVBeamspotCorrection", false, "doc"}; // only used in ResidualOffsetCorrection
108
109 Gaudi::Property<bool> m_doSequentialResidual{this, "DoSequentialResidual", false, "doc"};
110
111 Gaudi::Property<bool> m_doOnlyResidual {this, "OnlyResidual", false, ""};
112
113 Gaudi::Property<std::string> m_jetInScale {this, "InScale", "JetConstitScaleMomentum", "Starting jet scale" };
114 Gaudi::Property<std::string> m_jetOutScale {this, "OutScale", "JetPileupScaleMomentum", "Ending jet scale" };
115
116};
117
118#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Gaudi::Property< std::vector< double > > m_resOffsetNjet
Gaudi::Property< int > m_njetThreshold
Gaudi::Property< std::string > m_jetOutScale
Gaudi::Property< bool > m_doMuOnly
NPVBeamspotCorrection * m_npvBeamspotCorr
virtual StatusCode calibrate(xAOD::JetContainer &jetCont) const override
Apply calibration to a jet container.
Gaudi::Property< float > m_mu_ref
Gaudi::Property< bool > m_doJetArea
Gaudi::Property< bool > m_doSequentialResidual
Gaudi::Property< std::string > m_calibFile
Gaudi::Property< bool > m_applyNPVBeamspotCorrection
Gaudi::Property< std::string > m_jetInScale
double getNPVBeamspotCorrection(double NPV) const
Gaudi::Property< std::vector< double > > m_resOffsetNPV
SG::ReadHandleKey< xAOD::VertexContainer > m_pvKey
Gaudi::Property< std::string > m_corrDesc
double getResidualOffset(double abseta, double mu, double NPV, int nJet, bool MuOnly, bool NOnly) const
Gaudi::Property< float > m_NPV_ref
Gaudi::Property< std::vector< double > > m_resOffsetMu
Gaudi::Property< std::vector< double > > m_offsetEtaBins
Pileup1DResidualCalibStep(const std::string &name="Pileup1DResidualCalibStep")
SG::ReadHandleKey< xAOD::JetContainer > m_nJetContainerKey
Gaudi::Property< float > m_muSF
double getResidualOffsetET(double abseta, double mu, double NPV, int nJet, bool MuOnly, bool NOnly, const std::vector< double > &OffsetMu, const std::vector< double > &OffsetNPV, const std::vector< double > &OffsetNjet, const TAxis *OffsetBins) const
Gaudi::Property< bool > m_doOnlyResidual
Gaudi::Property< bool > m_doNJetOnly
SG::ReadDecorHandleKey< xAOD::EventInfo > m_muKey
Gaudi::Property< float > m_nJet_ref
Gaudi::Property< std::string > m_corrName
Gaudi::Property< bool > m_doNPVOnly
Gaudi::Property< bool > m_useNjet
SG::ReadHandleKey< xAOD::EventShape > m_rhoKey
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
JetContainer_v1 JetContainer
Definition of the current "jet container version".