10.1. Standard Analysis Packages 585
Figure 10.1.12: Fit panel of ROOT.
and run it before calling theFitPanel. The disadvantage with this scheme is that
modifying the function would mean changing it in the macro and runningit again.
Figure 10.1.13: Fitting parameters produced by ROOT.
It is not absolutely necessary to use the fit panel for fitting. A few lines of code
in a macro can also produce the same results. In fact performing a fit from a macro
has the advantage of more flexibility in terms of choosing the fitting function. As
we just saw, using a user defined function from the fit panel means defining it in a
macro and running it. A better scheme would therefore be to simply use the fitting
function in the main code and perform the fitting over there. Fit panel is most
useful if one intends to fit the already defined functions.