ATLAS Offline Software
APWeightEntry.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 
18 #ifndef APWeightEntry_h
19 #define APWeightEntry_h
20 
21 #include "Rtypes.h"
22 
23 class TH1F;
24 
26 
27 public:
28  APWeightEntry();
29  APWeightEntry(unsigned int val_denominator, unsigned int val_numerator, double scale, bool isTrig = false);
30  virtual ~APWeightEntry();
32  void ReadEfficiency(double efficiency, double err_low, double err_high);
33  void SetCoordinates(const std::vector<int>& coords, const std::vector<int>& n_dim_origin);
34 
35  unsigned int GetValDenominator() const;
36  unsigned int GetValNumerator() const;
37  double GetExpectancy() const;
38  double GetVariance() const;
39  double GetStatUncertLow() const;
40  double GetStatUncertHigh() const;
41  double GetSysUncert() const;
42  double GetSysUncert2() const;
43  double GetRandom();
44  TH1F* GetPDF();
45  unsigned int GetID() const;
47  std::vector< int > GetCoords() const;
48  std::vector< int > GetOriginalDimensions() const;
50  bool IsNaN() const;
51  bool IsTrig() const;
53  void SetSystUncert(double rel_uncert);
54  void SetID(unsigned int id);
56 private:
59 
60  void _CreateHist();
61  void _ComputeCum();
63  unsigned int m_val_denominator;
64  unsigned int m_val_numerator;
66  double m_variance;
69  double m_sys_uncert;
70  double m_sys_uncert2;
72  bool m_is_trig;
73  bool m_is_nan;
74  unsigned int m_ID;
75  double m_integral;
76  double *m_pdf, *m_bins, *m_cumul;
78  std::vector<int> m_coords;
79  std::vector< int > m_n_dim_origin;
80 };
81 
82 #endif
APWeightEntry::m_coords
std::vector< int > m_coords
Holds the coordinates of the current entry in the original histogram.
Definition: APWeightEntry.h:78
APWeightEntry::m_pdf
double * m_pdf
Definition: APWeightEntry.h:76
APWeightEntry::GetID
unsigned int GetID() const
Returns the internal ID (used by APReweight/APReweight2D/APReweight3D/APReweightND).
Definition: APWeightEntry.cxx:248
APWeightEntry
Definition: APWeightEntry.h:25
APWeightEntry::SetCoordinates
void SetCoordinates(const std::vector< int > &coords, const std::vector< int > &n_dim_origin)
Definition: APWeightEntry.cxx:180
APWeightEntry::m_is_trig
bool m_is_trig
Flag, set to true if weight entry is trigger based.
Definition: APWeightEntry.h:72
APWeightEntry::GetValDenominator
unsigned int GetValDenominator() const
Get value of original denominator.
Definition: APWeightEntry.cxx:198
APWeightEntry::GetStatUncertLow
double GetStatUncertLow() const
Get lower bound of asymmetric statistical uncertainty.
Definition: APWeightEntry.cxx:214
APWeightEntry::GetSysUncert2
double GetSysUncert2() const
Get absolute systematic uncertainty squared value of efficiency/weight.
Definition: APWeightEntry.cxx:226
APWeightEntry::m_variance
double m_variance
Holds Variance of efficiency/weight (classical binomial/poisson model).
Definition: APWeightEntry.h:66
APWeightEntry::m_val_denominator
unsigned int m_val_denominator
Holds the value of original denominator.
Definition: APWeightEntry.h:63
APWeightEntry::_ComputeCum
void _ComputeCum()
Calculates the cumulative function of the pdf if necessary.
Definition: APWeightEntry.cxx:286
APWeightEntry::GetRandom
double GetRandom()
Get random number from PDF.
Definition: APWeightEntry.cxx:230
APWeightEntry::GetValNumerator
unsigned int GetValNumerator() const
Get value of original numerator.
Definition: APWeightEntry.cxx:202
APWeightEntry::GetPDF
TH1F * GetPDF()
Returns the calculated PDF.
Definition: APWeightEntry.cxx:243
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
APWeightEntry::m_stat_uncert_high
double m_stat_uncert_high
Holds upper bound of asymmetric statistical uncertainty.
Definition: APWeightEntry.h:68
APWeightEntry::~APWeightEntry
virtual ~APWeightEntry()
Default destructor.
Definition: APWeightEntry.cxx:188
APWeightEntry::m_sys_uncert
double m_sys_uncert
Holds absolute systematic uncertainty value of efficiency/weight.
Definition: APWeightEntry.h:69
APWeightEntry::operator=
APWeightEntry & operator=(const APWeightEntry &)
efficiency
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition: dependence.cxx:128
APWeightEntry::ReadEfficiency
void ReadEfficiency(double efficiency, double err_low, double err_high)
Read efficiencies and upper/lower uncertainty (if numerator/denominator not applicable (e....
Definition: APWeightEntry.cxx:168
APWeightEntry::GetVariance
double GetVariance() const
Get Variance of efficiency/weight (classical binomial/poisson model).
Definition: APWeightEntry.cxx:210
APWeightEntry::m_is_nan
bool m_is_nan
Flag, set to true if denominator is zero.
Definition: APWeightEntry.h:73
APWeightEntry::m_stat_uncert_low
double m_stat_uncert_low
Holds lower bound of asymmetric statistical uncertainty.
Definition: APWeightEntry.h:67
APWeightEntry::SetID
void SetID(unsigned int id)
Set the internal ID (used by APReweight/APReweight2D/APReweight3D/APReweightND).
Definition: APWeightEntry.cxx:273
APWeightEntry::SetSystUncert
void SetSystUncert(double rel_uncert)
Set the relative (!) systematic uncertainty for the efficiency/weight.
Definition: APWeightEntry.cxx:268
APWeightEntry::m_expectancy_val
double m_expectancy_val
Holds the Expectancy value of efficiency/weight.
Definition: APWeightEntry.h:65
APWeightEntry::IsNaN
bool IsNaN() const
Returns true if instance is NaN.
Definition: APWeightEntry.cxx:260
APWeightEntry::m_hist
TH1F * m_hist
Holds the TH1F instance from the arrays if computed.
Definition: APWeightEntry.h:77
APWeightEntry::m_val_numerator
unsigned int m_val_numerator
Holds the value of original numerator.
Definition: APWeightEntry.h:64
APWeightEntry::m_n_dim_origin
std::vector< int > m_n_dim_origin
Holds the amount of dimensions and bins per axis in the original histogram.
Definition: APWeightEntry.h:79
APWeightEntry::GetOriginalDimensions
std::vector< int > GetOriginalDimensions() const
Returns the dimensions and amounts of bins for each dimension of the original histogram.
Definition: APWeightEntry.cxx:256
APWeightEntry::APWeightEntry
APWeightEntry()
Default constructor.
Definition: APWeightEntry.cxx:20
APWeightEntry::IsTrig
bool IsTrig() const
Returns true if instance is trigger based.
Definition: APWeightEntry.cxx:264
APWeightEntry::_CreateHist
void _CreateHist()
Creates a TH1F instance from the arrays if necessary.
Definition: APWeightEntry.cxx:277
APWeightEntry::m_sys_uncert2
double m_sys_uncert2
Holds absolute systematic uncertainty squared value of efficiency/weight.
Definition: APWeightEntry.h:70
APWeightEntry::GetExpectancy
double GetExpectancy() const
Get Expectancy value of efficiency/weight.
Definition: APWeightEntry.cxx:206
APWeightEntry::m_integral
double m_integral
Holds the integral of the probability distribution.
Definition: APWeightEntry.h:75
APWeightEntry::GetCoords
std::vector< int > GetCoords() const
Returns the coordinates of the current entry in the original histogram.
Definition: APWeightEntry.cxx:252
APWeightEntry::GetStatUncertHigh
double GetStatUncertHigh() const
Get upper bound of asymmetric statistical uncertainty.
Definition: APWeightEntry.cxx:218
APWeightEntry::m_cumul
double * m_cumul
Histograms to hold the probability distribution and the cumulative distribution.
Definition: APWeightEntry.h:76
APWeightEntry::m_bins
double * m_bins
Definition: APWeightEntry.h:76
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
APWeightEntry::GetSysUncert
double GetSysUncert() const
Get absolute systematic uncertainty value of efficiency/weight.
Definition: APWeightEntry.cxx:222
APWeightEntry::APWeightEntry
APWeightEntry(const APWeightEntry &)
APWeightEntry::m_ID
unsigned int m_ID
Holds internal ID (used by APReweight/APReweight2D/APReweight3D/APReweightND).
Definition: APWeightEntry.h:74