A software layer to integrate Jupyter notebooks and ROOT.
pip install jupyter metakernelSet up the ROOT environment (. $ROOTSYS/bin/thisroot.[c]sh) and type in your shell:
This will start a ROOT-flavoured notebook server in your computer.
Alternatively, if you would like to use the Jupyter command directly, you can do:
Once the server is up, you can use ROOT with two kernels:
ROOT offers a C++ kernel that transforms the notebook in a ROOT prompt. Embedded graphics, syntax highlighting and tab completion are among the features provided by this kernel.
An example of how you would plot a histogram in a C++ ROOTbook is:
If you prefer to use Python, you can create a new Python kernel and import the ROOT libraries:
And then you could write something like:
Additionally, you can mix Python and C++ in the same notebook by using the %cpp magic: