Physics and Engineering of Radiation Detection

(Martin Jones) #1

10.1. Standard Analysis Packages 583


Figure 10.1.8: Macro to run from the command line interface
of ROOT.

Figure 10.1.9: Screen dump of ROOT output of the macro
example1.Cexecuted at the command line.

To run this macro we type.x graph.C;at the commandline interface of ROOT.
This produces a graph ofyversusxas shown in Fig.10.1.11. Our next step is to fit
a regression line to the data.
As mentioned earlier, ROOT provides a number of libraries to fit standard and
user defined functions to data. Here, since the data show an obvious linear trend,
therefore we will try to fit a straight line. The easiest way to do this is to use
ROOT’s fit panel, which is a graphical user interface specifically designed for fitting.
It can be invoked by right clicking on any data point in the graph of Fig.10.1.11 and
then selecting theFitPanelmethod (see Fig.10.1.12).
Now, we want to use this panel to fit a straight line to our graph. Since we know
that a straight line is a first order polynomial, we will selectpol1from the panel.
Subsequent clicking onFitproduces a screen dump on the command line interface
as shown in Fig.10.1.13. Since we did not select the”Do not draw function”option
from the fit panel, the corresponding fit line will also be drawn on the graph (see
Fig.10.1.14). Fit panel provides the user with built in options of fitting an up
to 9th order polynomial. Other built in functions include Guassian, Landau, and
exponential. However one is not restricted to these functions only, since essentially

Free download pdf