Skip to content

suvayu/rplot

Repository files navigation

Introduction

This project provides a few Python libraries to easily plot ROOT objects.

rdir
interface to browse multiple ROOT files.
rplot
interface to plot ROOT objects.
rplotsh
script to interactively browse multiple ROOT files, read objects, and plot them.
r2mpl
ROOT to matplotlib translation layer.

Installation

At the moment there are no install scripts. So all you need to do is add a symlink to the python script rplotsh.py somewhere in your path. This is what I do:

$ export PATH=~/bin:$PATH
$ ln -s ~/bin/rplotsh /path/to/repo/rplotsh.py

After the above steps, rplotsh should work from anywhere.

Tasks

rplotsh [0/5]

Plotting

plot <object> | <list>

Plot settings

set grid ...
set linestyle | linecolour | linewidth ...
set stack
set legends ...

WInP Manipulate objects in memory [1/2]

  • [X] list objects
    lsmem [memobj]...
        
  • [ ] move objects to container
    mv <memobj>... <container>
        

Inspect objects in the file

cat | print [-v] <obj>
  • For histograms, graphs, etc, show contents
  • For trees, show branch information

Tree commands

  • Inspect (range of) entries, branches
  • Looping constructs
  • Splicing trees into subtrees by selection. How to do this?
    • entrylist: book keeping
    • clonetree: possible memory issues

RooFit commands

  • Browse workspace

Rplot [2/4]

Line style, width

Marker style, size

Automatic legends

  • State “WInP” from “TODO” [2015-05-23 Sat 11:49]

Stack

r2mpl [0/1]

Translate ROOT histogram to numpy array

Histograms in mpl still retain the dataset granularity, whereas it is lost in ROOT. Need to fake this behaviour during conversion.