Calculating the invariant mass#

In this example we show how to calculate the invariant mass with the CMS open data. The invariant mass is an important concept for particle physicists when looking for new particles.

What is the invariant mass?#

Particles have a mass that describes their inertia. It is the same mass \(m\) that is used in Newton’s second law \(F=ma\) and Einstein’s equation \(E=mc^2\) (where E means the energy of the particle at rest). It is impossible to measure e.g. Higgs boson, whose mean lifetime is in the order of \(10^{-22}\) seconds [4]. When a particle such as the Higgs boson decays, new particles are formed. The new particles may move at very high speeds and may even not have a mass (e.g. photons). However, a device such as CMS can measure the momentum and energy of these particles, from which we can calculate the invariant mass. It is a property that is “invariant” to the environment it’s measured in. If it is calculated to two particles that come from another particle, we achieve a value that is close to the mass of the original particle. For example, the Higgs boson can decay into four electrons, whose momentum and energy we can measure with a detector. From these we can calculate the invariant mass, which would correspond to the mass of the Higgs boson, since the electrons come from Higgs.

The invariant mass is conserved when a particle decays into other particles, which makes it an unbeatable tool for particle physics. A detector such as the CMS detects mostly stable particles. In order to determine which decay processes produce these stable particles, researchers must analyze large amounts of data. We can calculate the invariant mass to multiple different events and make a histogram out of our calculated values.

Below we have a histogram of the invariant mass of collisions where a detector has registered two muons. The spikes in the histogram correspond to the different particles the muons decay from.



Getting the data#

# Import the necessary modules. Pandas is for the data-analysis and numpy for scientific calculation.
# Name these to "pd" and "np".
import pandas as pd
import numpy as np

# 
# Create a new DataFrame structure and save it in the file 'dataset'. 
# Data can be obtained from a file with the read_csv() -function. Inside the parentheses, we write the path of the file.
# In this case, we use a web address.
dataset = pd.read_csv('http://opendata.cern.ch/record/307/files/Zmumu.csv')

We can check the content that we saved to the variable dataset by printing the 5 first rows with the head()-function:

dataset.head()
Type Run Event E1 px1 py1 pz1 pt1 eta1 phi1 Q1 E2 px2 py2 pz2 pt2 eta2 phi2 Q2 M
0 GT 148031 10507008 82.201866 -41.195288 17.433244 -68.964962 44.7322 -1.217690 2.741260 1 60.621875 34.144437 -16.119525 -47.426984 38.8311 -1.05139 -0.440873 -1 82.462692
1 TT 148031 10507008 62.344929 35.118050 -16.570362 -48.775247 38.8311 -1.051390 -0.440873 -1 82.201866 -41.195288 17.433244 -68.964962 44.7322 -1.21769 2.741260 1 83.626204
2 GT 148031 10507008 62.344929 35.118050 -16.570362 -48.775247 38.8311 -1.051390 -0.440873 -1 81.582778 -40.883323 17.299297 -68.447255 44.7322 -1.21769 2.741260 1 83.308465
3 GG 148031 10507008 60.621875 34.144437 -16.119525 -47.426984 38.8311 -1.051390 -0.440873 -1 81.582778 -40.883323 17.299297 -68.447255 44.7322 -1.21769 2.741260 1 82.149373
4 GT 148031 105238546 41.826389 22.783582 15.036444 -31.689894 27.2981 -0.990688 0.583351 1 49.760726 -20.177373 -9.354149 44.513955 21.8913 1.44434 -2.707650 -1 90.469123

The data has multiple events, each of which contain multiple values. The most important variables for our purposes are:

  • Run: The run number of the event

  • Event: The event number. An event is a collision of particles occurring in the detector.

  • E: the energy of the muon (1 or 2).

  • px,py,pz: the components of the momentum of the muon.

Performing the calculation#

Let us use the following expression for the invariant mass \(M\) in the calculation:

\[ M = \sqrt{(E_1 + E_2)^2 - \|\textbf{p}_1 + \textbf{p}_2 \| ^2} = \sqrt{(E_1+E_2)^2-((p_{1_x}+p_{2_x})^2+(p_{1_y}+p_{2_y})^2+(p_{1_z}+p_{2_z})^2)},\]

where \(\textbf{p}\) contains all the components of the momentum. The equation above gives us the precise value of the invariant mass, so let’s use it when possible.

However, some datasets son’t have the components of the momentum in them. In this case, we can use an approximation that works in situations where E >> m (as is often the case in particle detectors):

\[M = \sqrt{2p_{T1}p_{T2}(\cosh(\eta_1-\eta_2)-\cos(\phi_1-\phi_2))}.\]

In the expression \(p_T\) is the component of the momentum which is perpendicular to the beam axis, \(\eta\) is the pseudorapidity (angle) and \(\phi\) the azimuthal angle.

In the calculation below we will use the numpy module which was named as np in the first code cell. With numpy it is possible to use mathematical commands like sqrt and cosh by calling first the name of the module (np) and then the command separated by a dot. So for example, the square root can be called by writing np.sqrt( ).

The pt1, pt2, eta1, eta2, phi1 and phi2 refer to the columns of the data. The code has to be told from where the values will be taken. So for example, if you want to get the column pt1, you have to write dataset.pt1.

Now we are ready to calculate the values of the invariant masses for the different events. Numpy will automatically calculate the values for all of the events when we give the calculation in the following form, so the equation given is calculated for all of the rows.

Exercise: Calculate the invariant mass to all events and save it in the file ‘invariant_mass’#

# Write your code here

After the calculation we can check which values were saved in the variable invariant_mass by using the method head():

# Write your code here

Great, you have now calculated the invariant mass of the events! Next, we’d like to draw a histogram. More about this in the next part, “Plotting the invariant mass histogram.”

Sources#

[1] McCauley, Thomas; (2014). Z to two muons from 2010. CERN Open Data Portal. DOI:10.7483/OPENDATA.CMS.XBN9.HFGT

[2] Determination of the off-shell Higgs boson signal strength in the high-mass ZZ final state with the ATLAS detector. Url: https://atlas.cern/updates/physics-briefing/higgs-boson-s-shadow

Figures#

[Figure 1] HLT Dimuon Invariant Mass Distributions in 2017 and 2018 ( CMS DP-2018/055) Url: https://twiki.cern.ch/twiki/bin/view/CMSPublic/HLTDiMuon2017and2018