ATLAS Offline Software
Loading...
Searching...
No Matches
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
16
17#ifndef APReweight_h
18#define APReweight_h
19
20#include "APReweightBase.h"
21#include <string>
22#include <vector>
23
24class TTree;
25class TH1;
26class TH1D;
27class TAxis;
28class APWeightEntry;
29
30class APReweight : public APReweightBase {
31
32public:
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();
38
39 void ReadEfficiency(TH1* efficiency_in, TH1* err_low_in, TH1* err_high_in = 0);
40
41 APWeightEntry* GetBinWeight(unsigned int bin) const;
42 APWeightEntry* GetWeight(double value) const;
43
44 double GetSampleScale() const;
45 unsigned int NBins() const;
46 unsigned int GetBin(double value) const;
47
48 const TH1D* GetDenominatorHist() const;
49 const TH1D* GetNumeratorHist() const;
50
51 void SetSystUncert(double rel_uncert);
52 void SetQuietMode(bool isQuiet = true);
53
54 ClassDef(APReweight, 1)
55
56private:
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
APReweightBase()
Default constructor.
const TH1D * GetDenominatorHist() const
Get original denominator histogram.
APReweight()
Default constructor.
virtual ~APReweight()
Default destructor.
void SetQuietMode(bool isQuiet=true)
Sets the flag to turn off messages.
unsigned int m_n_bins
Holds the amount of bins.
Definition APReweight.h:60
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....
ClassDef(APReweight, 1) private TH1D * m_numerator_hist
< Holds the original denominator histogram.
Definition APReweight.h:54
double GetSampleScale() const
Get scale factor that was calculated from sample sizes upon instantiation.
APWeightEntry * GetWeight(double value) const
Get Weight entry for a given value.
APWeightEntry * GetBinWeight(unsigned int bin) const
Get Weight entry for a given bin number.
std::vector< APWeightEntry * > m_weights
Holds all weight entries.
Definition APReweight.h:59
unsigned int NBins() const
Get amount of bins.
const TH1D * GetNumeratorHist() const
Get original numerator histogram.
unsigned int GetBin(double value) const
Get bin number that corresponds to a given value.
TAxis * m_axis
Holds the axis of the APReweight instance (from input histograms).
Definition APReweight.h:61
void SetSystUncert(double rel_uncert)
Set the global relative (!) systematic uncertainty of all efficiencies/weights.
Class to store a single weight entry (one bin).