Hello,
I am using the new Minuit2 interface in ROOT to minimize chi squared function. I use the TFitterMinuit interface to do this. The relevant code is as follows.
TFitterMinuit * minuit = new TFitterMinuit();
// fcn is an object that defines the FCN function
minuit->SetMinuitFCN(&fcn);
//set and initialize the parameters
minuit->CreateMinimizer(TFitterMinuit::kSimplex);
minuit->Minimize();
TGraph* gConf = new TGraph(20); // the graph which holds the contours
TVirtualFitter* tvf = minuit->GetFitter();
tvf->GetConfidenceIntervals(gConf,0.95); // 95% confidence interval
The above code minimizes the chi-squared successfully. However, when I try to plot the confidence region, the code crashes. I find that minuit->GetFitter() returns a NULL pointer. This causes a segmentation violation subsequently. Can I fix this or is there any other way of plotting the confidence region in Minuit2?
I tried another function unsuccessfully.
virtual void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t* x, Double_t* ci, Double_t cl = 0.95)
I also need to know the value of minimized chi-squared from the TFitterMinuit interface but I can’t find a suitable function. Any help is appreciated for these two issues.
Cheers,
Tarak.