ATLAS Offline Software
UncertaintyHistogram.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef JETUNCERTAINTIES_UNCERTAINTYHISTOGRAM_H
6 #define JETUNCERTAINTIES_UNCERTAINTYHISTOGRAM_H
7 
10 
12 
14 
15 #include "TString.h"
16 #include "TH1.h"
17 
18 class TFile;
19 class TAxis;
20 
21 namespace jet
22 {
23 
25 {
26  public:
27  // Constructor/destructor/initialization
32  virtual ~UncertaintyHistogram();
33  virtual StatusCode initialize(TFile* histFile);
34 
35  // Member retrieval methods
36  const TString& getName() const { return m_name; }
37  const TH1* getHisto() const { return m_histo; }
39  int getNumDim() const { return m_nDim; }
40 
41  // Histogram information access
42  double getValue(const double var1) const;
43  double getValue(const double var1, const double var2) const;
44  double getValue(const double var1, const double var2, const double var3) const;
45 
46  private:
47  // Private members
48  bool m_isInit;
49  const TString m_name;
51  TH1* m_histo;
52  int m_nDim;
53 
54  // Cache projections in case of 1-D interpolation in a 2-D or 3-D histogram
55  // For a 3-D histogram, it's [y][z] or [x][z] or [x][y] as appropriate
56  std::vector< std::vector< std::unique_ptr<TH1> > > m_cachedProj;
58 
59  // Histogram reading helpers
60  double readHisto(const double var1, const double var2=0, const double var3=0) const;
61  double checkBoundariesByBin(const TAxis* axis, const int numBins, const double valInput) const;
62  double checkBoundaries(const TAxis* axis, const int numBins, const double valInput) const;
63 
64 };
65 
66 } // end jet namespace
67 
68 
69 #endif
70 
jet::UncertaintyHistogram::getName
const TString & getName() const
Definition: UncertaintyHistogram.h:36
jet::UncertaintyHistogram::readHisto
double readHisto(const double var1, const double var2=0, const double var3=0) const
Definition: UncertaintyHistogram.cxx:178
jet::UncertaintyHistogram::getNumDim
int getNumDim() const
Definition: UncertaintyHistogram.h:39
jet::Interpolate::TypeEnum
TypeEnum
Definition: UncertaintyEnum.h:241
AddEmptyComponent.histName
string histName
Definition: AddEmptyComponent.py:64
jet::UncertaintyHistogram::checkBoundaries
double checkBoundaries(const TAxis *axis, const int numBins, const double valInput) const
Definition: UncertaintyHistogram.cxx:293
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
jet::UncertaintyHistogram::getHisto
const TH1 * getHisto() const
Definition: UncertaintyHistogram.h:37
jet::UncertaintyHistogram::m_interpolate
const Interpolate::TypeEnum m_interpolate
Definition: UncertaintyHistogram.h:50
JetHelpers.h
jet::UncertaintyHistogram::getValue
double getValue(const double var1) const
Definition: UncertaintyHistogram.cxx:141
UncertaintyEnum.h
jet::UncertaintyHistogram::initialize
virtual StatusCode initialize(TFile *histFile)
Definition: UncertaintyHistogram.cxx:85
AsgMessaging.h
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
jet::UncertaintyHistogram::UncertaintyHistogram
UncertaintyHistogram(const std::string &histName, const Interpolate::TypeEnum interpolate)
Definition: UncertaintyHistogram.cxx:28
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
jet::UncertaintyHistogram::m_name
const TString m_name
Definition: UncertaintyHistogram.h:49
jet::UncertaintyHistogram::m_isInit
bool m_isInit
Definition: UncertaintyHistogram.h:48
jet::UncertaintyHistogram::m_nDim
int m_nDim
Definition: UncertaintyHistogram.h:52
StatusCode.h
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
jet::UncertaintyHistogram
Definition: UncertaintyHistogram.h:25
jet::UncertaintyHistogram::m_cachedProj
std::vector< std::vector< std::unique_ptr< TH1 > > > m_cachedProj
Definition: UncertaintyHistogram.h:56
jet::UncertaintyHistogram::cacheProjections
StatusCode cacheProjections()
Definition: UncertaintyHistogram.cxx:322
jet::UncertaintyHistogram::getInterp
Interpolate::TypeEnum getInterp() const
Definition: UncertaintyHistogram.h:38
CaloClusterCorr::interpolate
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > &regions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.
Definition: interpolate.cxx:75
jet::UncertaintyHistogram::checkBoundariesByBin
double checkBoundariesByBin(const TAxis *axis, const int numBins, const double valInput) const
Definition: UncertaintyHistogram.cxx:270
jet::UncertaintyHistogram::~UncertaintyHistogram
virtual ~UncertaintyHistogram()
Definition: UncertaintyHistogram.cxx:79
jet::UncertaintyHistogram::m_histo
TH1 * m_histo
Definition: UncertaintyHistogram.h:51