Logo ROOT   6.14/05
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 #include "TObject.h"
28 
29 #include "TFitResultPtr.h"
30 
31 
32 
33 class TH1;
34 class TF1;
35 
36 namespace ROOT {
37  namespace Fit {
38  class Fitter;
39  }
40 }
41 
43 
44 protected:
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 
54 private:
55 
56  void ComputeFCN(Double_t& f, const Double_t* par);
57 
58 public:
60  TBinomialEfficiencyFitter(const TH1 *numerator, const TH1 *denominator);
61  virtual ~TBinomialEfficiencyFitter();
62 
63  void Set(const TH1 *numerator, const TH1 *denominator);
64  void SetPrecision(Double_t epsilon);
65  TFitResultPtr Fit(TF1 *f1, Option_t* option = "");
66  ROOT::Fit::Fitter * GetFitter();
67  Double_t EvaluateFCN(const Double_t * par) {
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
Double_t EvaluateFCN(const Double_t *par)
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
const char Option_t
Definition: RtypesCore.h:62
Binomial fitter for the division of two histograms.
#define f(i)
Definition: RSha256.hxx:104
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:320
Fitter class, entry point for performing all type of fits.
Definition: Fitter.h:77
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
Definition: TFitResultPtr.h:31
REAL epsilon
Definition: triangle.c:617
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:134
The TH1 histogram class.
Definition: TH1.h:56
Mother of all ROOT objects.
Definition: TObject.h:37
1-Dim function class
Definition: TF1.h:211
TF1 * f1
Definition: legend1.C:11