ATLAS Offline Software
Loading...
Searching...
No Matches
JetCalibTool.cxx
Go to the documentation of this file.
1
2
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
15JetCalibTool::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
54StatusCode JetCalibTool::getNominalResolutionData(const xAOD::Jet& jet, const JetHelper::JetContext& jcontext, double& resolution) const{
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
63StatusCode JetCalibTool::getNominalResolutionMC(const xAOD::Jet& jet, const JetHelper::JetContext& jcontext, double& resolution) const{
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading a decoration on an object.
JetCalibTool(const std::string &name="JetCalibTool")
Constructor with parameters:
virtual StatusCode calibrate(xAOD::JetContainer &) const override
Apply calibration to a jet container.
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
ToolHandle< IJetCalibStep > m_smearingTool
ToolHandleArray< IJetCalibStep > m_calibSteps
virtual StatusCode getNominalResolutionData(const xAOD::Jet &jet, const JetHelper::JetContext &, double &resolution) const override
virtual StatusCode getNominalResolutionMC(const xAOD::Jet &jet, const JetHelper::JetContext &, double &resolution) const override
Class JetContext Designed to read AOD information related to the event, N vertices,...
Definition JetContext.h:24
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".