29 double t1 = x[0] - par[1];
30 double t2 = x[1] - par[2];
31 return par[0]*
exp( - 0.5 * ( t1*t1/( par[3]*par[3]) + t2*t2 /( par[4]*par[4] ) ) ) ;
39 void fillHisto(
int n =10000) {
42 for (
int i = 0; i <
n; ++i) {
57 histo->
Fit(
"fitFcn",
"0");
62 printf(
"%s, npass=%d : RT=%7.3f s, Cpu=%7.3f s\n",fitter,npass,timer.
RealTime(),cputime);
68 void minuit2FitBench2D(
int n = 100000) {
73 fitFcn =
new TF2(
"fitFcn",fitFunction,-10,10,-10,10,5);
79 histo =
new TH2D(
"h2",
"2D Gauss",100,-10,10,100,-10,10);
86 DoFit(
"Minuit",
gPad,npass);
90 DoFit(
"Fumili",
gPad,npass);
94 DoFit(
"Minuit2",
gPad,npass);
98 DoFit(
"Fumili2",
gPad,npass);
virtual void SetParameters(const Double_t *params)
Random number generator class based on M.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
R__EXTERN TStyle * gStyle
static void SetDefaultFitter(const char *name="")
static: set name of default fitter
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
void SetStatY(Float_t y=0)
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
void Stop()
Stop the stopwatch.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
A Pave (see TPave) with a text centered in the Pave.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...
char * Form(const char *fmt,...)
virtual void Update()
Called by functions such as SetRange, SetNpx, SetParameters to force the deletion of the associated h...
A 2-Dim function with parameters.
R__EXTERN TRandom * gRandom
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
Int_t Fill(Double_t)
Invalid Fill method.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)=0
2-D histogram with a double per channel (see TH1 documentation)}