ATLAS Offline Software
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 
29 class TAxis;
30 
31 namespace PUCorrection {
32  struct PU3DCorrectionHelper;
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_originScale {this, "OriginScale", "", "scale from which correction is applied" };
114 
115 };
116 
117 #endif
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
Pileup1DResidualCalibStep::calibrate
virtual StatusCode calibrate(xAOD::JetContainer &jetCont) const override
Apply calibration to a jet container.
Definition: Pileup1DResidualCalibStep.cxx:105
Pileup1DResidualCalibStep::m_originScale
Gaudi::Property< std::string > m_originScale
Definition: Pileup1DResidualCalibStep.h:113
Pileup1DResidualCalibStep::m_applyNPVBeamspotCorrection
Gaudi::Property< bool > m_applyNPVBeamspotCorrection
Definition: Pileup1DResidualCalibStep.h:106
Pileup1DResidualCalibStep::m_doOnlyResidual
Gaudi::Property< bool > m_doOnlyResidual
Definition: Pileup1DResidualCalibStep.h:111
PUCorrection
Definition: JetPileupCorrection.h:23
EventShape.h
Pileup1DResidualCalibStep::getNPVBeamspotCorrection
double getNPVBeamspotCorrection(double NPV) const
Definition: Pileup1DResidualCalibStep.cxx:267
Pileup1DResidualCalibStep::m_corrDesc
Gaudi::Property< std::string > m_corrDesc
Definition: Pileup1DResidualCalibStep.h:97
Pileup1DResidualCalibStep::m_doMuOnly
Gaudi::Property< bool > m_doMuOnly
Definition: Pileup1DResidualCalibStep.h:78
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
Pileup1DResidualCalibStep
Definition: Pileup1DResidualCalibStep.h:37
Pileup1DResidualCalibStep::m_isData
Gaudi::Property< bool > m_isData
Definition: Pileup1DResidualCalibStep.h:67
Pileup1DResidualCalibStep::m_npvBeamspotCorr
NPVBeamspotCorrection * m_npvBeamspotCorr
Definition: Pileup1DResidualCalibStep.h:107
IJetCalibStep.h
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Pileup1DResidualCalibStep::m_resOffsetBins
TAxis * m_resOffsetBins
Definition: Pileup1DResidualCalibStep.h:103
Pileup1DResidualCalibStep::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: Pileup1DResidualCalibStep.cxx:27
Pileup1DResidualCalibStep::m_offsetEtaBins
Gaudi::Property< std::vector< double > > m_offsetEtaBins
Definition: Pileup1DResidualCalibStep.h:99
Pileup1DResidualCalibStep::m_nJetContainerKey
SG::ReadHandleKey< xAOD::JetContainer > m_nJetContainerKey
Definition: Pileup1DResidualCalibStep.h:87
Pileup1DResidualCalibStep::m_resOffsetNjet
Gaudi::Property< std::vector< double > > m_resOffsetNjet
Definition: Pileup1DResidualCalibStep.h:101
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
PU3DCorrectionHelper
Pileup1DResidualCalibStep::m_muKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_muKey
Definition: Pileup1DResidualCalibStep.h:70
Pileup1DResidualCalibStep::m_nJet_ref
Gaudi::Property< float > m_nJet_ref
Definition: Pileup1DResidualCalibStep.h:84
Pileup1DResidualCalibStep::m_calibFile
Gaudi::Property< std::string > m_calibFile
Definition: Pileup1DResidualCalibStep.h:94
Pileup1DResidualCalibStep::m_useNjet
Gaudi::Property< bool > m_useNjet
Definition: Pileup1DResidualCalibStep.h:90
jet::PileupComp::OffsetNPV
@ OffsetNPV
Definition: UncertaintyEnum.h:165
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Pileup1DResidualCalibStep::m_mu_ref
Gaudi::Property< float > m_mu_ref
Definition: Pileup1DResidualCalibStep.h:83
Pileup1DResidualCalibStep::m_doSequentialResidual
Gaudi::Property< bool > m_doSequentialResidual
Definition: Pileup1DResidualCalibStep.h:109
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Pileup1DResidualCalibStep::getResidualOffset
double getResidualOffset(double abseta, double mu, double NPV, int nJet, bool MuOnly, bool NOnly) const
Definition: Pileup1DResidualCalibStep.cxx:205
EventInfo.h
IJetCalibStep
Definition: IJetCalibStep.h:27
Pileup1DResidualCalibStep::Pileup1DResidualCalibStep
Pileup1DResidualCalibStep(const std::string &name="Pileup1DResidualCalibStep")
Definition: Pileup1DResidualCalibStep.cxx:21
jet::PileupComp::OffsetMu
@ OffsetMu
Definition: UncertaintyEnum.h:166
Pileup1DResidualCalibStep::m_NPV_ref
Gaudi::Property< float > m_NPV_ref
Definition: Pileup1DResidualCalibStep.h:82
VertexContainer.h
Pileup1DResidualCalibStep::m_corrName
Gaudi::Property< std::string > m_corrName
Definition: Pileup1DResidualCalibStep.h:96
Pileup1DResidualCalibStep::m_doNJetOnly
Gaudi::Property< bool > m_doNJetOnly
Definition: Pileup1DResidualCalibStep.h:80
Pileup1DResidualCalibStep::m_doNPVOnly
Gaudi::Property< bool > m_doNPVOnly
Definition: Pileup1DResidualCalibStep.h:79
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
Pileup1DResidualCalibStep::m_njetThreshold
Gaudi::Property< int > m_njetThreshold
Definition: Pileup1DResidualCalibStep.h:91
Pileup1DResidualCalibStep::m_resOffsetNPV
Gaudi::Property< std::vector< double > > m_resOffsetNPV
Definition: Pileup1DResidualCalibStep.h:102
Pileup1DResidualCalibStep::m_rhoKey
SG::ReadHandleKey< xAOD::EventShape > m_rhoKey
Definition: Pileup1DResidualCalibStep.h:74
Pileup1DResidualCalibStep::m_pvKey
SG::ReadHandleKey< xAOD::VertexContainer > m_pvKey
Definition: Pileup1DResidualCalibStep.h:75
Pileup1DResidualCalibStep::m_muSF
Gaudi::Property< float > m_muSF
Definition: Pileup1DResidualCalibStep.h:85
Pileup1DResidualCalibStep::m_doJetArea
Gaudi::Property< bool > m_doJetArea
Definition: Pileup1DResidualCalibStep.h:68
ToolHandle.h
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
AsgTool.h
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
Pileup1DResidualCalibStep::m_resOffsetMu
Gaudi::Property< std::vector< double > > m_resOffsetMu
Definition: Pileup1DResidualCalibStep.h:100
Pileup1DResidualCalibStep::getResidualOffsetET
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
Definition: Pileup1DResidualCalibStep.cxx:211
NPVBeamspotCorrection
Definition: NPVBeamspotCorrection.h:21