AliRoot Core  3dc7879 (3dc7879)
AliTMinuitToolkitTest.C File Reference
#include "AliTMinuitToolkit.h"
#include "TTree.h"
#include "TTreeStream.h"
#include "TF1.h"
#include "TVectorD.h"
#include "TString.h"
#include "TRandom.h"
#include "TH1.h"
#include "TCanvas.h"
#include "TLegend.h"
#include "TStyle.h"
#include "AliSysInfo.h"
#include "TGraphErrors.h"
#include "TStatToolkit.h"
#include "AliDrawStyle.h"
Include dependency graph for AliTMinuitToolkitTest.C:

Go to the source code of this file.

Functions

TF1 likeGausCachy ("likeGausCachy", AliTMinuitToolkit::GaussCachyLogLike,-10, 10, 2)
 
TF1 likeAbs ("likeAbs","abs(x)",-10, 10)
 
void GenerateInput ()
 Generate input data for the test. More...
 
void Test1D (Int_t bootStrapIter=400)
 
void AliTMinuitToolkit_TestHistogram (Int_t nIter)
 This test function shows the basic working principles of AliTMinuitToolkit. More...
 
void AliTMinuitToolkitTest (Int_t nIter, Int_t nPoints=1000)
 

Variables

Int_t fitEntries =400
 test of AliTMinuiToolkit class - log likelihood fits More...
 
const Int_t kNDim =10
 
const Int_t kLineColors [5] ={1,2,4,3,6}
 
const Int_t kLineStyle [5] ={1,7,10,1,2}
 
TTree * inputTree =0
 

Function Documentation

void AliTMinuitToolkit_TestHistogram ( Int_t  nIter)

This test function shows the basic working principles of AliTMinuitToolkit.

  • illustrates how a robust fit can improve the results for histogram fitting
  • low level interface shown
    • user create fitter
    • define log likelihood function
  • Algorithm:
    • 0.) define input:
      • 0.1) create example histogram with outliers
      • 0.1) create fit functions
    • 1.) Make fits
      • 1.1) Example fits with chi2 minimization
      • 1.2) Use "robust" custom user defined log likelihood function e.g gauss+background cachy
      • 1.3) Use predefined huber cost function
    • 2.) Use different fit strategies to avoid local minimum
AliTMinuitToolkit_TestHistogram.png

TODO - add exponential fitter to the list of predefined fitters

Parameters
nIter

Definition at line 103 of file AliTMinuitToolkitTest.C.

Referenced by AliTMinuitToolkitTest().

void AliTMinuitToolkitTest ( Int_t  nIter,
Int_t  nPoints = 1000 
)

Run AliTMinuitToolkitTest

Parameters
nIter
nPoints

Definition at line 46 of file AliTMinuitToolkitTest.C.

void GenerateInput ( )

Generate input data for the test.

Definition at line 57 of file AliTMinuitToolkitTest.C.

Referenced by AliTMinuitToolkitTest().

TF1 likeAbs ( "likeAbs"  ,
"abs(x)"  ,
10,
10   
)

Referenced by Test1D().

void Test1D ( Int_t  bootStrapIter = 400)

Definition at line 229 of file AliTMinuitToolkitTest.C.

Referenced by AliTMinuitToolkitTest().

Variable Documentation

Int_t fitEntries =400

test of AliTMinuiToolkit class - log likelihood fits

/

Example usage:

1 AliDrawStyle::SetDefaults();
2 AliDrawStyle::ApplyStyle("figTemplate");
3 .L $AliRoot_SRC/STAT/test/AliTMinuitToolkitTest.C+

Definition at line 31 of file AliTMinuitToolkitTest.C.

Referenced by AliTMinuitToolkitTest(), GenerateInput(), and Test1D().

TTree* inputTree =0

Definition at line 38 of file AliTMinuitToolkitTest.C.

Referenced by GenerateInput(), AliTMinuitToolkit::GetStreamer(), and Test1D().

const Int_t kLineColors[5] ={1,2,4,3,6}

Definition at line 33 of file AliTMinuitToolkitTest.C.

Referenced by Test1D().

const Int_t kLineStyle[5] ={1,7,10,1,2}

Definition at line 34 of file AliTMinuitToolkitTest.C.

Referenced by Test1D().

const Int_t kNDim =10

Definition at line 32 of file AliTMinuitToolkitTest.C.

Referenced by GenerateInput().