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
9// Author: Joe Taenzer <joseph.taenzer@cern.ch>
11#ifndef JETCALIBTOOLS_APPLYJETCALIBRATION_H
12#define JETCALIBTOOLS_APPLYJETCALIBRATION_H 1
13
14#include <string.h>
15
16#include <TString.h>
17#include <TEnv.h>
18
21
26
30
31
33 : public asg::AsgMetadataTool,
34 virtual public IJetCalibrationTool {
35
37
38public:
40 JetCalibrationTool(const std::string& name = "JetCalibrationTool");
41
44
45 enum jetScale { EM, LC, PFLOW };
46
47 StatusCode initialize() override;
48
49 StatusCode applyCalibration(xAOD::JetContainer&) const override;
50
51 // Get the nominal resolution
52 StatusCode getNominalResolutionData(const xAOD::Jet& jet, double& resolution) const override;
53 StatusCode getNominalResolutionMC( const xAOD::Jet& jet, double& resolution) const override;
54 StatusCode getNominalResolutionHist( const xAOD::Jet& jet, double& resolution, const TH2D* histo) const;
55
56private:
57 StatusCode calibrate(xAOD::Jet& jet, JetEventInfo& jetEventInfo) const;
58 //Set event by event info like rho, mu, NPV
59 StatusCode initializeEvent(JetEventInfo& jetEventInfo) const;
60 //Add an item to the vector of calibration steps
61 StatusCode getCalibClass(const TString& calibration);
62
63//Private members
64private:
65 SG::ReadHandleKey<xAOD::EventInfo> m_evtInfoKey{this, "EventInfoKey", "EventInfo"};
67 SG::ReadHandleKey<xAOD::VertexContainer> m_pvKey{this, "PrimaryVerticesContainerName", "PrimaryVertices"};
68 SG::ReadDecorHandleKey<xAOD::EventInfo> m_muKey {this, "averageInteractionsPerCrossingKey",
69 "EventInfo.averageInteractionsPerCrossing","Decoration for Average Interaction Per Crossing"};
70 SG::ReadDecorHandleKey<xAOD::EventInfo> m_actualMuKey {this, "actualInteractionsPerCrossing",
71 "EventInfo.actualInteractionsPerCrossing","Decoration for Actual Number of Interactions Per Crossing"};
72
73 //Variables for configuration
74 std::string m_jetAlgo;
75 std::string m_config;
76 std::string m_calibSeq;
77 std::string m_calibAreaTag;
78 std::string m_originScale;
79 bool m_devMode{};
80 bool m_isData{true};
81 std::string m_forceCampaign{};
87 std::string m_dir;
88 std::string m_eInfoName;
89 std::vector<TString> m_timeDependentInsituConfigs;
90 std::vector<double> m_runBins;
93 std::vector<TString> m_insituCombMassConfig;
97
98 //TEnv to hold the global text config
102
103 //Bools/enums to avoid string comparisons at run time
105 bool m_doBcid{true};
106 bool m_doJetArea{true};
107 bool m_doResidual{true};
108 bool m_doOrigin{true};
109 bool m_doGSC{true};
111
112 std::string m_gscDepth{"auto"}; // if not set then use the one defined in the config
113
114 std::vector<std::unique_ptr<JetCalibrationStep> > m_calibSteps;
116
117 // Try to use jet-attribute-specified origin vertex for calibration
119};
120
121#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".