Title: ROOT
1ROOT
- An object oriented HEP analysis framework.
Day 1
2ROOT User's Workshop
- Fermilab
- June 13-15, 2001
- http//patwww/root/root2001/
3The ROOT Team
4ROOT contacts at Fermi
- Philippe Canal , x2545 pcanal_at_fnal.gov
- Suzanne Panacek, x8334 spanacek_at_fnal.gov
-
- Jeff Kallenbach, x2210
- jeffk_at_fnal.gov
5Mailing Lists
- the ROOT mailing list
- roottalk_at_root.cern.ch
- archives
- http//root.cern.ch/root/roottalk/AboutRootTalk.ht
ml - Fermilab mailing list
- about-root_at_fnal.gov
- archives
- http//listserv.fnal.gov/archives/about-root.html
6Class Schedule
- Day 2
- Monday, 3/19/01 9AM 11AM in EOC Large Class
Room - Day 3
- Tuesday, 3/20/01 1PM- 3PM in EOC Large Class
Room
7Class Schedule - Day 1
- Overview of the ROOT Framework
- GUI basics
- Command line basics
- Finding Information (class reference guide)
- Getting started with the exercises
8Class Schedule - Day 2
- Root Commands and CINT
- Discuss Exercises
- Functions and Fitting
- The Tree Viewer
9Class Schedule - Day 3
- Building ROOT Trees
- Reading Trees
- Using Trees in Analysis
- TTree-gtDraw
- TTree-gtMakeClass
- Chains
- Exercise discussion
- How to add your Own Class
- With the Interpreter
- With the compiler (shared library)
- With ACLiC
10ROOT Overview
- What about PAW
- Concepts Object Oriented Design, Frameworks
- Services and Utilities
- Libraries
- Physical Organization
11Differences from PAW
- Regular grammar (C) on command line
- Single language (compiled and interpreted)
- Object Oriented (use your class in the
interpreter) - Advanced Interactive User Interface
- Well Documented code. HTML class descriptions for
every class. - Object I/O including Schema Evolution
- 3-d interfaces with OpenGL and X3D.
12PAW to ROOT File Conversion
- Get the example PAW file from http//www-pat.fnal
.gov/root/examples/toyz.rz - At the system prompt type
- gt h2root toyz.rz toyz.root
- Once you've done the conversion, you can then
start a ROOT session and open toyz.root - Also see http//root.cern.ch/root/HowtoConvert.ht
ml
13Object Oriented Concepts
- Class the description of a thing in the
system - Object instance of a class
- Methods functions for a class
- Members a has a relationship to the class.
- Inheritance an is a relationship to the class.
14A Framework
provides utilities and services.
15ROOT's Services/Utilities
- Histogramming and Fitting
- Graphics (2D, 3D)
- I/O to file or socket specialized for
histograms, Ntuples (Trees) - Collection Classes and Run Time Type
Identification - User Interface
- GUI Browsers, Panels, Tree Viewer
- Command Line interface C interpreter CINT
- Script Processor (C compiled ? C
interpreted)
16The Libraries
- Over 350 classes
- Core
- CINT
- Libraries loaded at startup Hist, Tree
- Libraries loaded when needed HistPainter,
TreePlayer, - Special purpose libraries EG, Physics
17The Framework Organization
18Three User Interfaces
- GUIwindows, buttons, menus
- Root Command lineCINT (C interpreter)
- Macros, applications, libraries (C compiler and
interpreter)
19ROOT Overview Summary
- PAW
- Concepts Object Oriented Design, Frameworks
- Services and Utilities
- Libraries
- Physical Organization
20GUI Basics
- Browsing and opening files
- Drawing histograms
- Right click, left click, middle click
- Draw Panel
- Fit Panel
- Adding Color and Zooming
- Adding text and other objects
- Dividing the canvas
- Setting the log scale
21GUI Basics
Start root gt root Quit root (just in case)
root0gt.q
- Display the browser
- TBrowser b
22Displaying a Histogram
Open the root file Browse the file
- Display a histogram The Canvas
23Basic Navigation by Clicking
- Left Click
- select the object
- drag the object
- resize the object
- Right Click
- context menu
- classname
- methods
- Middle Click
- activate canvas
- freezes event status bar
24The Draw Panel
The Draw Panel Adding Error bars Slider Defaults
25Fitting, Coloring, and Zooming
- Adding a gaussian fit
- Coloring the histogram
- Zooming/unzooming
26Adding Objects to the Canvas
- The Editor
- Adding an Arrow
- Adding Text
27Adding another Pad
- Add a Pad
- Select the new Pad
- Draw a histogram
- Add a title for the axis
28Modifying the Statistics
- The Canvas in the Browser
- Setting the (7) statistics options
- default 0001111
29Dividing the Canvas
- Create a new Canvas
- Divide it in 2
- Draw two histograms.
- 1. Lego plot
- 2. LogY
30Command Line Basics
- Use up and down arrows to recall commands
- HOME/.root_hist
- Use emacs commands to navigate
31Open a File
- Open a file for reading
- root TFile f("Example.root")
- Look at the contents of the file
- root f.ls()
- TFile Example.root ROOT file
- TFile Example.root ROOT file
- KEY TTree myTree1 Example ROOT tree
- KEY TH1F totalHistogram1 Total
Distribution - KEY TH1F mainHistogram1 Main Contributor
- KEY TH1F s1Histogram1 First Signal
- KEY TH1F s2Histogram1 Second Signal
32Plotting a Variable
- Plot a variable
- root myTree-gtDraw("xs1")
- Where did myTree come from?
- ROOT executed an implicit gROOT-gtFindObject("myTr
ee") - And now..
- root f.ls()
- OBJ TTree myTree Example ROOT tree 0 KEY
TTree myTree1 Example ROOT tree
33The ROOT File
- A TFile is a directory structure like UNIX
- Object in Memory (OBJ) Object on Disk (KEY)
34The ROOT Tree
- Stores large quantities of same class objects
- Optimize disk space
- Optimize access speed
- Had analysis methods (TTreeDraw)
- TNtuple is a TTree limited to floating point
numbers. - More details later
35Fitting
- To add a Gaussian Fit
- root htemp-gtFit("gaus")
- Where did htemp come from?
- automatically generated histogram by the
TTreeDraw command.
36Color and Error Bars
- To add color
- root htemp-gtSetFillColor(9)
- See pg. 134 of the Users Guide for color index
- Or on any Canvas choose ViewColors
- Drawing Error Bars
- root htemp-gtDraw("E1,same")
- Many Draw Options
- See the User's Guide
37Command Line Basics
- Open and browse a file
- Drawing histograms
- Adding a Fit
- Adding Error bars
- Adding Color
38Where to Find Information
- The ROOT Home http//root.cern.ch
- Talks and publications on ROOT
http//root.cern.ch/root/Publications.html - To get information on a specific class
http//root.cern.ch/root/html/ClassIndex.html
39Class Reference Guide
- Find the class in the index, for example TH1.
- Class Inheritance
- class TH1 public TNamed, public TAttLine,
public TAttFill, public TAttMarker - Class Description
- Private members
- Public methods
- Code
40Finding Examples
- The ROOT Tutorials http//root.cern.ch/root/Tutor
ials.html - The ROOT How To's http//root.cern.ch/root/Howto.
html - For on-line help for a particular topic it's very
useful to use their facility to search the ROOT
site. http//root.cern.ch/root
41More Information
- To subscribe to roottalk http//root.cern.ch/root
/roottalk/AboutRootTalk.html - To submit a bug reporthttp//pcroot.cern.ch/root
-bugs - About ROOT at Fermi about-root_at_fnal.gov
- http//ods.fnal.gov/ods/root-eval/current/
- To subscribe to the about-root mailing list send
mail to listserv_at_fnal.gov with the body of the
email subscribe about-root email_at_addresses.
42Summary
- Overview of ROOT
- GUI Basics
- Command line basics
- Using the Class reference guide
- PAW to ROOT conversion
43Getting started with the Exercises
- Go to http//patwww.fnal.gov/root/class/Setup.htm
for setup instructions using Reflection and ssh
on fcdfsgi2 and d0mino and minos1. - Find the exercises on line at
- http//patwww.fnal.gov/root/class/exercises.htm