Vertical fit with ROOT

Is there a way to fit a vertical track/distribution like this one ?
It seems that ROOT is not capable of fitting vertical (or close to vertical) track.

For now, the only solution I have found is to rotate the track by 90 degrees, fit and rotate back, but this is only a band aid solution.
There must be a different (and more elegant) way to do this !

Any idea guys ?

Thank you very much.

vertical.c (3.0 KB)

I guess the easiest solution would be to swap axes:

   TGraph *graph = new TGraphErrors(vec_xx.size(),&vec_yy[0],&vec_xx[0],

Otherwise, I think you would need to write your own chi2 function.

Thank you for your answer.
That is also something I tried, but I was wondering if there wasn’t something better to do.

Thank you again

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.