ROOT on your Browser

Image
Description

Essentially this project it allows for running PyROOT code through a browser without need to prepare a client machine in any specific way. This is possible due to IPython notebooks infrastructure that can run python (or R, MATLAB, Mathematica) code on a server through the browser. We wrote a simple wrapper for TCanvas objects that could be rendered in IPython-friendly way (more details on how you can wrap whatever you want is available in this notebook). Thanks to this project you can get prototype of LHCb masterclass (part 1part 2) in a readable and transparent way. Note that you can download these notebooks from nbviewer and execute on your own premises (provided you have IPython with PyROOT installed on your server). The only 2 additions you need to make to existing PyROOT program:

  • import small piece of code that you need to download and put in your notebooks folder. Start notebook with
  • import rootnotes
  • instead of TCanvas use rootnotes.default_canvas
  • mycanvas = rootnotes.default_canvas

later on when you'd like to display it inside notebook, just write mycanvas and you get cell output rendered as PNG (see below).

Goals of the project

Skills being sought

-

References and background material

http://root.cern.ch/drupal/content/ipython-notebooks-and-root-0

Prerequisites:

  • IPython (make sure you have support for notebook, it might require jinja2, pyzmq and tornado)
  • PyROOT

Actions

  1. grab rootnotes.py
  2. put it in the folder from where you start your notebook

Example

In [2]:

from ROOT import TF1
import rootnotes
c1 = rootnotes.default_canvas()
fun1 = TF1( 'fun1', 'abs(sin(x)/x)', 0, 10)
c1.SetGridx()
c1.SetGridy()
fun1.Draw()
c1

Out[2]: 

Testing notebook

Contacts
Alexander Mazurov
Andrey Ustyuzhanin