This is a course with lectures, examples, tasks and solutions to learn programming in ROOT.
It contains the most common tasks I emply in my research: writing a tree; reading a tree; filling a histogram; fitting a histogram; overlaying histograms; comiling ROOT code in C++ or using in PyROOT
Please download the file, untar it, and read the file README.txt.
wget www.ppe.gla.ac.uk/~abuzatu/BuzatuCode/BuzatuROOT.tgz
tar xvzf BuzatuCPPROOT.tgz
cd BuzatuCPPOOT
less README.txt
Here I have functions I wrote in Python and PyROOT (ROOT from a Python interface) that help me in dealing with the histograms.
wget www.ppe.gla.ac.uk/~abuzatu/BuzatuCode/BuzatuPython.tgz
tar xvzf BuzatuPython.tgz
cd BuzatuPython
To use these function in a Python script first do
export PYTHONPATH=${PWD}/BuzatuPython:${PYTHONPATH}
and then in your .py file write
from HelperPyROOT import *
Please send me your thoughts and comments, to improve it.
http://adrianbuzatu.com/contact.html
The context of the project is the following. I am a postdoc at the University of Glasgow. I do research in experimental particle physics. It means I write software to analyse data. My experiment is ATLAS at CERN. The topic is the Higgs boson. As a community we use ROOT, a collection of C++ libraries developed by CERN to store data, analyse the data and plot the data. It works both under Linux or Mac. It also has a Python interface called PyROOT. For four years I have been teaching C++ to first year PhD students from across Scotland, under the umbrella of the Scottish Universities Physics Alliance (Glasgow, Edinburgh, Saint Andrews, Aberdeen, Dundee, Paisley, etc).