What is CMS?


In [1]:
from IPython.display import Image
Image(filename='images/cern_cms_endon.jpg',width=400)


Out[1]:
$$pp \rightarrow \chi \chi$$

The CMS detector is designed to measure the properties of particles produced in the collisions of high energy protons at the LHC.

The CMS detector is made of many. many sub-detectors and when the particles are created in each proton-proton collision, they fly through these detectors and we are able to measure in which direction all these particles went.


In [2]:
from IPython.display import Image
Image(filename='images/small_cms1.png',width=400)


Out[2]:

These types of displays of the detector can be challenging to understand and at the end of the day, it's not what we scientists actually analyze. We use this information to get the electric charge, energy, and momentum of these particles, and that's about it.

Let's go take a look at some of that data!

The first step is to import some helper functions. One is to get the collisions data out of the files, and the other is to display the particles that are produced in these collisions.


In [3]:
import sys
sys.path.append("../tools/")

import cms_tools as cms

Next, we will open the file and pull out the collision data. This will return a Python list of all the collisions in that file.

You can use these data to visualize individual collisions or to perform a data analysis on all the collisions.


In [4]:
infile = open('../data/small_cms_test_file.dat')
collisions = cms.get_collisions(infile)

number_of_collisions = len(collisions)
print("# of proton-proton collisions: %d" % (number_of_collisions))

import matplotlib.pylab as plt
%matplotlib notebook
# Uncomment the following line if you want your plots to be displayed in a separate interactive window.
#%pylab qt


# of proton-proton collisions: 10

Let's take a look at some of these collisions!


In [7]:
cms.display_collision3D(collisions[3])



In [6]:
cms.display_collision3D(collisions[3])



In [7]:
cms.display_collision3D(collisions[6])



In [8]:
# Animate - NOT WORKING RIGHT NOW...
'''
from IPython.display import clear_output,display
import time

fig = plt.figure(figsize=(6,4))

for i in range(0,10):
    cms.display_collision3D(collisions[i],fig=fig)
    time.sleep(0.01)
    clear_output(wait=True)
    display(fig)
    fig.clear()
''';

What are we looking at here?

  • The red lines represent the protons colliding.
  • The other lines represent particles created in the collisions. The length of these lines tell us how much momentum (or energy) they have. The colors are different particles/object.

You can also make plots of the properties of the particles.


In [9]:
energies = []

for collision in collisions:
    
    jets,muons,electrons,photons,met = collision
    
    for jet in jets:
        energy,px,py,pz,btag = jet
        energies.append(energy)
    
plt.figure(figsize=(4,4))
h = plt.hist(energies)


So now you know how to play around with data from the CMS experiment at the Large Hadron Collider. What do you want to do next? :)


In [ ]: