Particle physics is kind of a hobby of mine and since some time it is even possible to get access to some of the data generated with the LHC accelerator at CERN.
One such dataset is from the LHCb experiment, which gives you access to data about decays of B-mesons to three hadrons. The largest file is some 636MB (B2HHH_MagnetDown.root) which I chose to start exploring.
Exploring means that at the start I do not know exactly what kind of data is in there. So I had to do some exploring and decided to start with just reading out some data and drawing graphs with it. For starters, I am not primarily interested in the physics, but in how to work with the data and what I can use it for. So I study the toosl and the programming, but it is clear that at the same time I analyse the data, I will have to study the physics behind it, otherwise it is not possible to make useful evaluations.
Apparently, one of the decay modes of a B-meson is three hadrons, which seems to be a not so common way for it to decay.
I decided to pick out the transverse momenta of the hadrons H1, H2 and H3 and see how they are distributed.
The dataset gives three parameters per hadron: Hn_PX, Hn_PY and Hn_PZ, where n runs from 1 to 3, For the transverse momenta I used Hn_PX and Hn_PY and plotted a histogram for each.
Here are the results of my first attempt at working with the dataset:
Interestingly, that doesn’t look like any other graph I found on the Internet on this topic and I am still trying to figure out some things.
There are more than 5.135 mln events in this dataset.
I think the momenta are given in MeV/c2, so the results are between 0.8 and 5.5 GeV/c2 (x-axis) and the y axis shows the number of events with that momentum.
The code looks like this:
import ROOT import uproot import root_pandas as rpd import pandas as pd import numpy as np import matplotlib.pyplot as plt if __name__ == '__main__': fn = "/var/Data/Datasets/CERN/LHCb/B2HHH_MagnetDown.root" fh = ROOT.TFile.Open(fn) f_tree = fh.Get('DecayTree') #f_tree.Print() df = rpd.read_root(fn, key='DecayTree') df_pd = pd.DataFrame(df) #print(df.head(5)) hadrons = ['H1','H2','H3'] df.eval('H1_PT = sqrt(H1_PX**2 + H1_PY**2)', inplace=True) df.eval('H2_PT = sqrt(H2_PX**2 + H2_PY**2)', inplace=True) df.eval('H3_PT = sqrt(H3_PX**2 + H3_PY**2)', inplace=True) bins = np.linspace(80, 5500, 100) for hadron in hadrons: plt.ylim(0,300000) plt.xlabel("Transverse Momentum (MeV/c2) of " + hadron) plt.ylabel("Number") plt.hist(df[hadron + "_PT"],bins=bins) plt.savefig('Images/hist-' + hadron + '.png') plt.close()
Note: This is work in progress, the physics behind it needs lots of reading and learning, but at least I figured out how to work with the datasets, and how to use ROOT and Python to access the data.
Also, I used CPU and the calculation speed was not to bad for this example (a few seconds on my notebook).