What is ROOT?
The ROOT system provides a set of OO frameworks with all the functionality needed to handle and analyze large amounts of data in a very efficient way. See here for more about ROOT.
Chapter 1. Getting Started
Command line
root [-?] [-b] [-q] [filename]
-? : for help information
-b : run in batch mode without graphics
-q : run root then quit
filename : execute the source file
CINT commands start with "."
root[] .? //show help information of CINT/ROOT C/C++ interpreter
root[] .L //load file, note: not upper case not lower case
root[] .x //execute file
root[] .!ls //os shell command
For more useful CINT commands, use command ".?".
Use TAB to invoke helpful hints(works like linux shell)
TObject::Dump() and TObject::Inspect() are useful methods to see the state of an object.
Using GUI
Inheritance:
TObject<--TPad<--TCanvas
• Only one TCanvas can be active at a time
• Only one Tpad can be active at a time
• Every object have a method Draw()
Editor Frame
e.g. TAxis ~ TAxisEditor
Context Menu
Right click any object in canvas to get its context menu showing available methods. This can be alternative to
Interact with the GUI to make the picture suit your wishes. Once done you can save it into various formats(like GIF, C, etc.)
Multi-pad Canvas
root[] TCanvas *MyC = new TCanvas("MyC","Test canvas",1)
root[] MyC->Divide(2,2) // 2 * 2, total 4 pads
root[] MyC->Cd(1) // Pad 1 is the active pad
root[] f1->Draw() // Function f1 is drawn on pad 1
root[] MyC->Cd(3) // switch to Pad 3, which is the active now
root[] MyC_3->Cd() // equivalent to the previous line assuming MyC_3 is a pointer to the third pad in the canvas
Global Variables
- gROOT: get a set of global variables, like functions, browsers, classes, colors, etc.
- gFile: (don't understand)
- gDirectory:(don't understand)
Common Methods:
TF1
• Eval
• Derivative
• Integrate
• Draw
• SetNpx: how many equidistant points to draw