At the end i undertood that I had to fit with TF1 using a branch of an ellipse, but it didn’t fit yet.
Double_t f(Double_t *x, Double_t*par)
{
Double_t val =par[0]+par[1]*sqrt(par[2]-((1/par[3]*par[3])*pow(x[0]-par[4],2))) ;
return val;}
void myfunc(){
Double_t x[12]={128,129,130,133,134,135,134,135,133,131,129,123};
Double_t y[12]={111,110,111,112,114,119,122,123,126,128,129,122};
Double_t errx[12]={0,0,0,0,0,0,0,0,0,0,0,0};
Double_t erry[12]={0,0,0,0,0,0,0,0,0,0,0,0};
//create graph
TGraphErrors *graf = new TGraphErrors(12,x,y,errx,erry);
graf->SetTitle("Traiettoria S1");
graf->SetMarkerStyle(6);
graf->SetMarkerColor(kBlack);
graf->SetLineColor(kBlack);
//DEFINE USER FIT
TF1*f2=new TF1("f2","f",128,134,5);
f2->SetParameters(2,3,4,5,16,8);
f2->SetParName(0,"a");
f2->SetParName(1,"b");
f2->SetParName(2,"c");
f2->SetParName(3,"d");
f2->SetParName(4,"e");
f2->SetParName(5,"f");
f2->GetChisquare(); // Chiquadro
f2->GetNDF(); //Gradi di libertà
f2->GetParameter(0); //valore del parametro i-esimo
f2->GetParameter(1);
f2->GetParameter(2);
f2->GetParameter(3);
f2->GetParameter(4);
//f2->GetParameter(5);
TCanvas *c1=new TCanvas ("c1","fk",200,10,400,800);
c1->SetLogy();
c1->SetGrid();
graf->GetXaxis()->SetTitle(" x (pixel)");
graf->GetYaxis()->SetTitle("y (pixel)");
graf->Fit("f2","R");
f2->SetLineColor(kRed); f2->SetLineStyle(2);
gStyle->SetOptFit(11111);
graf->Draw("APE");
TLegend *leg =new TLegend (.1,.7,.3,.9,"");
leg->SetFillColor(0);
leg->AddEntry(graf,"Punti");
leg->AddEntry(f2,"FIT");
leg->Draw("SAME");
}