ATLAS Offline Software
JetCalibTool.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // JetCalibTool.cxx
8 // Implementation file for class JetCalibTool
10 
14 
15 JetCalibTool::JetCalibTool(const std::string& name)
16  : asg::AsgTool( name ){ }
17 
18 
19 
21 // Public methods:
23 
25  ATH_MSG_DEBUG ("Initializing " << name() );
26 
27  ATH_CHECK( m_calibSteps.retrieve());
28  if(!m_smearingTool.empty() ){
29  ATH_CHECK( m_smearingTool.retrieve());
30  }
31 
32  ATH_MSG_INFO("Jet calibration sequence :");
33  for(const ToolHandle<IJetCalibStep> &t : m_calibSteps){
34  ATH_MSG_INFO(" - "<< t->name() );
35  }
36  if(!m_smearingTool.empty() ){
37  ATH_MSG_INFO(" - "<< m_smearingTool->name() );
38  }
39 
40  return StatusCode::SUCCESS;
41 }
42 
43 
45 
46  ATH_MSG_DEBUG("calibrating jet collection.");
47  for(const ToolHandle<IJetCalibStep>& cstep: m_calibSteps){
48  ATH_CHECK( cstep->calibrate(jets) );
49  }
50  return StatusCode::SUCCESS;
51 }
52 
53 
55 
56  if(m_smearingTool.empty()){
57  ATH_MSG_ERROR("No smearing tool configured !");
58  return StatusCode::FAILURE;
59  }
60  return m_smearingTool->getNominalResolutionData(jet, jcontext, resolution);
61 }
62 
64  if(m_smearingTool.empty()){
65  ATH_MSG_ERROR("No smearing tool configured !");
66  return StatusCode::FAILURE;
67  }
68  return m_smearingTool->getNominalResolutionMC(jet, jcontext, resolution);
69 }
70 
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
JetHelper::JetContext
Class JetContext Designed to read AOD information related to the event, N vertices,...
Definition: JetContext.h:24
JetCalibTool.h
asg
Definition: DataHandleTestTool.h:28
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
JetCalibTool::getNominalResolutionMC
virtual StatusCode getNominalResolutionMC(const xAOD::Jet &jet, const JetHelper::JetContext &, double &resolution) const override
Definition: JetCalibTool.cxx:63
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
JetCalibTool::m_smearingTool
ToolHandle< IJetCalibStep > m_smearingTool
Definition: JetCalibTool.h:52
JetCalibTool::m_calibSteps
ToolHandleArray< IJetCalibStep > m_calibSteps
Definition: JetCalibTool.h:50
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
JetCalibTool::JetCalibTool
JetCalibTool(const std::string &name="JetCalibTool")
Constructor with parameters:
Definition: JetCalibTool.cxx:15
PathResolver.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetCalibTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetCalibTool.cxx:24
ReadDecorHandle.h
Handle class for reading a decoration on an object.
JetCalibTool::getNominalResolutionData
virtual StatusCode getNominalResolutionData(const xAOD::Jet &jet, const JetHelper::JetContext &, double &resolution) const override
Definition: JetCalibTool.cxx:54
JetCalibTool::calibrate
virtual StatusCode calibrate(xAOD::JetContainer &) const override
Apply calibration to a jet container.
Definition: JetCalibTool.cxx:44