stressHistoFit.cxx File Reference

#include "TH1.h"
#include "TH2.h"
#include "THnSparse.h"
#include "TGraph.h"
#include "TGraph2D.h"
#include "TGraphErrors.h"
#include "TGraph2DErrors.h"
#include "TTree.h"
#include "TF1.h"
#include "TF2.h"
#include "Math/IFunction.h"
#include "Math/IParamFunction.h"
#include "TMath.h"
#include "Math/DistFunc.h"
#include "TUnuran.h"
#include "TUnuranMultiContDist.h"
#include "Math/MinimizerOptions.h"
#include "TBackCompFitter.h"
#include "TVirtualFitter.h"
#include "Math/WrappedTF1.h"
#include "Math/WrappedMultiTF1.h"
#include "Fit/BinData.h"
#include "Fit/UnBinData.h"
#include "HFitInterface.h"
#include "Fit/Fitter.h"
#include "TRandom3.h"
#include "TROOT.h"
#include "TBenchmark.h"
#include "TCanvas.h"
#include "TApplication.h"
#include <vector>
#include <string>
#include <cassert>
#include <cmath>
#include "Riostream.h"

Go to the source code of this file.

Classes

struct  RefValue
class  CompareResult
class  algoType
class  ParLimit
class  fitFunctions
class  ObjectWrapper< T >
class  TreeWrapper

Enumerations

enum  cmpOpts
enum  testOpt

Functions

void FillVariableRange (Double_t v[], Int_t numberOfBins, Double_t minRange, Double_t maxRange)
void SetParsLimits (vector< ParLimit > &v, TF1 *func)
Double_t gaus1DImpl (Double_t *x, Double_t *p)
Double_t poly1DImpl (Double_t *x, Double_t *p)
Double_t poly2DImpl (Double_t *x, Double_t *p)
Double_t gaus2DImpl (Double_t *x, Double_t *p)
double gausNormal (Double_t *x, Double_t *p)
double gaus2dnormal (double *x, double *p)
double gausNd (double *x, double *p)
template<typename T>
void printTestName (T *object, TF1 *func)
void printTitle (TF1 *func)
void printSeparator ()
void setColor (int red=0)
int testFit (const char *str1, const char *str2, const char *str3, TF1 *func, CompareResult const &cmpResult, int opts)
template<typename T, typename F>
int testFitters (T *object, F *func, vector< vector< algoType > > &listAlgos, fitFunctions const &fitFunction)
int test1DObjects (vector< vector< algoType > > &listH, vector< vector< algoType > > &listG, vector< vector< algoType > > &listGE, vector< fitFunctions > &listOfFunctions)
int test2DObjects (vector< vector< algoType > > &listH, vector< vector< algoType > > &listG, vector< vector< algoType > > &listGE, vector< fitFunctions > &listOfFunctions)
int testUnBinnedFit (int n=10000)
void init_structures ()
int stressFit ()
int main (int argc, char **argv)

Variables

const unsigned int __DRAW__ = 0
TRandom3 rndm
vector< algoTypecommonAlgos
vector< algoTypesimplexAlgos
vector< algoTypespecialAlgos
vector< algoTypenoGraphAlgos
vector< algoTypenoGraphErrorAlgos
vector< algoTypegraphErrorAlgos
vector< algoTypehistGaus2D
vector< algoTypelinearAlgos
vector< vector< algoType > > listTH1DAlgos
vector< vector< algoType > > listAlgosTGraph
vector< vector< algoType > > listAlgosTGraphError
vector< vector< algoType > > listLinearAlgos
vector< vector< algoType > > listTH2DAlgos
vector< vector< algoType > > listAlgosTGraph2D
vector< vector< algoType > > listAlgosTGraph2DError
vector< fitFunctionsl1DFunctions
vector< fitFunctionsl2DFunctions
vector< fitFunctionstreeFunctions
vector< fitFunctionsl1DLinearFunctions
vector< fitFunctionsl2DLinearFunctions
const double minX = -5.
const double maxX = +5.
const double minY = -5.
const double maxY = +5.
const int nbinsX = 30
const int nbinsY = 30
int defaultOptions = testOptColor | testOptCheck
int gTestIndex = 0


Enumeration Type Documentation

enum cmpOpts

Definition at line 125 of file stressHistoFit.cxx.

enum testOpt

Definition at line 387 of file stressHistoFit.cxx.


Function Documentation

void FillVariableRange ( Double_t  v[],
Int_t  numberOfBins,
Double_t  minRange,
Double_t  maxRange 
)

Definition at line 185 of file stressHistoFit.cxx.

References i, k, rndm, and TRandom::Uniform().

Referenced by test1DObjects(), test2DObjects(), testAddVar1(), testAddVar2(), testAddVarProf1(), testAddVarProf2(), testAssignProfileVar1D(), testAssignVar1D(), testCloneProfileVar1D(), testCloneVar1D(), testCopyConstructorProfileVar1D(), testCopyConstructorVar1D(), testDivideVar1(), testDivideVar2(), testInterpolationVar1D(), testMergeProfVar1D(), testMergeVar1D(), testMulVar1(), testMulVar2(), testWriteReadProfileVar1D(), and testWriteReadVar1D().

Double_t gaus1DImpl ( Double_t x,
Double_t p 
)

Definition at line 300 of file stressHistoFit.cxx.

References TMath::Gaus().

Referenced by init_structures().

Double_t gaus2DImpl ( Double_t x,
Double_t p 
)

Definition at line 323 of file stressHistoFit.cxx.

References TMath::Gaus().

Referenced by init_structures().

double gaus2dnormal ( double x,
double p 
)

Definition at line 335 of file stressHistoFit.cxx.

References c, exp(), TMath::Pi(), result(), sqrt(), and u.

Referenced by gausNd(), init_structures(), and testUnBinnedFit().

double gausNd ( double x,
double p 
)

Definition at line 351 of file stressHistoFit.cxx.

References Error, gaus2dnormal(), i, and ROOT::Math::normal_pdf().

Referenced by init_structures(), and testUnBinnedFit().

double gausNormal ( Double_t x,
Double_t p 
)

Definition at line 329 of file stressHistoFit.cxx.

References TMath::Gaus().

Referenced by init_structures().

void init_structures (  ) 

Definition at line 969 of file stressHistoFit.cxx.

References cmpPars, commonAlgos, gaus1DImpl(), gaus2DImpl(), gaus2dnormal(), gausNd(), gausNormal(), graphErrorAlgos, histGaus2D, l1DFunctions, l1DLinearFunctions, l2DFunctions, l2DLinearFunctions, linearAlgos, listAlgosTGraph, listAlgosTGraph2D, listAlgosTGraph2DError, listAlgosTGraphError, listLinearAlgos, listTH1DAlgos, listTH2DAlgos, noGraphAlgos, noGraphErrorAlgos, poly1DImpl(), poly2DImpl(), simplexAlgos, specialAlgos, and treeFunctions.

Referenced by stressFit().

int main ( int  argc,
char **  argv 
)

Definition at line 1161 of file stressHistoFit.cxx.

References __DRAW__, TApplication::Run(), and stressFit().

Double_t poly1DImpl ( Double_t x,
Double_t p 
)

Definition at line 306 of file stressHistoFit.cxx.

Referenced by init_structures().

Double_t poly2DImpl ( Double_t x,
Double_t p 
)

Definition at line 313 of file stressHistoFit.cxx.

Referenced by init_structures().

void printSeparator (  ) 

Definition at line 476 of file stressHistoFit.cxx.

References fflush().

Referenced by testFitters().

template<typename T>
void printTestName ( T object,
TF1 func 
)

Definition at line 446 of file stressHistoFit.cxx.

References fflush(), func(), str, and ROOT::Math::Util::ToString().

Referenced by testFitters().

void printTitle ( TF1 func  ) 

Definition at line 464 of file stressHistoFit.cxx.

References fflush(), func(), i, and n.

Referenced by G__G__RooFitCore2_111_0_5(), and testFitters().

void setColor ( int  red = 0  ) 

Definition at line 485 of file stressHistoFit.cxx.

References command, red, and sprintf().

Referenced by TQtBrush::SetColorOwn(), TQtPen::SetLineColor(), and testFit().

void SetParsLimits ( vector< ParLimit > &  v,
TF1 func 
)

Definition at line 253 of file stressHistoFit.cxx.

References func().

Referenced by test1DObjects(), and test2DObjects().

int stressFit (  ) 

Definition at line 1123 of file stressHistoFit.cxx.

References TBenchmark::GetCpuTime(), TROOT::GetSvnBranch(), TROOT::GetSvnRevision(), TROOT::GetVersion(), gROOT, init_structures(), l1DFunctions, l1DLinearFunctions, l2DFunctions, l2DLinearFunctions, listAlgosTGraph, listAlgosTGraph2D, listAlgosTGraph2DError, listAlgosTGraphError, listLinearAlgos, listTH1DAlgos, listTH2DAlgos, TBenchmark::Print(), rndm, TRandom3::SetSeed(), TBenchmark::Start(), TBenchmark::Stop(), test1DObjects(), test2DObjects(), and testUnBinnedFit().

int test1DObjects ( vector< vector< algoType > > &  listH,
vector< vector< algoType > > &  listG,
vector< vector< algoType > > &  listGE,
vector< fitFunctions > &  listOfFunctions 
)

Definition at line 641 of file stressHistoFit.cxx.

References __DRAW__, c1, THnSparse::CreateSparse(), TGraph::Draw(), TH1::Draw(), TH2::Fill(), FillVariableRange(), func(), TH1::GetBinCenter(), TH1::GetNbinsX(), h1, h2, i, j, name, TRandom::Poisson(), rndm, s1, TNamed::SetName(), SetParsLimits(), TGraph::SetTitle(), and testFitters().

Referenced by stressFit().

int test2DObjects ( vector< vector< algoType > > &  listH,
vector< vector< algoType > > &  listG,
vector< vector< algoType > > &  listGE,
vector< fitFunctions > &  listOfFunctions 
)

Definition at line 733 of file stressHistoFit.cxx.

References __DRAW__, c1, THnSparse::CreateSparse(), TH1::Draw(), TGraph2D::Draw(), TH2::Fill(), FillVariableRange(), func(), TAxis::GetBinCenter(), TH1::GetBinError(), TAxis::GetBinWidth(), TH1::GetNbinsX(), TH1::GetNbinsY(), TH1::GetXaxis(), TH1::GetYaxis(), h, h1, h2, i, j, name, TRandom::Poisson(), rndm, s1, TGraph2D::SetName(), SetParsLimits(), TGraph2DErrors::SetPoint(), TGraph2DErrors::SetPointError(), TGraph2D::SetTitle(), testFitters(), x, and y.

Referenced by stressFit().

int testFit ( const char *  str1,
const char *  str2,
const char *  str3,
TF1 func,
CompareResult const &  cmpResult,
int  opts 
)

Definition at line 503 of file stressHistoFit.cxx.

References debug, fflush(), func(), TBackCompFitter::GetFitResult(), TVirtualFitter::GetFitter(), i, ROOT::Fit::FitResult::LowerError(), max, n, CompareResult::parameters(), setColor(), sqrt(), testOptCheck, testOptChi, testOptColor, testOptDebug, testOptErr, testOptPars, and ROOT::Fit::FitResult::UpperError().

template<typename T, typename F>
int testFitters ( T object,
F *  func,
vector< vector< algoType > > &  listAlgos,
fitFunctions const &  fitFunction 
)

Definition at line 578 of file stressHistoFit.cxx.

References commonAlgos, double, fflush(), fitFunction(), func(), i, j, opts, printSeparator(), printTestName(), printTitle(), ROOT::Math::MinimizerOptions::SetDefaultMinimizer(), testFit(), testOptChi, testOptDebug, testOptErr, testOptPars, and type.

Referenced by test1DObjects(), test2DObjects(), and testUnBinnedFit().

int testUnBinnedFit ( int  n = 10000  ) 

Definition at line 881 of file stressHistoFit.cxx.

References TTree::Branch(), commonAlgos, ROOT::Math::gv_detail::dist(), f2, TTree::Fill(), TF1::FixParameter(), func(), TRandom::Gaus(), gaus2dnormal(), gausNd(), i, TUnuran::Init(), n, name, rndm, TUnuran::SampleMulti(), TreeWrapper::set(), TFormula::SetParameters(), simplexAlgos, testFitters(), treeFunctions, u, w, x, and y.

Referenced by stressFit().


Variable Documentation

const unsigned int __DRAW__ = 0

Definition at line 121 of file stressHistoFit.cxx.

vector<algoType> commonAlgos

Definition at line 223 of file stressHistoFit.cxx.

Referenced by init_structures(), testFitters(), and testUnBinnedFit().

int defaultOptions = testOptColor | testOptCheck

Definition at line 397 of file stressHistoFit.cxx.

vector<algoType> graphErrorAlgos

Definition at line 228 of file stressHistoFit.cxx.

Referenced by init_structures().

int gTestIndex = 0

Definition at line 444 of file stressHistoFit.cxx.

vector<algoType> histGaus2D

Definition at line 229 of file stressHistoFit.cxx.

Referenced by init_structures().

vector<fitFunctions> l1DFunctions

Definition at line 293 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector<fitFunctions> l1DLinearFunctions

Definition at line 296 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector<fitFunctions> l2DFunctions

Definition at line 294 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector<fitFunctions> l2DLinearFunctions

Definition at line 297 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector<algoType> linearAlgos

Definition at line 230 of file stressHistoFit.cxx.

Referenced by init_structures().

vector< vector<algoType> > listAlgosTGraph

Definition at line 233 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector< vector<algoType> > listAlgosTGraph2D

Definition at line 239 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector< vector<algoType> > listAlgosTGraph2DError

Definition at line 240 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector< vector<algoType> > listAlgosTGraphError

Definition at line 234 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector< vector<algoType> > listLinearAlgos

Definition at line 236 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector< vector<algoType> > listTH1DAlgos

Definition at line 232 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

vector< vector<algoType> > listTH2DAlgos

Definition at line 238 of file stressHistoFit.cxx.

Referenced by init_structures(), and stressFit().

const double maxX = +5.

Definition at line 380 of file stressHistoFit.cxx.

Referenced by TFractionFitter::CheckConsistency(), TFractionFitter::ComputeChisquareLambda(), TFractionFitter::ComputeFCN(), and TGLCameraOverlay::RenderAxis().

const double maxY = +5.

Definition at line 382 of file stressHistoFit.cxx.

Referenced by TFractionFitter::CheckConsistency(), TFractionFitter::ComputeChisquareLambda(), TFractionFitter::ComputeFCN(), and TGLCameraOverlay::RenderAxis().

const double minX = -5.

Definition at line 379 of file stressHistoFit.cxx.

Referenced by TFractionFitter::CheckConsistency(), TFractionFitter::ComputeChisquareLambda(), TFractionFitter::ComputeFCN(), and TGLCameraOverlay::RenderAxis().

const double minY = -5.

Definition at line 381 of file stressHistoFit.cxx.

Referenced by TFractionFitter::CheckConsistency(), TFractionFitter::ComputeChisquareLambda(), TFractionFitter::ComputeFCN(), and TGLCameraOverlay::RenderAxis().

const int nbinsX = 30

Definition at line 383 of file stressHistoFit.cxx.

const int nbinsY = 30

Definition at line 384 of file stressHistoFit.cxx.

vector<algoType> noGraphAlgos

Definition at line 226 of file stressHistoFit.cxx.

Referenced by init_structures().

vector<algoType> noGraphErrorAlgos

Definition at line 227 of file stressHistoFit.cxx.

Referenced by init_structures().

TRandom3 rndm

Definition at line 123 of file stressHistoFit.cxx.

Referenced by TClSession::Create(), FillHisto(), FillVariableRange(), TMVA::DataSetFactory::MixEvents(), TrigoFletcherFunction::StartPoints(), stressFit(), test1DObjects(), test2DObjects(), testHisto1DFit(), testHisto1DPolFit(), testHisto2DFit(), testUnBin1DFit(), and testUnBinnedFit().

vector<algoType> simplexAlgos

Definition at line 224 of file stressHistoFit.cxx.

Referenced by init_structures(), and testUnBinnedFit().

vector<algoType> specialAlgos

Definition at line 225 of file stressHistoFit.cxx.

Referenced by init_structures().

vector<fitFunctions> treeFunctions

Definition at line 295 of file stressHistoFit.cxx.

Referenced by init_structures(), and testUnBinnedFit().


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