ROOT  6.06/09
Reference Guide
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 #ifndef ROOT_TObject
28 #include "TObject.h"
29 #endif
30 
31 #ifndef ROOT_TFitResultPtr
32 #include "TFitResultPtr.h"
33 #endif
34 
35 
36 
37 class TH1;
38 class TF1;
39 
40 namespace ROOT {
41  namespace Fit {
42  class Fitter;
43  }
44 }
45 
47 
48 protected:
49  TH1 *fDenominator; //Denominator histogram
50  TH1 *fNumerator; //Numerator histogram
51  TF1 *fFunction; //Function to fit
52  Double_t fEpsilon; //Precision required for function integration (option "I")
53  Bool_t fFitDone; //Set to kTRUE when the fit has been done
54  Bool_t fAverage; //True if the fit function must be averaged over the bin
55  Bool_t fRange; //True if the fit range must be taken from the function range
56  ROOT::Fit::Fitter *fFitter; //pointer to the real fitter
57 
58 private:
59 
60  void ComputeFCN(Double_t& f, const Double_t* par);
61 
62 public:
64  TBinomialEfficiencyFitter(const TH1 *numerator, const TH1 *denominator);
66 
67  void Set(const TH1 *numerator, const TH1 *denominator);
69  TFitResultPtr Fit(TF1 *f1, Option_t* option = "");
72  Double_t f = 0;
73  ComputeFCN(f, par);
74  return f;
75  }
76 
77  ClassDef(TBinomialEfficiencyFitter, 1) //Binomial Fitter for the division of two histograms
78 
79 
80 };
81 
82 
83 #endif
Double_t EvaluateFCN(const Double_t *par)
double par[1]
Definition: unuranDistr.cxx:38
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
const char Option_t
Definition: RtypesCore.h:62
Binomial fitter for the division of two histograms.
virtual ~TBinomialEfficiencyFitter()
destructor
bool Bool_t
Definition: RtypesCore.h:59
void ComputeFCN(Double_t &f, const Double_t *par)
Compute the likelihood.
#define ClassDef(name, id)
Definition: Rtypes.h:254
void Set(const TH1 *numerator, const TH1 *denominator)
Initialize with a new set of inputs.
void SetPrecision(Double_t epsilon)
Set the required integration precision, see TF1::Integral()
Fitter class, entry point for performing all type of fits.
Definition: Fitter.h:94
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
Definition: TFitResultPtr.h:33
REAL epsilon
Definition: triangle.c:617
double f(double x)
double Double_t
Definition: RtypesCore.h:55
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition: HFitImpl.cxx:132
The TH1 histogram class.
Definition: TH1.h:80
Mother of all ROOT objects.
Definition: TObject.h:58
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:149
TF1 * f1
Definition: legend1.C:11
ROOT::Fit::Fitter * GetFitter()
Provide access to the underlying fitter object.