Physics and Engineering of Radiation Detection

(Martin Jones) #1

580 Chapter 10. Software for Data Analysis


Figure 10.1.4: A ROOT histogram obtained by double clicking the respective icon
in thetest.rootfile.


pictures. The figures can be manipulated either through commands or through a
graphical interface (see Fig.10.1.5).
The plotting methods available in ROOT have all the functionalities that are
normally required. For example, one can draw error bars, choose type of data point
display, manipulate labels and tiles, and save the figure in different formats.
One and two dimensional histograms can be filled, drawn, and displayed in ROOT
with only a few lines of code. The histogram statistics can also be drawn on the
same canvas. Modifications of the histogram are also permitted after it has been
drawn.


A.5 UsingROOT

ROOT can be used in the following three different ways.


Interactive Mode: In this mode the user invokes the CINT to interactively
issue commands. If one types rootat the command prompt, the CINT gets
invoked with a screen dump similar to the one shown in Fig.10.1.6. At this
point CINT is ready to invoke standard C++ or ROOT routines.
Running in interactive mode, however, does not mean that the user must issue
all the commands successively one at a time. One also has the option to create
amacroand then execute it from the command line. A macro is simply a
collection of all the commands in the order in which they are supposed to be
executed. A macro can be executed from command line by typingroot[ ] .x
macrofile.C;. Note that a macro does not have amain function.
Free download pdf