ROOT Tutorial

  • MIT Room 24-307 24 Cambridge, MA 02142

Areg Danagoulian

Prof. Areg Danagoulian will give an overview of the ROOT data analysis framework. ROOT was developed by the high energy physics community, and is an extremely powerful and versatile tool for analysis of massive volumes(terrabytes and pentabytes) of data. The tutorial will consist of two, possibly three meetings:

  1. Jan. 12, 4pm, 24-307. This will be a general intro to ROOT, and will focus on the basics of C++ which are necessary to work in ROOT. The students will fire up their instances of CINT (the C++/clang interpreter), and will type up some simple C++ code.
  2. Jan. 14, 2:30pm, 24-213. This meeting will focus on ROOT itself. We'll load some data from a text file, histogram it, plot it, fit it. We'll also learn how to use ROOT's own data serializer.

Requirements and prerequisites Prerequisite: some basic knowledge of coding

Requirements: a laptop which has an ssh client (e.g. Putty in windows) and X-windows.

Preferable: have ROOT installed (see link below), or be able to run it on (see "homework" below).

Day 1: Jan 12th, 4-5:30pm, 24-307


  1. The (old) MIT ad.
  2. The slides for day 1.
  3. ROOT website:
  4. Index of the ROOT classes.


  1. C++
    1. The C++ tutorial. Use ROOT/CINT to practice, and also...
    2. codingground: an online C++ compiler platform.
  2. start playing with root, on athena:
    1. > ssh -X
    2. > cp ~aregjan/file0.dat . < - - - this is for later
    3. > add root
    4. > root
  3. Optional:
    1. Install ROOT locally. Preferably -- build from source. Ubuntu users can apt-get root-system from the repos.
    2. ROOT examples to play with, (very) optional.

Day 2, Jan 14th, 2:30-4pm, 24-213

Overall agenda

  • General exercises in ROOT
    • TH1 class, TH1F class, documentation, examples
    • Create and fill a histogram
    • "Low level" info:
      • GetBinContent(), GetNBins(), other things from the index
      • SetBincontent
    • Plot -- many different ways
    • fit, analyze
    • GUI operations
      • The editor, toolbar, status bar. Overlay graphics/text
    • Macro format output
  • Playing with data!
    • Read in ascii text data into ROOT
    • Save the data to a .root format
    • "Scan"
    • (maybe) GetEntry(), tr->GetBranch("x")->GetLeaf("x")->GetValue()
    • Plot:
      • Scatter plots
      • Plots with conditions/cuts. "Scan" with the same conditions
      • Graphical cuts! CUTG
      • 2D histos
      • Plotting options
      • 2D->1D projections
    • fit, analyze
  • Scripting
    • Macros
    • Script functions
  • PyROOT (time remaining)
    • Access ROOT from Python


  1. Link to the slides for day 2.
  2. Text data file

For more information: Areg Danagoulian,