ATLAS Offline Software
APReweightND.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 
15 
17 #ifndef APReweightND_h
18 #define APReweightND_h
19 
20 #include "APReweightBase.h"
21 #include <vector>
22 #include <map>
23 
24 class TTree;
25 class THnSparse;
26 class TAxis;
27 class APWeightEntry;
28 
29 class APReweightND : public APReweightBase {
30 
31 public:
32  APReweightND();
33  APReweightND(THnSparse* denominator_in, THnSparse* numerator_in, bool isTrig = false);
34  virtual ~APReweightND();
36  void ReadEfficiency(THnSparse* efficiency_in, THnSparse* err_low_in, THnSparse* err_high_in = 0);
38  APWeightEntry* GetBinWeight(const int bin[]);
39  APWeightEntry* GetWeight(double value[]);
41  double GetSampleScale() const;
42  unsigned int NBins() const;
44  const THnSparse* GetDenominatorHist() const;
45  const THnSparse* GetNumeratorHist() const;
47  void SetSystUncert(double rel_uncert);
48  void SetQuietMode(bool isQuiet = true);
50  ClassDef(APReweightND, 1)
51 
52 private:
53  unsigned int m_n_dim;
54  THnSparse* m_denominator_hist;
55  THnSparse* m_numerator_hist;
56  std::map< std::vector<int> , APWeightEntry* > m_weights;
57  std::vector< TAxis* > m_axes;
58 };
59 
60 #endif
APReweightND::GetDenominatorHist
const THnSparse * GetDenominatorHist() const
Get original denominator histogram.
Definition: APReweightND.cxx:141
APReweightND::GetWeight
APWeightEntry * GetWeight(double value[])
Get Weight entry for a given n-tuple of values.
Definition: APReweightND.cxx:130
APReweightND::GetBinWeight
APWeightEntry * GetBinWeight(const int bin[])
Get Weight entry for a given n-tuple of bin numbers.
Definition: APReweightND.cxx:114
APWeightEntry
Definition: APWeightEntry.h:25
APReweightND::SetSystUncert
void SetSystUncert(double rel_uncert)
Set the global relative (!) systematic uncertainty of all efficiencies/weights.
Definition: APReweightND.cxx:159
bin
Definition: BinsDiffFromStripMedian.h:43
athena.value
value
Definition: athena.py:124
APReweightBase
Definition: APReweightBase.h:23
APReweightBase.h
APReweightND::GetSampleScale
double GetSampleScale() const
Get scale factor that was calculated from sample sizes upon instantiation.
Definition: APReweightND.cxx:149
APReweightND::NBins
unsigned int NBins() const
Get amount of bins.
Definition: APReweightND.cxx:153
APReweightND::ReadEfficiency
void ReadEfficiency(THnSparse *efficiency_in, THnSparse *err_low_in, THnSparse *err_high_in=0)
Read efficiencies and upper/lower uncertainty (if numerator/denominator not applicable (e....
Definition: APReweightND.cxx:77
APReweightND::~APReweightND
virtual ~APReweightND()
Default destructor.
Definition: APReweightND.cxx:100
APReweightND::m_axes
std::vector< TAxis * > m_axes
Holds all axes of the APReweightND instance (from input histograms).
Definition: APReweightND.h:57
APReweightND::APReweightND
APReweightND()
Default constructor.
Definition: APReweightND.cxx:17
APReweightND
Definition: APReweightND.h:29
APReweightND::GetNumeratorHist
const THnSparse * GetNumeratorHist() const
Get original numerator histogram.
Definition: APReweightND.cxx:145
APReweightND::SetQuietMode
void SetQuietMode(bool isQuiet=true)
Sets the flag to turn off messages.
Definition: APReweightND.cxx:166
APReweightND::m_weights
std::map< std::vector< int >, APWeightEntry * > m_weights
Holds all weight entries.
Definition: APReweightND.h:56
APReweightND::m_numerator_hist
THnSparse * m_numerator_hist
Holds the original numerator histogram.
Definition: APReweightND.h:55
APReweightND::m_denominator_hist
ClassDef(APReweightND, 1) private THnSparse * m_denominator_hist
< Holds the amount of dimensions.
Definition: APReweightND.h:50