ATLAS Offline Software
APReweight.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
15 
17 #ifndef APReweight_h
18 #define APReweight_h
19 
20 #include "APReweightBase.h"
21 #include <string>
22 #include <vector>
23 
24 class TTree;
25 class TH1;
26 class TH1D;
27 class TAxis;
28 class APWeightEntry;
29 
30 class APReweight : public APReweightBase {
31 
32 public:
33  APReweight();
34  APReweight(TTree* denominator, const std::string& denominator_branch, TTree* numerator, const std::string& numerator_branch, unsigned int n_bins, double x_min, double x_max, bool isTrig = false);
35  APReweight(std::vector< double > denominator, std::vector< double > numerator, unsigned int n_bins, double x_min, double x_max, bool isTrig = false);
36  APReweight(TH1* denominator_in, TH1* numerator_in, bool isTrig = false);
37  virtual ~APReweight();
39  void ReadEfficiency(TH1* efficiency_in, TH1* err_low_in, TH1* err_high_in = 0);
41  APWeightEntry* GetBinWeight(unsigned int bin) const;
42  APWeightEntry* GetWeight(double value) const;
44  double GetSampleScale() const;
45  unsigned int NBins() const;
46  unsigned int GetBin(double value) const;
48  const TH1D* GetDenominatorHist() const;
49  const TH1D* GetNumeratorHist() const;
51  void SetSystUncert(double rel_uncert);
52  void SetQuietMode(bool isQuiet = true);
54  ClassDef(APReweight, 1)
55 
56 private:
57  TH1D* m_denominator_hist;
59  std::vector< APWeightEntry* > m_weights;
60  unsigned int m_n_bins;
61  TAxis *m_axis;
62 };
63 
64 #endif
APReweight::SetSystUncert
void SetSystUncert(double rel_uncert)
Set the global relative (!) systematic uncertainty of all efficiencies/weights.
Definition: APReweight.cxx:184
APWeightEntry
Definition: APWeightEntry.h:25
TH1D
Definition: rootspy.cxx:342
bin
Definition: BinsDiffFromStripMedian.h:43
athena.value
value
Definition: athena.py:122
APReweight::m_n_bins
unsigned int m_n_bins
Holds the amount of bins.
Definition: APReweight.h:60
APReweightBase
Definition: APReweightBase.h:23
APReweightBase.h
APReweight::~APReweight
virtual ~APReweight()
Default destructor.
Definition: APReweight.cxx:138
APReweight::ReadEfficiency
void ReadEfficiency(TH1 *efficiency_in, TH1 *err_low_in, TH1 *err_high_in=0)
Read efficiencies and upper/lower uncertainty (if numerator/denominator not applicable (e....
Definition: APReweight.cxx:120
APReweight::GetSampleScale
double GetSampleScale() const
Get scale factor that was calculated from sample sizes upon instantiation.
Definition: APReweight.cxx:166
APReweight::NBins
unsigned int NBins() const
Get amount of bins.
Definition: APReweight.cxx:170
ReadTripsProbsFromCool.denominator
denominator
Definition: ReadTripsProbsFromCool.py:96
APReweight::m_axis
TAxis * m_axis
Holds the axis of the APReweight instance (from input histograms).
Definition: APReweight.h:61
APReweight::APReweight
APReweight()
Default constructor.
Definition: APReweight.cxx:15
APReweight::GetDenominatorHist
const TH1D * GetDenominatorHist() const
Get original denominator histogram.
Definition: APReweight.cxx:158
APReweight::GetNumeratorHist
const TH1D * GetNumeratorHist() const
Get original numerator histogram.
Definition: APReweight.cxx:162
APReweight::m_numerator_hist
ClassDef(APReweight, 1) private TH1D * m_numerator_hist
< Holds the original denominator histogram.
Definition: APReweight.h:54
TH1
Definition: rootspy.cxx:268
APReweight::SetQuietMode
void SetQuietMode(bool isQuiet=true)
Sets the flag to turn off messages.
Definition: APReweight.cxx:190
APReweight::GetBinWeight
APWeightEntry * GetBinWeight(unsigned int bin) const
Get Weight entry for a given bin number.
Definition: APReweight.cxx:149
APReweight::m_weights
std::vector< APWeightEntry * > m_weights
Holds all weight entries.
Definition: APReweight.h:59
APReweight::GetBin
unsigned int GetBin(double value) const
Get bin number that corresponds to a given value.
Definition: APReweight.cxx:174
APReweight::GetWeight
APWeightEntry * GetWeight(double value) const
Get Weight entry for a given value.
Definition: APReweight.cxx:154
APReweight
Definition: APReweight.h:30