testFitPerf.cxx File Reference

#include "TH1.h"
#include "TF1.h"
#include "TF2.h"
#include "TMath.h"
#include "TSystem.h"
#include "TRandom3.h"
#include "TTree.h"
#include "TROOT.h"
#include "Fit/BinData.h"
#include "Fit/UnBinData.h"
#include "Fit/Fitter.h"
#include "HFitInterface.h"
#include "Math/IParamFunction.h"
#include "Math/WrappedTF1.h"
#include "Math/WrappedMultiTF1.h"
#include "Math/WrappedParamFunction.h"
#include "Math/MultiDimParamFunctionAdapter.h"
#include "TGraphErrors.h"
#include "TStyle.h"
#include "TSeqCollection.h"
#include "Math/Polynomial.h"
#include "Math/DistFunc.h"
#include <string>
#include <iostream>
#include "TStopwatch.h"
#include "TVirtualFitter.h"
#include "TFitterMinuit.h"
#include "GaussFunction.h"
#include "RooDataHist.h"
#include "RooDataSet.h"
#include "RooRealVar.h"
#include "RooGaussian.h"
#include "RooMinuit.h"
#include "RooChi2Var.h"
#include "RooGlobalFunc.h"
#include "RooFitResult.h"
#include "RooProdPdf.h"
#include <cassert>
#include "MinimizerTypes.h"

Go to the source code of this file.

Defines

#define USE_CHI2_FIT

Typedefs

typedef ROOT::Math::IParamMultiFunction Func

Functions

void printData (const ROOT::Fit::UnBinData &data)
void printResult (int iret)
ROOT::Fit::UnBinDataFillUnBinData (TTree *tree, bool copyData=true, unsigned int dim=1)
template<class T>
void printData (const T &data)
template<class MinType, class T>
int DoBinFit (T *hist, Func &func, bool debug=false, bool useGrad=false)
template<class MinType, class T>
int DoUnBinFit (T *tree, Func &func, bool debug=false, bool copyData=false)
template<class MinType>
int DoFit (TTree *tree, Func &func, bool debug=false, bool copyData=false)
template<class MinType>
int DoFit (TH1 *h1, Func &func, bool debug=false, bool copyData=false)
template<class MinType>
int DoFit (TGraph *gr, Func &func, bool debug=false, bool copyData=false)
template<class MinType, class FitObj>
int FitUsingNewFitter (FitObj *fitobj, Func &func, bool useGrad=false)
template<class T, class MinType>
int FitUsingTFit (T *hist, TF1 *func)
template<class MinType>
int FitUsingTTreeFit (TTree *tree, TF1 *func, const std::string &vars="x")
int FitUsingRooFit (TH1 *hist, TF1 *func)
int FitUsingRooFit (TTree *tree, TF1 *func)
int FitUsingRooFit2 (TTree *tree)
double poly2 (const double *x, const double *p)
int testPolyFit ()
double gaussian (const double *x, const double *p)
double gausnorm (const double *x, const double *p)
double gausnorm2D (const double *x, const double *p)
double gausnormN (const double *x, const double *p)
int testGausFit ()
int testTreeFit ()
int testLargeTreeFit (int nevt=1000)
int testLargeTreeRooFit (int nevt=1000)
int testFitPerf ()
int main ()

Variables

int nfit
const int N = 20
double iniPar [2 *N]
bool USE_BRANCH = false


Define Documentation

#define USE_CHI2_FIT


Typedef Documentation

typedef ROOT::Math::IParamMultiFunction Func

Definition at line 220 of file testFitPerf.cxx.


Function Documentation

template<class MinType, class T>
int DoBinFit ( T hist,
Func func,
bool  debug = false,
bool  useGrad = false 
)

Definition at line 222 of file testFitPerf.cxx.

References ROOT::Fit::Fitter::Config(), d, debug, ROOT::Fit::FillData(), ROOT::Fit::Fitter::Fit(), func(), name, ROOT::Math::ParamFunction< IPFType >::NPar(), ROOT::Fit::Fitter::Result(), ROOT::Fit::Fitter::SetFunction(), and ROOT::Math::ParamFunction< IPFType >::SetParameters().

template<class MinType>
int DoFit ( TGraph gr,
Func func,
bool  debug = false,
bool  copyData = false 
)

Definition at line 333 of file testFitPerf.cxx.

References debug, func(), and gr.

template<class MinType>
int DoFit ( TH1 h1,
Func func,
bool  debug = false,
bool  copyData = false 
)

Definition at line 329 of file testFitPerf.cxx.

References debug, func(), and h1.

template<class MinType>
int DoFit ( TTree tree,
Func func,
bool  debug = false,
bool  copyData = false 
)

Definition at line 325 of file testFitPerf.cxx.

References debug, and func().

template<class MinType, class T>
int DoUnBinFit ( T tree,
Func func,
bool  debug = false,
bool  copyData = false 
)

Definition at line 275 of file testFitPerf.cxx.

References ROOT::Fit::Fitter::Config(), d, debug, FillUnBinData(), ROOT::Fit::Fitter::Fit(), func(), name, ROOT::Fit::Fitter::Result(), and ROOT::Fit::Fitter::SetFunction().

ROOT::Fit::UnBinData* FillUnBinData ( TTree tree,
bool  copyData = true,
unsigned int  dim = 1 
)

Definition at line 80 of file testFitPerf.cxx.

References d, TTree::Draw(), TTree::GetBranch(), TTree::GetEntries(), TBranch::GetEntry(), TNamed::GetName(), TTree::GetSelectedRows(), TTree::GetV1(), TTree::GetV2(), i, j, m, N, n, TBranch::SetAddress(), TTree::SetEstimate(), USE_BRANCH, x, and y.

Referenced by DoFit(), and DoUnBinFit().

template<class MinType, class FitObj>
int FitUsingNewFitter ( FitObj *  fitobj,
Func func,
bool  useGrad = false 
)

Definition at line 338 of file testFitPerf.cxx.

References func(), i, iniPar, name, nfit, and w.

int FitUsingRooFit ( TTree tree,
TF1 func 
)

Definition at line 539 of file testFitPerf.cxx.

References data, RooAbsPdf::fitTo(), func(), RooAbsArg::getVariables(), RooFit::Hesse(), i, iniPar, level, RooFit::Minos(), nfit, RooAbsArg::Print(), Print(), RooFit::PrintLevel(), result(), RooFit::Save(), sigma, w, x, and y.

int FitUsingRooFit ( TH1 hist,
TF1 func 
)

Definition at line 484 of file testFitPerf.cxx.

References data, RooAbsPdf::fitTo(), func(), hist, i, iniPar, m, nfit, sigma, val, w, and x.

Referenced by main(), and testTreeFit().

int FitUsingRooFit2 ( TTree tree  ) 

Definition at line 610 of file testFitPerf.cxx.

References data, g, RooFit::Hesse(), i, iniPar, j, level, m, RooFit::Minos(), N, nfit, Print(), RooFit::PrintLevel(), result(), s, RooFit::Save(), sname, ROOT::Math::Util::ToString(), w, and x.

Referenced by testLargeTreeRooFit().

template<class T, class MinType>
int FitUsingTFit ( T hist,
TF1 func 
)

Definition at line 377 of file testFitPerf.cxx.

References func(), i, iniPar, name, nfit, pr(), TVirtualFitter::SetDefaultFitter(), and w.

template<class MinType>
int FitUsingTTreeFit ( TTree tree,
TF1 func,
const std::string vars = "x" 
)

Definition at line 437 of file testFitPerf.cxx.

References func(), i, iniPar, name, nfit, sel, TVirtualFitter::SetDefaultFitter(), TTree::UnbinnedFit(), and w.

double gausnorm ( const double x,
const double p 
)

Definition at line 797 of file testFitPerf.cxx.

References exp(), and sqrt().

Referenced by gausnorm2D(), gausnormN(), gausSum(), main(), and testTreeFit().

double gausnorm2D ( const double x,
const double p 
)

Definition at line 804 of file testFitPerf.cxx.

References gausnorm().

Referenced by testTreeFit().

double gausnormN ( const double x,
const double p 
)

Definition at line 808 of file testFitPerf.cxx.

References gausnorm(), i, and N.

Referenced by testLargeTreeFit(), and testNdimFit().

double gaussian ( const double x,
const double p 
)

Definition at line 791 of file testFitPerf.cxx.

References exp().

Referenced by testGausFit(), testStatFunc(), and testStatFunctions().

int main ( void   ) 

Definition at line 1127 of file testFitPerf.cxx.

References testFitPerf().

double poly2 ( const double x,
const double p 
)

Definition at line 712 of file testFitPerf.cxx.

Referenced by rf704_amplitudefit(), TestBasic704::testCode(), and testPolyFit().

template<class T>
void printData ( const T data  ) 

Definition at line 210 of file testFitPerf.cxx.

void printData ( const ROOT::Fit::UnBinData data  ) 

Definition at line 64 of file testFitPerf.cxx.

References data, and i.

void printResult ( int  iret  ) 

Definition at line 71 of file testFitPerf.cxx.

Referenced by stressHistogram(), testGausFit(), testLargeTreeFit(), testLargeTreeRooFit(), testPolyFit(), and testTreeFit().

int testFitPerf (  ) 

Definition at line 1084 of file testFitPerf.cxx.

References nfit, testGausFit(), testLargeTreeFit(), testLargeTreeRooFit(), testPolyFit(), and testTreeFit().

Referenced by main().

int testGausFit (  ) 

Definition at line 817 of file testFitPerf.cxx.

References f2, TH2::Fill(), TRandom::Gaus(), gaussian(), gr, gRandom, gStyle, h2, i, iniPar, printResult(), and TStyle::SetErrorX().

Referenced by minuit2GausFit(), and testFitPerf().

int testLargeTreeFit ( int  nevt = 1000  ) 

Definition at line 992 of file testFitPerf.cxx.

References TTree::Branch(), double, f2, TTree::Fill(), gausnormN(), i, iniPar, j, N, printResult(), s, and x.

Referenced by testFitPerf().

int testLargeTreeRooFit ( int  nevt = 1000  ) 

Definition at line 1040 of file testFitPerf.cxx.

References TTree::Branch(), double, TTree::Fill(), FitUsingRooFit2(), i, iniPar, j, N, printResult(), s, ROOT::Math::Util::ToString(), and x.

Referenced by testFitPerf().

int testPolyFit (  ) 

Definition at line 716 of file testFitPerf.cxx.

References f2, TH2::Fill(), TF1::GetRandom(), gr, gStyle, h1, i, iniPar, poly2(), printResult(), TStyle::SetErrorX(), and TFormula::SetParameter().

Referenced by testFitPerf().

int testTreeFit (  ) 

Definition at line 911 of file testFitPerf.cxx.

References TTree::Branch(), f2, TTree::Fill(), FitUsingRooFit(), gausnorm(), gausnorm2D(), gRandom, i, iniPar, nrows, printResult(), TRandom::Rannor(), x, and y.

Referenced by testFitPerf().


Variable Documentation

double iniPar[2 *N]

Definition at line 61 of file testFitPerf.cxx.

Referenced by FitUsingNewFitter(), FitUsingRooFit(), FitUsingRooFit2(), FitUsingTFit(), FitUsingTTreeFit(), main(), MultiGaussRooPdf::MultiGaussRooPdf(), testGausFit(), testLargeTreeFit(), testLargeTreeRooFit(), testNdimFit(), testPolyFit(), and testTreeFit().

const int N = 20

Definition at line 60 of file testFitPerf.cxx.

int nfit

Definition at line 59 of file testFitPerf.cxx.

Referenced by FitUsingNewFitter(), FitUsingRooFit(), FitUsingRooFit2(), FitUsingTFit(), FitUsingTTreeFit(), and testFitPerf().

bool USE_BRANCH = false

Definition at line 79 of file testFitPerf.cxx.

Referenced by FillUnBinData().


Generated on Tue Jul 5 16:07:11 2011 for ROOT_528-00b_version by  doxygen 1.5.1