void cangaroo_fit(void) { float x[6] ={0.258.,0.299., 0.367., 0.540., 0.962., 2.454.}; float ex[6]={0.064., 0.066., 0.080., 0.102., 0.356., 0.653.}; float y[6] = {0.14e-8, 0.82e-9, 0.2e-9, 0.54e-10, 0.3e-11, 0.73e-13}; float ey[6]= {0.06e-8, 0.22e-9, 0.08e-9, 0.19e-10, 0.28e-11, 1.19e-13}; TGraphErrors * gr = new TGraphErrors(6,x,y,ex,ey); gr->SetMinimum(1e-15); TF1 * f =new TF1("f","[0]*pow(x,[1])",0.200,3.000); f->SetParameter(0,1e-11); f->SetParameter(1,-4.); // f->SetParameter(1,-4.4); TCanvas * cc = new TCanvas("cc","cc",600,400); cc->SetGridx(); cc->SetGridy(); cc->SetLogx(); cc->SetLogy(); gr->Draw("AP"); gr->Fit(f,"RLM",""); }