Hi bellenot,
I did look at ROOT: ROOT::Fit::FitResult Class Reference and saw the Contour() method. But when it tried to use the method it didnt seem to recognize it.
For example
root -l
root [0] ROOT::Fit::FitResult result;
root [1] result.Chi2() // if I type result.Chi and tab it completes to Chi2()
root [2] result.Contour() // if I type Cont it soesn;t complete to Contour( args )
Hi,
You have the pass the right parameters to the Contour method.
It is also more convenient to use the method re-implemented in TFitResult that uses directly a TGraph. Here is an example:
auto h1 = new TH1D("h1","h1",100,-3,3);
h1->FillRandom("gaus");
auto result = h1->Fit("gaus","S");
TGraph * gr = new TGraph(50);
// make contour of parameter 2 (sigma) vs 1 (mean)
result->Contour(1,2,gr);
gr->Draw("AL");
Thanks for suggestion. I tried it but got the following error
when compiling
root [0] .L timedistribution.C
In file included from input_line_8:1:
/tmp_mnt/home72/home48/phy/gorringe/Experiments/pienu/Analysis/timedistribution.C:866:11: error: no member named ‘Contour’ in
‘ROOT::Fit::FitResult’
result.Contour(1,2,gr);
The previous line in my code
result.GetCorrelationMatrix(mat);
compiles / works fine,
Best, Tim.