ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetToolHelpers
JetToolHelpers
HistoInputBase.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_HISTOINPUTBASE_H
6
#define JETTOOLHELPERS_HISTOINPUTBASE_H
7
8
9
#include "
JetAnalysisInterfaces/IVarTool.h
"
10
#include "
AsgTools/AsgTool.h
"
11
#include "
AsgTools/PropertyWrapper.h
"
12
13
#include "TH1.h"
//unique_ptr member, and d'tor defined here
14
#include <string>
15
#include <memory>
16
17
class
TAxis;
18
19
namespace
JetHelper
{
20
23
24
class
HistoInputBase
:
public
asg::AsgTool
,
virtual
public
IVarTool
25
{
26
ASG_TOOL_CLASS
(
HistoInputBase
,
IVarTool
)
27
28
public
:
30
HistoInputBase
(
const
std::string& myname);
32
virtual
~HistoInputBase
() {};
34
std::string
getFileName
()
const
{
return
m_fileName
; };
36
std::string
getHistName
()
const
{
return
m_histName
; };
38
TH1&
getHistogram
() {
return
*m_hist; };
39
40
private
:
42
Gaudi::Property< std::string >
m_fileName
{
this
,
"inputfile"
,
"JetUncertainties/CalibArea-08/rel21/Summer2019/R4_AllComponents.root"
,
"File containing histograms"
};
44
Gaudi::Property< std::string >
m_histName
{
this
,
"histName"
,
"Zjet_MuStat3_AntiKt4EMPFlow"
,
"name of histrogram"
};
45
46
protected
:
47
std::unique_ptr<TH1> m_hist
ATLAS_THREAD_SAFE
{};
49
bool
readHistoFromFile
();
51
double
enforceAxisRange
(
const
TAxis& axis,
const
double
inputValue)
const
;
53
double
readFromHisto
(
const
double
X,
const
double
Y=0,
const
double
Z=0)
const
;
54
// Interpolation strategies
55
Gaudi::Property<std::string>
m_interpStr
{
this
,
"InterpType"
,
"Full"
,
"Interpolation to run: Full/OnlyX/OnlyY/None"
};
56
enum class
InterpType
57
{
58
UNKNOWN
=0,
// Unknown/unset/etc
59
Full
,
// Full interpolation
60
None
,
// No interpolation
61
OnlyX
,
// Interpolate only in the x dimension
62
OnlyY
,
// Interpolate only in the y dimension
63
OnlyZ
// Interpolate only in the z dimension
64
};
65
InterpType
m_interpNum
{
InterpType::UNKNOWN
};
66
67
};
68
}
// namespace JetHelper
69
#endif
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition
AsgToolMacros.h:68
AsgTool.h
IVarTool.h
PropertyWrapper.h
None
@ None
Definition
TRIGGERidentity.h:17
JetHelper::HistoInputBase::InterpType
InterpType
Definition
HistoInputBase.h:57
JetHelper::HistoInputBase::InterpType::OnlyX
@ OnlyX
Definition
HistoInputBase.h:61
JetHelper::HistoInputBase::InterpType::OnlyY
@ OnlyY
Definition
HistoInputBase.h:62
JetHelper::HistoInputBase::InterpType::UNKNOWN
@ UNKNOWN
Definition
HistoInputBase.h:58
JetHelper::HistoInputBase::InterpType::Full
@ Full
Definition
HistoInputBase.h:59
JetHelper::HistoInputBase::InterpType::OnlyZ
@ OnlyZ
Definition
HistoInputBase.h:63
JetHelper::HistoInputBase::m_histName
Gaudi::Property< std::string > m_histName
name of the histogram
Definition
HistoInputBase.h:44
JetHelper::HistoInputBase::readHistoFromFile
bool readHistoFromFile()
This function open the InputFile and assign the histogram to m_hist.
JetHelper::HistoInputBase::~HistoInputBase
virtual ~HistoInputBase()
Destructor.
Definition
HistoInputBase.h:32
JetHelper::HistoInputBase::m_interpStr
Gaudi::Property< std::string > m_interpStr
Definition
HistoInputBase.h:55
JetHelper::HistoInputBase::getFileName
std::string getFileName() const
Return the name of the file that containt the histograms.
Definition
HistoInputBase.h:34
JetHelper::HistoInputBase::getHistName
std::string getHistName() const
Return the name of the histogram.
Definition
HistoInputBase.h:36
JetHelper::HistoInputBase::m_interpNum
InterpType m_interpNum
Definition
HistoInputBase.h:65
JetHelper::HistoInputBase::ATLAS_THREAD_SAFE
std::unique_ptr< TH1 > m_hist ATLAS_THREAD_SAFE
Definition
HistoInputBase.h:47
JetHelper::HistoInputBase::m_fileName
Gaudi::Property< std::string > m_fileName
path to the file with histrograms
Definition
HistoInputBase.h:42
JetHelper::HistoInputBase::readFromHisto
double readFromHisto(const double X, const double Y=0, const double Z=0) const
This function evaluate the histogram using the TH1::Interpolate.
JetHelper::HistoInputBase::HistoInputBase
HistoInputBase(const std::string &myname)
Constructor for standalone usage.
JetHelper::HistoInputBase::enforceAxisRange
double enforceAxisRange(const TAxis &axis, const double inputValue) const
This function ensure that the histogram is NOT evaluated outside range.
JetHelper::HistoInputBase::getHistogram
TH1 & getHistogram()
Returns the underlying histogram.
Definition
HistoInputBase.h:38
JetHelper::IVarTool
Definition
IVarTool.h:23
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
JetHelper
class IJetCalibStep
Definition
IInputVariable.h:18
Generated on
for ATLAS Offline Software by
1.17.0