ATLAS Offline Software
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 #include <memory>
9 #include "TH1.h"
10 #include "TH2.h"
11 
13 #include "AsgTools/AsgTool.h"
15 
16 namespace JetHelper {
17 
20 
21 class HistoInputBase :public asg::AsgTool, virtual public IVarTool
22 {
24 
25  public:
27  HistoInputBase(const std::string& myname);
29  virtual ~HistoInputBase() {};
31  std::string getFileName() const { return m_fileName; };
33  std::string getHistName() const { return m_histName; };
34 
35  private:
37  Gaudi::Property< std::string > m_fileName { this, "inputfile", "JetUncertainties/CalibArea-08/rel21/Summer2019/R4_AllComponents.root", "File containing histograms" };
39  Gaudi::Property< std::string > m_histName { this, "histName", "Zjet_MuStat3_AntiKt4EMPFlow", "name of histrogram" };
40 
41  protected:
42  std::unique_ptr<TH1> m_hist ATLAS_THREAD_SAFE {};
46  double enforceAxisRange(const TAxis& axis, const double inputValue) const;
48  double readFromHisto(const double X, const double Y=0, const double Z=0) const;
49 
50 };
51 } // namespace JetHelper
52 #endif
JetHelper::HistoInputBase::readHistoFromFile
bool readHistoFromFile()
This function open the InputFile and assign the histogram to m_hist.
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
JetHelper::HistoInputBase::getFileName
std::string getFileName() const
Return the name of the file that containt the histograms.
Definition: HistoInputBase.h:31
JetHelper::HistoInputBase::m_histName
Gaudi::Property< std::string > m_histName
name of the histogram
Definition: HistoInputBase.h:39
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
JetHelper
class IJetCalibStep
Definition: IInputVariable.h:18
IVarTool.h
JetHelper::HistoInputBase
Class HistoInputBase This class implement common function used by HistoInput1D and HistoInput2D
Definition: HistoInputBase.h:22
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
JetHelper::HistoInputBase::getHistName
std::string getHistName() const
Return the name of the histogram.
Definition: HistoInputBase.h:33
JetHelper::HistoInputBase::~HistoInputBase
virtual ~HistoInputBase()
Destructor.
Definition: HistoInputBase.h:29
JetHelper::IVarTool
Definition: IVarTool.h:23
JetHelper::HistoInputBase::enforceAxisRange
double enforceAxisRange(const TAxis &axis, const double inputValue) const
This function ensure that the histogram is NOT evaluated outside range.
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
JetHelper::HistoInputBase::m_fileName
Gaudi::Property< std::string > m_fileName
path to the file with histrograms
Definition: HistoInputBase.h:37
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
JetHelper::HistoInputBase::ATLAS_THREAD_SAFE
std::unique_ptr< TH1 > m_hist ATLAS_THREAD_SAFE
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.
AsgTool.h
JetHelper::HistoInputBase::HistoInputBase
HistoInputBase(const std::string &myname)
Constructor for standalone usage.