Including X errors in Chi2 minimization


I am using ROOT::Fit::Fitter Class and CHI2 minimization technique to perform the fits, I am a bit puzzled on how to include x-errors in my chi2 minimization. Can someone hint me a solution to this?

Thank you in advance.

  double chisq_radial = 0;
  for (int i_rad=1;i_rad<=h_radial_energydensity_sys->GetNbinsX(); i_rad++)
      double x_radial       = h_radial_energydensity_sys->GetBinCenter(i_rad);
      double measure_radial = h_radial_energydensity_sys->GetBinContent(i_rad);
      double error_radial   = h_radial_energydensity_sys->GetBinError(i_rad);
      //double errorx_radial   = h_radial_energydensity_sys->GetBinWidth(i_rad)/sqrt(12.);

      double func_radial    = EFK_FITRAD( &x_radial, par_r);

      if ( error_radial<=0) continue;
      double delta_radial   = (func_radial - measure_radial)/error_radial;

      chisq_radial += delta_radial * delta_radial;

_ROOT Version:6.08.00

See the “TGraphErrors fit” section in the TGraph::Fit method description.