ATLAS Offline Software
Loading...
Searching...
No Matches
APWeightHist.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
16
17#ifndef APWeightHist_h
18#define APWeightHist_h
19#include "TH1D.h"
20#include <string>
21
22class APWeightEntry;
23class TGraphErrors;
24class TGraphAsymmErrors;
25
26class APWeightHist : public TH1D {
27
28public:
29 APWeightHist(const char *name,const char *title, const int n_bins, const float x_min, const float x_max);
30 APWeightHist();
32 using TH1D::Fill;
33 int Fill(const double value, APWeightEntry* weight);
34 TGraphAsymmErrors* GetGraphStatUncert(bool autocompute = true);
35 TGraphErrors* GetGraphSystUncert(bool simple = true, bool autocompute = true);
36 void ComputeGraph(const int prec = 250);
37 TH1D* GetBinPDF(unsigned int bin, bool autocompute = true); /* Retrieves the PDF of a bin (starting with bin=1 in accordance with the TH1 classes, over- & underflow bins not accessible) */
38
40
41private:
43 std::vector< std::vector< APWeightEntry* > > m_binned_weights;
44 std::vector< TH1D* > m_bin_dists;
45 std::vector< double > m_SumSys2;
46 TGraphAsymmErrors* m_graph_stat;
47 TGraphErrors* m_graph_syst;
48 //int m_prec; /*!< Holds the calculation precision (= amount of histograms & binning factor). */
49
50};
51
52#endif
Class to store a single weight entry (one bin).
APWeightHist(const char *name, const char *title, const int n_bins, const float x_min, const float x_max)
Constructor which takes histo title, amount of bins and the range and optionally the preicision to us...
ClassDef(APWeightHist, 1)
ClassDef for ROOTCINT dictionary.
void ComputeGraph(const int prec=250)
Computes the resulting graph from all added ntuples and calculates the uncertainties for all bins.
int Fill(const double value, APWeightEntry *weight)
< Overloads TH1D's Fill method.
APWeightHist()
Default constructor.
std::vector< std::vector< APWeightEntry * > > m_binned_weights
Holds all filled weights weights as pointers.
TGraphAsymmErrors * m_graph_stat
Holds the histogram with statistical uncertainties.
TH1D * GetBinPDF(unsigned int bin, bool autocompute=true)
std::vector< double > m_SumSys2
Holds the variances of systematic uncertainties for the individual bins.
~APWeightHist()
Default destructor.
std::vector< TH1D * > m_bin_dists
Holds the PDFs for the individual bins.
TGraphErrors * m_graph_syst
Holds the histogram with systematic uncertainties.
TGraphAsymmErrors * GetGraphStatUncert(bool autocompute=true)
Extracts the histogram with statistical uncertainties.
TGraphErrors * GetGraphSystUncert(bool simple=true, bool autocompute=true)
Extracts the histogram with systematic uncertainties.
double m_computed_entries
Flag to store information about the status of the computation.