ATLAS Offline Software
Loading...
Searching...
No Matches
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
16
17#ifndef APReweightND_h
18#define APReweightND_h
19
20#include "APReweightBase.h"
21#include <vector>
22#include <map>
23
24class TTree;
25class THnSparse;
26class TAxis;
27class APWeightEntry;
28
30
31public:
32 APReweightND();
33 APReweightND(THnSparse* denominator_in, THnSparse* numerator_in, bool isTrig = false);
34 virtual ~APReweightND();
35
36 void ReadEfficiency(THnSparse* efficiency_in, THnSparse* err_low_in, THnSparse* err_high_in = 0);
37
38 APWeightEntry* GetBinWeight(const int bin[]);
39 APWeightEntry* GetWeight(double value[]);
40
41 double GetSampleScale() const;
42 unsigned int NBins() const;
43
44 const THnSparse* GetDenominatorHist() const;
45 const THnSparse* GetNumeratorHist() const;
46
47 void SetSystUncert(double rel_uncert);
48 void SetQuietMode(bool isQuiet = true);
49
50 ClassDef(APReweightND, 1)
51
52private:
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
APReweightBase()
Default constructor.
void SetQuietMode(bool isQuiet=true)
Sets the flag to turn off messages.
const THnSparse * GetDenominatorHist() const
Get original denominator histogram.
std::vector< TAxis * > m_axes
Holds all axes of the APReweightND instance (from input histograms).
std::map< std::vector< int >, APWeightEntry * > m_weights
Holds all weight entries.
APWeightEntry * GetBinWeight(const int bin[])
Get Weight entry for a given n-tuple of bin numbers.
double GetSampleScale() const
Get scale factor that was calculated from sample sizes upon instantiation.
unsigned int NBins() const
Get amount of bins.
void SetSystUncert(double rel_uncert)
Set the global relative (!) systematic uncertainty of all efficiencies/weights.
THnSparse * m_numerator_hist
Holds the original numerator histogram.
virtual ~APReweightND()
Default destructor.
APReweightND()
Default constructor.
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....
ClassDef(APReweightND, 1) private THnSparse * m_denominator_hist
< Holds the amount of dimensions.
APWeightEntry * GetWeight(double value[])
Get Weight entry for a given n-tuple of values.
const THnSparse * GetNumeratorHist() const
Get original numerator histogram.
Class to store a single weight entry (one bin).