ATLAS Offline Software
Loading...
Searching...
No Matches
JetCalibrationTool.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7// JetCalibrationTool.h
8// Header file for class JetCalibrationTool
10#ifndef JETCALIBTOOLS_APPLYJETCALIBRATION_H
11#define JETCALIBTOOLS_APPLYJETCALIBRATION_H 1
12
13#include <string.h>
14
15#include <TString.h>
16#include <TEnv.h>
17
20
25
29
30
32 : public asg::AsgMetadataTool,
33 virtual public IJetCalibrationTool {
34
36
37public:
39 JetCalibrationTool(const std::string& name = "JetCalibrationTool");
40
43
44 enum jetScale { EM, LC, PFLOW };
45
46 StatusCode initialize() override;
47
48 StatusCode applyCalibration(xAOD::JetContainer&) const override;
49
50 // Get the nominal resolution
51 StatusCode getNominalResolutionData(const xAOD::Jet& jet, double& resolution) const override;
52 StatusCode getNominalResolutionMC( const xAOD::Jet& jet, double& resolution) const override;
53 StatusCode getNominalResolutionHist( const xAOD::Jet& jet, double& resolution, const TH2D* histo) const;
54
55private:
56 StatusCode calibrate(xAOD::Jet& jet, JetEventInfo& jetEventInfo) const;
57 //Set event by event info like rho, mu, NPV
58 StatusCode initializeEvent(JetEventInfo& jetEventInfo) const;
59 //Add an item to the vector of calibration steps
60 StatusCode getCalibClass(const TString& calibration);
61
62//Private members
63private:
64 SG::ReadHandleKey<xAOD::EventInfo> m_evtInfoKey{this, "EventInfoKey", "EventInfo"};
66 SG::ReadHandleKey<xAOD::VertexContainer> m_pvKey{this, "PrimaryVerticesContainerName", "PrimaryVertices"};
67 SG::ReadDecorHandleKey<xAOD::EventInfo> m_muKey {this, "averageInteractionsPerCrossingKey",
68 "EventInfo.averageInteractionsPerCrossing","Decoration for Average Interaction Per Crossing"};
69 SG::ReadDecorHandleKey<xAOD::EventInfo> m_actualMuKey {this, "actualInteractionsPerCrossing",
70 "EventInfo.actualInteractionsPerCrossing","Decoration for Actual Number of Interactions Per Crossing"};
71
72 //Variables for configuration
73 std::string m_jetAlgo;
74 std::string m_config;
75 std::string m_calibSeq;
76 std::string m_calibAreaTag;
77 std::string m_originScale;
78 bool m_devMode{};
79 bool m_isData{true};
80 std::string m_forceCampaign{};
86 std::string m_dir;
87 std::string m_eInfoName;
88 std::vector<TString> m_timeDependentInsituConfigs;
89 std::vector<double> m_runBins;
92 std::vector<TString> m_insituCombMassConfig;
96
97 //TEnv to hold the global text config
99 std::vector<TEnv*> m_globalTimeDependentConfigs;
101
102 //Bools/enums to avoid string comparisons at run time
104 bool m_doBcid{true};
105 bool m_doJetArea{true};
106 bool m_doResidual{true};
107 bool m_doOrigin{true};
108 bool m_doGSC{true};
110
111 std::string m_gscDepth{"auto"}; // if not set then use the one defined in the config
112
113 std::vector<std::unique_ptr<JetCalibrationStep> > m_calibSteps;
115
116 // Try to use jet-attribute-specified origin vertex for calibration
118};
119
120#endif //> !JETCALIBTOOLS_APPLYJETCALIBRATION_H
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
class IJetCalibrationTool
IJetModifier is a dual-use tool interface for a tool that modifies a jet collection.
JetCalibrationTool(const std::string &name="JetCalibrationTool")
Constructor with parameters:
std::vector< double > m_runBins
std::vector< TString > m_timeDependentInsituConfigs
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
StatusCode calibrate(xAOD::Jet &jet, JetEventInfo &jetEventInfo) const
SG::ReadDecorHandleKey< xAOD::EventInfo > m_muKey
std::vector< TString > m_insituCombMassConfig
SG::ReadHandleKey< xAOD::EventShape > m_rhoKey
SG::ReadHandleKey< xAOD::VertexContainer > m_pvKey
std::vector< TEnv * > m_globalTimeDependentConfigs
std::vector< std::unique_ptr< JetCalibrationStep > > m_calibSteps
StatusCode initialize() override
Dummy implementation of the initialisation function.
std::string m_forceCalibFile_FastSim
StatusCode getNominalResolutionData(const xAOD::Jet &jet, double &resolution) const override
StatusCode getNominalResolutionHist(const xAOD::Jet &jet, double &resolution, const TH2D *histo) const
std::string m_forceCalibFile_PtResidual
StatusCode initializeEvent(JetEventInfo &jetEventInfo) const
StatusCode applyCalibration(xAOD::JetContainer &) const override
Apply calibration to a jet container.
std::string m_forceCalibFile_MC2MC
StatusCode getNominalResolutionMC(const xAOD::Jet &jet, double &resolution) const override
StatusCode getCalibClass(const TString &calibration)
~JetCalibrationTool()
Destructor:
std::string m_nJetContainerName
SG::ReadDecorHandleKey< xAOD::EventInfo > m_actualMuKey
std::vector< TEnv * > m_globalInsituCombMassConfig
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 dual-use tools that provide file metadata access.
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".