CMS Open Data Example #3: Di-Muon Resonances


Import Modules and Turn on Javascript

In [1]:
from ROOT import TTree, TFile, TCanvas, TH1F, TLorentzVector

%jsroot on
Welcome to JupyROOT 6.07/07

Read in Data from Input File

In [2]:
file = TFile("data/Dimuons.root","READ");

Compute Di-Muon Invariant Mass

Let's calculate again the invariant mass $M$ of two muons and focus on various parts of the dimuon mass spectrum

Setup a Canvas

In [3]:
Canvas = TCanvas()

Declare Histograms

For dimuon mass regions of interest 2.5-3.5 GeV and 80-100 GeV

In [4]:
J_psi    = TH1F("J_psi",  "#mu#mu mass;#mu#mu mass [GeV];Events", 100, 2.5, 3.5)

Z_boson  = TH1F("Z_Boson","#mu#mu mass;#mu#mu mass [GeV];Events", 200, 80, 100)

Loop Over the Events in the Data File

Compute Di-Muon Invariant Mass and Fill Histograms for Various Resonances

In [5]:
for dimu in file.Dimuons:
    
    if dimu.Muon1_Global and dimu.Muon2_Global:

        muon1 = TLorentzVector(dimu.Muon1_Px, dimu.Muon1_Py, dimu.Muon1_Pz, dimu.Muon1_Energy)
    
        muon2 = TLorentzVector(dimu.Muon2_Px, dimu.Muon2_Py, dimu.Muon2_Pz, dimu.Muon2_Energy)
    
        InvariantMass = (muon1 + muon2).M()
        
        if  InvariantMass > 2.0 and InvariantMass < 3.5:
            
               J_psi.Fill(InvariantMass)
        
        if  InvariantMass > 60.0 and InvariantMass < 120.0:
            
               Z_boson.Fill(InvariantMass)        

Plot the J/$\psi$ Peak (Nobel Prize-Winning Discovery in 1974)

In [6]:
J_psi.Draw()

Canvas.Draw()

Plot the Z Boson Peak (Nobel Prize-Winning Discovery in 1983)

In [7]:
Canvas.Clear()

Z_boson.Draw()

Canvas.Draw()

Compare with the Z boson discovery plot

Exercise: Can You Spot Other Di-Muon Resonances in the Dimuon Spectrum?

Make a Separate Histogram For Each One and Plot It

In [11]:
from ROOT import TTree, TFile, TCanvas, TH1F, TLorentzVector

%jsroot on

file = TFile("data/Dimuons.root","READ");

Canvas = TCanvas()

Upsilon    = TH1F("Upsilon",  "#mu#mu mass;#mu#mu mass [GeV];Events", 10, 8.5, 11)

for dimu in file.Dimuons:
    
    if dimu.Muon1_Global and dimu.Muon2_Global:

        muon1 = TLorentzVector(dimu.Muon1_Px, dimu.Muon1_Py, dimu.Muon1_Pz, dimu.Muon1_Energy)
    
        muon2 = TLorentzVector(dimu.Muon2_Px, dimu.Muon2_Py, dimu.Muon2_Pz, dimu.Muon2_Energy)
    
        InvariantMass = (muon1 + muon2).M()
        
        if  InvariantMass > 8.5 and InvariantMass < 11:
            
               Upsilon.Fill(InvariantMass)
                
Upsilon.Draw()

Canvas.Draw()
In [12]:
from ROOT import TTree, TFile, TCanvas, TH1F, TLorentzVector

%jsroot on

file = TFile("data/Dimuons.root","READ");

Canvas = TCanvas()

Psi2s    = TH1F("Psi2s",  "#mu#mu mass;#mu#mu mass [GeV];Events", 20, 3.2, 4)

for dimu in file.Dimuons:
    
    if dimu.Muon1_Global and dimu.Muon2_Global:

        muon1 = TLorentzVector(dimu.Muon1_Px, dimu.Muon1_Py, dimu.Muon1_Pz, dimu.Muon1_Energy)
    
        muon2 = TLorentzVector(dimu.Muon2_Px, dimu.Muon2_Py, dimu.Muon2_Pz, dimu.Muon2_Energy)
    
        InvariantMass = (muon1 + muon2).M()
        
        if  InvariantMass > 3.2 and InvariantMass < 4:
            
               Psi2s.Fill(InvariantMass)
                
Psi2s.Draw()

Canvas.Draw()
In [ ]: