In the following code there is obvious problem when fitting one point with pol0 which is legal and than drawing the function.
Whats the problem?
TCanvas* c = new TCanvas();
TGraph* g = new TGraph();
g->SetPoint(0, 1, 2);
TF1* f = g->GetFunction("pol0");
The fit is correct. Instead of
TF1* f = g->GetFunction(“pol0”);
The problem in this special case is that teh function is defined in the range [1,1]
ok[1, 1] is the problem but Draw(“ap”) will do nothing if g->Fit(“pol0”) but one have to fit
with constant function in a range:Fit(“pol0”, “”, “”, 0, 1) or something like this which is a bit strange but probably there is no other way.