ATLAS Offline Software
APReweight2D.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
15 
17 #ifndef APReweight2D_h
18 #define APReweight2D_h
19 
20 #include "APReweightBase.h"
21 #include <vector>
22 
23 class TTree;
24 class TH2;
25 class TH2D;
26 class TAxis;
27 class APWeightEntry;
28 
29 class APReweight2D : public APReweightBase {
30 
31 public:
32  APReweight2D();
33  APReweight2D(TH2* denominator_in, TH2* numerator_in, bool isTrig = false);
34  virtual ~APReweight2D();
36  void ReadEfficiency(TH2* efficiency_in, TH2* err_low_in, TH2* err_high_in = 0);
38  APWeightEntry* GetBinWeight(unsigned int bin_x, unsigned int bin_y) const;
39  APWeightEntry* GetWeight(double value_x, double value_y) const;
41  double GetSampleScale() const;
42  unsigned int NBins() const;
43  unsigned int GetBinX(double value_x) const;
44  unsigned int GetBinY(double value_y) const;
46  const TH2D* GetDenominatorHist() const;
47  const TH2D* GetNumeratorHist() const;
49  void SetSystUncert(double rel_uncert);
50  void SetQuietMode(bool isQuiet = true);
52  ClassDef(APReweight2D,1)
53 
54 private:
55  TH2D* m_denominator_hist;
57  std::vector< std::vector< APWeightEntry* > > m_weights;
58  unsigned int m_n_bins_x;
59  unsigned int m_n_bins_y;
60  TAxis *m_axis_x;
61  TAxis *m_axis_y;
62 };
63 
64 #endif
APReweight2D::GetBinWeight
APWeightEntry * GetBinWeight(unsigned int bin_x, unsigned int bin_y) const
Get Weight entry for a given pair of bin numbers.
Definition: APReweight2D.cxx:109
APReweight2D::APReweight2D
APReweight2D()
Default constructor.
Definition: APReweight2D.cxx:15
APReweight2D::GetNumeratorHist
const TH2D * GetNumeratorHist() const
Get original numerator histogram.
Definition: APReweight2D.cxx:122
APReweight2D::ReadEfficiency
void ReadEfficiency(TH2 *efficiency_in, TH2 *err_low_in, TH2 *err_high_in=0)
Read efficiencies and upper/lower uncertainty (if numerator/denominator not applicable (e....
Definition: APReweight2D.cxx:66
APWeightEntry
Definition: APWeightEntry.h:25
APReweight2D::GetDenominatorHist
const TH2D * GetDenominatorHist() const
Get original denominator histogram.
Definition: APReweight2D.cxx:118
APReweight2D::SetQuietMode
void SetQuietMode(bool isQuiet=true)
Sets the flag to turn off messages.
Definition: APReweight2D.cxx:162
APReweight2D::GetBinX
unsigned int GetBinX(double value_x) const
Get bin number in X that corresponds to a given value.
Definition: APReweight2D.cxx:134
APReweight2D::m_axis_y
TAxis * m_axis_y
Holds the Y axis of the APReweight2D instance (from input histograms).
Definition: APReweight2D.h:61
APReweightBase
Definition: APReweightBase.h:23
APReweightBase.h
APReweight2D
Definition: APReweight2D.h:29
APReweight2D::m_axis_x
TAxis * m_axis_x
Holds the X axis of the APReweight2D instance (from input histograms).
Definition: APReweight2D.h:60
APReweight2D::m_n_bins_x
unsigned int m_n_bins_x
Holds the amount of bins in X.
Definition: APReweight2D.h:58
APReweight2D::SetSystUncert
void SetSystUncert(double rel_uncert)
Set the global relative (!) systematic uncertainty of all efficiencies/weights.
Definition: APReweight2D.cxx:154
APReweight2D::GetWeight
APWeightEntry * GetWeight(double value_x, double value_y) const
Get Weight entry for a given pair of values.
Definition: APReweight2D.cxx:114
APReweight2D::NBins
unsigned int NBins() const
Get amount of bins.
Definition: APReweight2D.cxx:130
APReweight2D::GetBinY
unsigned int GetBinY(double value_y) const
Get bin number in Y that corresponds to a given value.
Definition: APReweight2D.cxx:144
APReweight2D::m_n_bins_y
unsigned int m_n_bins_y
Holds the amount of bins in Y.
Definition: APReweight2D.h:59
APReweight2D::m_weights
std::vector< std::vector< APWeightEntry * > > m_weights
Holds all weight entries.
Definition: APReweight2D.h:57
APReweight2D::~APReweight2D
virtual ~APReweight2D()
Default destructor.
Definition: APReweight2D.cxx:95
APReweight2D::GetSampleScale
double GetSampleScale() const
Get scale factor that was calculated from sample sizes upon instantiation.
Definition: APReweight2D.cxx:126
APReweight2D::m_numerator_hist
ClassDef(APReweight2D, 1) private TH2D * m_numerator_hist
< Holds the original denominator histogram.
Definition: APReweight2D.h:52