Analysis tutorial #4: Histograms

In ROOT, histograms are implemented using the classes TH1D (or TH1F), TH2D (or TH2F) and TH3D (TH3F). The number indicates how many variables are displayed. The D or F stands for the precision of the bin content. Usually, we use “D” histograms whose bin content uses double precision. However, in some cases it might be […]

Analysis Tutorial #10: Event weights

In our examples so far we have only worked with the unweighted events. It means we have filled all the histograms with weight 1. While this is usually enough when working with real data, in case of the Monte Carlo data one usually needs to use weights. To illustrate this point, let’s make set of new plots […]

Analysis Tutorial #9: Making plots

In this section we learn how to make nice plots from the histograms we have created using our analysis program. You can always plot the histograms using the ROOT command line or TBrowser and then save them as PDF or EPS file using the window menu. However, this is not very practical if one wants […]

Analysis Tutorial #8: Parallel processing

Typically, data analysis jobs in particle physics can be very well parallelised. This is because the same operation is performed on each event, so there is no need to process all the events one after another. If one has multiple cores (or computers) available, one can split the job into multiple sub-processes (programs) where each […]

Analysis Tutorial #7: Event selection 2

In the previous example we implemented two simple boolean cuts to select events with same-flavour or different-flavour final state. Now we will implement cut on a continuous variable. When tau leptons decay leptonically, the decay is always accompanied by neutrinos which are invisible to the detector. Therefore, we only reconstruct the two light leptons, electrons […]

Analysis tutorial #6: Event selection

The data files we use in this tutorial contain simulated events of the Higgs boson decaying into pair of tau leptons that consequently decay into light leptons: electrons or muons. In the final state we can therefore have either two electrons (ee), two muons (μμ), or a mixed state (eμ or μe). Let’s now modify the […]

Analysis tutorial #5: Polishing the code using Python classes

Python is object-oriented language just like c++. So far, we have not used classes when writing the steering script. Classes can be very useful when you have a complicated setup and you do not want to copy the same code into many places. In this example, we will create python classes that will serve as “wrappers” […]

Analysis tutorial #3: Accessing data

In the previous example we have created an event loop class that can open data files and run through all the events. Now let’s add the bit where we actually access the data and read some variables. Firstly, let’s learn how we can see which objects are stored in the root file and which variables are […]

Analysis tutorial #2: Event loop

Typical dataset you’ll use in your analysis can be viewed as a table of numbers. Each row corresponds to one recorded collision event, each column some measured variable: transverse momentum of a particle, its energy, pseudorapidity, etc. In practice, the variables can have sometimes complicated types (e.g. 4-momentum can be stored as a single variable of […]

Analysis Tutorial #1: Hello world – ROOT, compiled C++, and PyROOT

Let’s first do a simple “Hello world” example and try to run it in ROOT environment, as a stand-alone c++ program, and also using the Python-ROOT interface called PyROOT. Because c++ is inherently an object oriented language, let’s make the “hello world” program using objects. First, we create a header file “HelloWorld.h”. It contains declaration of […]