ATLAS Offline Software
Loading...
Searching...
No Matches
APWeightSumEnsemble.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
17
18#ifndef APWeightSumEnsemble_h
19#define APWeightSumEnsemble_h
20
21#include "APWeightSum.h"
22#include <vector>
23
24class TH1F;
25class TVirtualFitter;
26class APWeightEntry;
27
29
30public:
32 virtual ~APWeightSumEnsemble();
33 void SetRelPrecision(double rel_prec);
34 void AddWeightToEvt(APWeightEntry* weight);
35 void FinishEvt(double ext_weight = 1.0);
36
37 double GetQuantile(const double prob);
38 double GetRandom();
39
40 double GetEnsemblePDFMode();
41 double GetEnsemblePDFStdDev();
42
43 TH1F *GetPDF();
44
45 ClassDef(APWeightSumEnsemble,1)
46
47private:
48 void Compute();
49 std::vector< std::vector< APWeightEntry* > > m_weight_vector;
50 std::vector< APWeightEntry* > m_current_evt_pdfs;
51 std::vector< double > m_ext_weights;
52 double m_rel_prec;
53 TH1F *m_pdf;
57};
58
59#endif
Class to store a single weight entry (one bin).
TH1F * m_pdf
Holds the TH1F instance from the arrays if computed.
ClassDef(APWeightSumEnsemble, 1) private std::vector< std::vector< APWeightEntry * > > m_weight_vector
< Performs the ensemble test to model final PDF.
double m_rel_prec
Holds the relative precision of the gaussian fit to stop the ensemble test at.
TH1F * GetPDF()
Returns the calculated PDF.
double m_ensemble_mode
Holds the Mode (= sum of weights from PDF) from ensemble test.
bool m_ensembleTest_done
Flag if the ensemble test has been performed with the current set of weights.
std::vector< double > m_ext_weights
Holds the external event weight provided when finishing the respective events.
APWeightSumEnsemble()
Default constructor.
virtual ~APWeightSumEnsemble()
Default destructor.
double GetQuantile(const double prob)
Returns the quantlile for p=prob for the distribution.
double GetRandom()
Returns a random value according to the pdf.
double m_ensemble_sigma
Holds the standard deviation from ensemble test.
void SetRelPrecision(double rel_prec)
Sets the relative precision of the gaussian fit to stop the ensemble test at.
void AddWeightToEvt(APWeightEntry *weight)
Adds a weight to the sum of weights.
double GetEnsemblePDFStdDev()
Returns the standard deviation from PDF .
double GetEnsemblePDFMode()
Returns the Mode (= sum of weights from PDF).
std::vector< APWeightEntry * > m_current_evt_pdfs
Holds the weight objects for the current event.
void FinishEvt(double ext_weight=1.0)
Finishes the current event and calculates the event weight.
APWeightSum()
Default constructor.
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)