ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetToolHelpers
JetToolHelpers
FuncInput1D.h
Go to the documentation of this file.
1
// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3
#ifndef JETTOOLHELPERS_FUNCINPUT1D_H
4
#define JETTOOLHELPERS_FUNCINPUT1D_H
5
6
// FuncInput1D
7
//
8
// Analogue of HistoInput1D that evaluates a TF1 instead of reading a
9
// histogram bin. The TF1 is built from a formula string with fixed
10
// parameters and range. The x value is provided by a VarTool and is
11
// clamped to the function range before evaluation.
12
13
#include "
AsgTools/AsgTool.h
"
14
#include "
AsgTools/PropertyWrapper.h
"
15
#include "
AsgTools/ToolHandle.h
"
16
17
#include "
JetAnalysisInterfaces/IVarTool.h
"
18
#include "
JetToolHelpers/JetContext.h
"
19
20
#include "
xAODJet/Jet.h
"
21
22
#include "TFormula.h"
23
24
#include <memory>
25
#include <string>
26
#include <vector>
27
28
namespace
JetHelper
{
29
30
class
FuncInput1D
:
public
asg::AsgTool
,
virtual
public
IVarTool
{
31
ASG_TOOL_CLASS
(
FuncInput1D
,
IVarTool
)
32
33
public
:
34
FuncInput1D
(
const
std::string& name);
35
virtual
~FuncInput1D
() =
default
;
36
37
virtual
StatusCode
initialize
()
override
;
38
40
virtual
float
getValue
(
const
xAOD::Jet
&
jet
,
const
JetContext
& ctx)
const override
;
41
42
private
:
43
// Tool providing x
44
ToolHandle<IVarTool>
m_vartool
{
this
,
"varTool1"
,
"VarTool"
,
"InputVariable instance"
};
45
46
// Function definition
47
Gaudi::Property<std::string>
m_formula
{
this
,
"Formula"
,
""
,
"TF1 formula in x and [0], [1], ..."
};
48
Gaudi::Property<std::vector<double>>
m_params
{
this
,
"Parameters"
, {},
"Function parameters"
};
49
Gaudi::Property<double>
m_xMin
{
this
,
"XMin"
, 0.0,
"Lower edge of the function range"
};
50
Gaudi::Property<double>
m_xMax
{
this
,
"XMax"
, 1.0,
"Upper edge of the function range"
};
51
52
// Behaviour outside the range
53
Gaudi::Property<bool>
m_clamp
{
this
,
"ClampToRange"
,
true
,
"Clamp x to [XMin, XMax] (otherwise return OutOfRangeValue)"
};
54
Gaudi::Property<float>
m_outOfRangeValue
{
this
,
"OutOfRangeValue"
, 999.99,
"Returned outside the range if ClampToRange is false"
};
55
56
std::unique_ptr<const TFormula>
m_func
;
57
};
58
59
}
// namespace JetHelper
60
61
#endif
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition
AsgToolMacros.h:68
AsgTool.h
Jet.h
IVarTool.h
JetContext.h
PropertyWrapper.h
ToolHandle.h
JetHelper::FuncInput1D::m_outOfRangeValue
Gaudi::Property< float > m_outOfRangeValue
Definition
FuncInput1D.h:54
JetHelper::FuncInput1D::m_clamp
Gaudi::Property< bool > m_clamp
Definition
FuncInput1D.h:53
JetHelper::FuncInput1D::m_vartool
ToolHandle< IVarTool > m_vartool
Definition
FuncInput1D.h:44
JetHelper::FuncInput1D::m_params
Gaudi::Property< std::vector< double > > m_params
Definition
FuncInput1D.h:48
JetHelper::FuncInput1D::getValue
virtual float getValue(const xAOD::Jet &jet, const JetContext &ctx) const override
Evaluate the function at the value returned by the VarTool.
JetHelper::FuncInput1D::~FuncInput1D
virtual ~FuncInput1D()=default
JetHelper::FuncInput1D::FuncInput1D
FuncInput1D(const std::string &name)
JetHelper::FuncInput1D::m_xMin
Gaudi::Property< double > m_xMin
Definition
FuncInput1D.h:49
JetHelper::FuncInput1D::m_xMax
Gaudi::Property< double > m_xMax
Definition
FuncInput1D.h:50
JetHelper::FuncInput1D::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
JetHelper::FuncInput1D::m_func
std::unique_ptr< const TFormula > m_func
Definition
FuncInput1D.h:56
JetHelper::FuncInput1D::m_formula
Gaudi::Property< std::string > m_formula
Definition
FuncInput1D.h:47
JetHelper::IVarTool
Definition
IVarTool.h:23
JetHelper::JetContext
Class JetContext Designed to read AOD information related to the event, N vertices,...
Definition
JetContext.h:27
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
JetHelper
class IJetCalibStep
Definition
IInputVariable.h:18
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
Generated on
for ATLAS Offline Software by
1.17.0