Read a ROOT file

After installation of a binary kit, you start gopaw with:

    UNIX> <install_path>/gopaw/<version>/bin/gopaw  # UNIX here is for Linux and macOS.
 on Windows:
     DOS> <install_path>\gopaw\<version>\bin\gopaw.exe

Note that on Windows you must run from a DOS prompt (CMD.exe), it does not work from a cygwin prompt.

A distribution comes with examples to play with under the res/gopaw/examples directory. The below instructions are based on data files (for example data_pawdemo.root) found under this directory. The best is to have a local copy of this directory and work on that.

    UNIX> cp -R <install_path>/gopaw/<version>/res/gopaw/examples .
    UNIX> cd examples/gopaw  # in this directory there is a data_pawdemo.root file.
    UNIX> <start gopaw> 
 on Windows:
     DOS> xcopy /s /q /i <install_path>\gopaw\<version>\res\gopaw\examples examples
     DOS> cd examples\gopaw
     DOS> <start gopaw> 

In the same way than for HDF5, you can read and plot histograms and ntuples in root files. For example, you can look at the pawdemo.kumac script that works on the data_pawdemo.root file:

MACRO pawdemo
* Copyright (C) 2018, Guy Barrand. All rights reserved.
* See the file gopaw.license for terms.
* Histogram and ntuple from a ROOT file.                                         *
exec alldef
exec ttf
opt stat
ZONE 2 3
h/file 1 data_pawdemo.root
ldir  * list objects in the file.
h/plot h100
cd //lun1/BS   * change current directory in the file.
h/plot h110
* work on an ntuple :
cd //lun1/STAFF
n/print h10
n/plot h10.Category
n/plot h10.Age
n/plot h10.Age%Cost
close 1

If executing this script with:

   GOPAW> exec pawdemo

you should see in the graphics window: