from ROOT import TTree, TFile, TCanvas, TH1F, TLorentzVector
%jsroot on
Welcome to JupyROOT 6.07/07
file = TFile("data/Dimuons.root","READ");
Let's calculate again the invariant mass $M$ of two muons and focus on various parts of the dimuon mass spectrum
Canvas = TCanvas()
For dimuon mass regions of interest 2.5-3.5 GeV and 80-100 GeV
other = TH1F("other", "#mu#mu mass;#mu#mu mass [GeV];Events", 100, 0.0, 2.0)
J_psi = TH1F("J_psi", "#mu#mu mass;#mu#mu mass [GeV];Events", 100, 2.5, 3.5)
upsi = TH1F("upsi", "#mu#mu mass;#mu#mu mass [GeV];Events", 100, 9.0, 11.0)
Z_boson = TH1F("Z_Boson","#mu#mu mass;#mu#mu mass [GeV];Events", 200, 80, 100)
Higgs = TH1F("Higgs", "#mu#mu mass;#mu#mu mass [GeV];Evemts", 50, 120, 130)
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:
other.Fill(InvariantMass)
if InvariantMass > 2.0 and InvariantMass < 3.5:
J_psi.Fill(InvariantMass)
if InvariantMass > 9.0 and InvariantMass < 11.0:
upsi.Fill(InvariantMass)
if InvariantMass > 60.0 and InvariantMass < 120.0:
Z_boson.Fill(InvariantMass)
if InvariantMass > 120.0 and InvariantMass < 130.0:
Higgs.Fill(InvariantMass)
J_psi.Draw()
Canvas.Draw()
Canvas.Clear()
Z_boson.Draw()
Canvas.Draw()
Canvas.Clear()
upsi.Draw()
Canvas.Draw()
Canvas.Clear()
other.Draw()
Canvas.Draw()
Canvas.Clear()
Higgs.Draw()
Canvas.Draw()