Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TBinomialEfficiencyFitter.h
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Frank Filthaut, Rene Brun 30/05/2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TBinomialEfficiencyFitter
13#define ROOT_TBinomialEfficiencyFitter
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TBinomialEfficiencyFitter //
19// //
20// Binomial Fitter for the division of two histograms. //
21// Use when you need to calculate a selection's efficiency from two //
22// histograms, one containing all entries, and one containing the subset//
23// of these entries that pass the selection //
24// //
25//////////////////////////////////////////////////////////////////////////
26
27#include "TObject.h"
28
29#include "TFitResultPtr.h"
30
31
32
33class TH1;
34class TF1;
35
36namespace ROOT {
37 namespace Fit {
38 class Fitter;
39 }
40}
41
43
44protected:
45 TH1 *fDenominator; //Denominator histogram
46 TH1 *fNumerator; //Numerator histogram
47 TF1 *fFunction; //Function to fit
48 Double_t fEpsilon; //Precision required for function integration (option "I")
49 Bool_t fFitDone; //Set to kTRUE when the fit has been done
50 Bool_t fAverage; //True if the fit function must be averaged over the bin
51 Bool_t fRange; //True if the fit range must be taken from the function range
52 ROOT::Fit::Fitter *fFitter; //pointer to the real fitter
53
54private:
55
56 void ComputeFCN(Double_t& f, const Double_t* par);
57
58public:
60 TBinomialEfficiencyFitter(const TH1 *numerator, const TH1 *denominator);
62
63 void Set(const TH1 *numerator, const TH1 *denominator);
65 TFitResultPtr Fit(TF1 *f1, Option_t* option = "");
68 Double_t f = 0;
69 ComputeFCN(f, par);
70 return f;
71 }
72
73 ClassDef(TBinomialEfficiencyFitter, 1) //Binomial Fitter for the division of two histograms
74
75
76};
77
78
79#endif
#define f(i)
Definition RSha256.hxx:104
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
Fitter class, entry point for performing all type of fits.
Definition Fitter.h:77
Binomial fitter for the division of two histograms.
void Set(const TH1 *numerator, const TH1 *denominator)
Initialize with a new set of inputs.
TBinomialEfficiencyFitter()
default constructor
ROOT::Fit::Fitter * GetFitter()
Provide access to the underlying fitter object.
Double_t EvaluateFCN(const Double_t *par)
void SetPrecision(Double_t epsilon)
Set the required integration precision, see TF1::Integral()
void ComputeFCN(Double_t &f, const Double_t *par)
Compute the likelihood.
TFitResultPtr Fit(TF1 *f1, Option_t *option="")
Carry out the fit of the given function to the given histograms.
1-Dim function class
Definition TF1.h:213
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
Mother of all ROOT objects.
Definition TObject.h:37
TF1 * f1
Definition legend1.C:11
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition HFitImpl.cxx:133
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
REAL epsilon
Definition triangle.c:617