ATLAS Offline Software
Loading...
Searching...
No Matches
APReweight3D.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 APReweight3D_h
18#define APReweight3D_h
19
20#include "APReweightBase.h"
21#include <vector>
22
23class TTree;
24class TH3;
25class TH3D;
26class TAxis;
27class APWeightEntry;
28
30
31public:
32 APReweight3D();
33 APReweight3D(TH3* denominator_in, TH3* numerator_in, bool isTrig = false);
34 virtual ~APReweight3D();
35
36 void ReadEfficiency(TH3* efficiency_in, TH3* err_low_in, TH3* err_high_in = 0);
37
38 APWeightEntry* GetBinWeight(unsigned int bin_x, unsigned int bin_y, unsigned int bin_z) const;
39 APWeightEntry* GetWeight(double value_x, double value_y, double value_z) 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 unsigned int GetBinZ(double value_z) const;
46
47 const TH3D* GetDenominatorHist() const;
48 const TH3D* GetNumeratorHist() const;
49
50 void SetSystUncert(double rel_uncert);
51 void SetQuietMode(bool isQuiet = true);
52
53 ClassDef(APReweight3D,1)
54
55private:
56 TH3D* m_denominator_hist;
58 std::vector< std::vector< std::vector< APWeightEntry* > > > m_weights;
59 unsigned int m_n_bins_x;
60 unsigned int m_n_bins_y;
61 unsigned int m_n_bins_z;
62 TAxis *m_axis_x;
63 TAxis *m_axis_y;
64 TAxis *m_axis_z;
65};
66
67#endif
unsigned int m_n_bins_y
Holds the amount of bins in Y.
virtual ~APReweight3D()
Default destructor.
APWeightEntry * GetBinWeight(unsigned int bin_x, unsigned int bin_y, unsigned int bin_z) const
Get Weight entry for a given triplet of bin numbers.
void ReadEfficiency(TH3 *efficiency_in, TH3 *err_low_in, TH3 *err_high_in=0)
Read efficiencies and upper/lower uncertainty (if numerator/denominator not applicable (e....
ClassDef(APReweight3D, 1) private TH3D * m_numerator_hist
< Holds the original denominator histogram.
TAxis * m_axis_z
Holds the Z axis of the APReweight3D instance (from input histograms).
std::vector< std::vector< std::vector< APWeightEntry * > > > m_weights
Holds all weight entries.
double GetSampleScale() const
Get scale factor that was calculated from sample sizes upon instantiation.
unsigned int m_n_bins_x
Holds the amount of bins in X.
unsigned int GetBinZ(double value_z) const
Get bin number in Z that corresponds to a given value.
const TH3D * GetNumeratorHist() const
Get original numerator histogram.
TAxis * m_axis_x
Holds the X axis of the APReweight3D instance (from input histograms).
unsigned int NBins() const
Get amount of bins.
APReweight3D()
Default constructor.
unsigned int m_n_bins_z
Holds the amount of bins in Z.
unsigned int GetBinY(double value_y) const
Get bin number in Y that corresponds to a given value.
unsigned int GetBinX(double value_x) const
Get bin number in X that corresponds to a given value.
APWeightEntry * GetWeight(double value_x, double value_y, double value_z) const
Get Weight entry for a given triplet of values.
void SetQuietMode(bool isQuiet=true)
Sets the flag to turn off messages.
void SetSystUncert(double rel_uncert)
Set the global relative (!) systematic uncertainty of all efficiencies/weights.
const TH3D * GetDenominatorHist() const
Get original denominator histogram.
TAxis * m_axis_y
Holds the Y axis of the APReweight3D instance (from input histograms).
APReweightBase()
Default constructor.
Class to store a single weight entry (one bin).