ATLAS Offline Software
Loading...
Searching...
No Matches
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
16
17#ifndef APReweight2D_h
18#define APReweight2D_h
19
20#include "APReweightBase.h"
21#include <vector>
22
23class TTree;
24class TH2;
25class TH2D;
26class TAxis;
27class APWeightEntry;
28
30
31public:
32 APReweight2D();
33 APReweight2D(TH2* denominator_in, TH2* numerator_in, bool isTrig = false);
34 virtual ~APReweight2D();
35
36 void ReadEfficiency(TH2* efficiency_in, TH2* err_low_in, TH2* err_high_in = 0);
37
38 APWeightEntry* GetBinWeight(unsigned int bin_x, unsigned int bin_y) const;
39 APWeightEntry* GetWeight(double value_x, double value_y) const;
40
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;
45
46 const TH2D* GetDenominatorHist() const;
47 const TH2D* GetNumeratorHist() const;
48
49 void SetSystUncert(double rel_uncert);
50 void SetQuietMode(bool isQuiet = true);
51
52 ClassDef(APReweight2D,1)
53
54private:
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
APWeightEntry * GetWeight(double value_x, double value_y) const
Get Weight entry for a given pair of values.
virtual ~APReweight2D()
Default destructor.
const TH2D * GetDenominatorHist() const
Get original denominator histogram.
unsigned int m_n_bins_y
Holds the amount of bins in Y.
unsigned int GetBinY(double value_y) const
Get bin number in Y that corresponds to a given value.
double GetSampleScale() const
Get scale factor that was calculated from sample sizes upon instantiation.
void SetSystUncert(double rel_uncert)
Set the global relative (!) systematic uncertainty of all efficiencies/weights.
unsigned int m_n_bins_x
Holds the amount of bins in X.
TAxis * m_axis_x
Holds the X axis of the APReweight2D instance (from input histograms).
TAxis * m_axis_y
Holds the Y axis of the APReweight2D instance (from input histograms).
ClassDef(APReweight2D, 1) private TH2D * m_numerator_hist
< Holds the original denominator histogram.
APReweight2D()
Default constructor.
const TH2D * GetNumeratorHist() const
Get original numerator histogram.
std::vector< std::vector< APWeightEntry * > > m_weights
Holds all weight entries.
void SetQuietMode(bool isQuiet=true)
Sets the flag to turn off messages.
unsigned int NBins() const
Get amount of bins.
unsigned int GetBinX(double value_x) const
Get bin number in X that corresponds to a given value.
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....
APWeightEntry * GetBinWeight(unsigned int bin_x, unsigned int bin_y) const
Get Weight entry for a given pair of bin numbers.
APReweightBase()
Default constructor.
Class to store a single weight entry (one bin).