ATLAS Offline Software
VarTool.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 JETTOOLHELPERS_VARTOOL_H
6 #define JETTOOLHELPERS_VARTOOL_H
7 
8 
9 
12 #include "xAODJet/Jet.h"
13 #include "AsgTools/AsgTool.h" //inheritance
14 #include "JetAnalysisInterfaces/IVarTool.h" //inheritance
16 
17 #include <memory> //unique_ptr
18 #include <string>
19 
20 namespace JetHelper {
21 
25 
26 class VarTool : public asg::AsgTool, virtual public IVarTool
27 {
28 
30 
31  public:
33  VarTool(const std::string& name);
35  virtual StatusCode initialize() override;
37  const InputVariable * getvar() const {return m_v.get();};
39  virtual float getValue(const xAOD::Jet& jet, const JetContext& jc) const override {return m_v->getValue(jet,jc);};
40 
41 
42  private:
44  std::unique_ptr<InputVariable> m_v;
46  Gaudi::Property<std::string> m_name {this,"Name", "pt"};
47  Gaudi::Property<std::string> m_type {this,"Type", "float"};
48  Gaudi::Property<float> m_scale {this,"Scale", 1.};
49  Gaudi::Property<bool> m_isJetVar {this,"isJetVar", true};
50 };
51 } // namespace JetHelper
52 #endif
53 
Jet.h
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
JetHelper::InputVariable
Class InputVariable This is design to read any kind of xAOD::Jet or JetContext variable e....
Definition: InputVariable.h:27
InputVariable.h
JetHelper::VarTool::getValue
virtual float getValue(const xAOD::Jet &jet, const JetContext &jc) const override
return either xAOD or context variable values
Definition: VarTool.h:39
JetHelper::VarTool::m_v
std::unique_ptr< InputVariable > m_v
InputVariable for user.
Definition: VarTool.h:39
JetHelper::JetContext
Class JetContext Designed to read AOD information related to the event, N vertices,...
Definition: JetContext.h:24
JetHelper::VarTool::m_isJetVar
Gaudi::Property< bool > m_isJetVar
Definition: VarTool.h:49
JetHelper::VarTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
JetHelper
A tool interface class for tools implementing the IInputVariable interface.
Definition: IInputVariable.h:18
IVarTool.h
JetHelper::VarTool::getvar
const InputVariable * getvar() const
return the InputVariable ready to be use
Definition: VarTool.h:37
JetHelper::VarTool
Class VarTool This class is design to help the user by specializing the InputVariable InputVariable i...
Definition: VarTool.h:27
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
JetHelper::VarTool::m_name
Gaudi::Property< std::string > m_name
InputVariable properties, set in initialization.
Definition: VarTool.h:46
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
JetHelper::IVarTool
Definition: IVarTool.h:23
JetHelper::VarTool::m_type
Gaudi::Property< std::string > m_type
Definition: VarTool.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
JetHelper::VarTool::m_scale
Gaudi::Property< float > m_scale
Definition: VarTool.h:48
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
JetContext.h
JetHelper::VarTool::VarTool
VarTool(const std::string &name)
Constructor for standalone usage.
AsgTool.h