ATLAS Offline Software
Loading...
Searching...
No Matches
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
20namespace JetHelper {
21
25
26class 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
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Class InputVariable This is design to read any kind of xAOD::Jet or JetContext variable e....
Class JetContext Designed to read AOD information related to the event, N vertices,...
Definition JetContext.h:24
virtual StatusCode initialize() override
Function initialising the tool.
Gaudi::Property< std::string > m_type
Definition VarTool.h:47
Gaudi::Property< bool > m_isJetVar
Definition VarTool.h:49
const InputVariable * getvar() const
return the InputVariable ready to be use
Definition VarTool.h:37
VarTool(const std::string &name)
Constructor for standalone usage.
virtual float getValue(const xAOD::Jet &jet, const JetContext &jc) const override
return either xAOD or context variable values
Definition VarTool.h:39
Gaudi::Property< float > m_scale
Definition VarTool.h:48
Gaudi::Property< std::string > m_name
InputVariable properties, set in initialization.
Definition VarTool.h:46
std::unique_ptr< InputVariable > m_v
InputVariable for user.
Definition VarTool.h:44
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
class IJetCalibStep
Jet_v1 Jet
Definition of the current "jet version".