Dear Root Experts, I would like to fit a line in 3D, therefore I search the examples in root using minimizer options. There is an existing example to fit with the line given on the link below. https://root.cern/doc/v610/line3Dfit_8C_source.html
The example fits the graph but without errors, is there any way to include the uncertainty on the points in the fitting basically using TGraphErrors? It will be very helpful for me.
Hi,
If you have errors in both x, y and z you can use th TGraph2DError class and then you will have to modify the least square function to take into account the distance error, that you need to compute from the error on the points.
Note that if you have error only on z and not x and y and your points are distributed in a grid,
you can use the TH2D class to represent your points and use also the direct functionality of TH2::Fit using a TF1 to represent the 1D function (line).
I am using the latest version of line3Dfit example (above-mentioned link), and trying to extract the residuals (=measured data - predicted data). Is this something feasible to obtain in a 3D line fit ? I am using this procedure for Track based alignment studies.