Changes between Version 4 and Version 5 of WorkBook/Tutorials/Prefit
- Timestamp:
- Mar 5, 2020, 5:26:25 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WorkBook/Tutorials/Prefit
v4 v5 18 18 cd Delphes-3.4.2 19 19 curl -o pp_ll_sm.hepmc https://cernbox.cern.ch/index.php/s/4rnlQ0bybBYvLTS/download 20 curl -o pp_ll_bsm.hepmc https://cernbox.cern.ch/index.php/s/ DfDDS5QixZaBsYO/download20 curl -o pp_ll_bsm.hepmc https://cernbox.cern.ch/index.php/s/Y71ZOw8ZiWWE0p2/download 21 21 }}} 22 22 23 24 The solution for these (simple) exercises can be found in the attached file tutorial_solution.txt, located at the bottom of this page. Consult it if you are stuck but before try to solve the question by yourself. 23 25 24 26 … … 38 40 39 41 40 1) Open Delphes ROOT tree and explore the branches 41 42 {{{ 43 root -l pp_ll_sm.root 44 gSystem->Load("libDelphes"); 45 TBrowser t; 46 }}} 47 48 49 2) Interactively draw the muon and electron multiplicity. You first have to double-click on the root file icon in the TBrowser. Do you understand these distributions? 50 51 {{{ 52 Delphes->Draw("Muon_size"); 53 Delphes->Draw("Electron_size"); 54 }}} 55 42 1) Open the ({{{pp_ll_sm.root}}} Delphes ROOT tree and explore the branches, plot the electrons transverse momentum. 43 2) Draw the muon and electron multiplicity via the ROOT command line.Do you understand these distributions? 56 44 3) Compare the leading muon transverse momentum and pseudo-rapidity in the SM and the BSM sample. 57 58 59 60 {{{61 Delphes->Draw("Muon_size");62 Delphes->Draw("Electron_size");63 }}}64 65 45 66 46 67 47 == III) Write a simple analysis macro == 68 48 69 1) Write down the formula for the recoil Higgs mass.70 49 71 2) You can find a simple analysis macro in "example/Example1.py". It can be executed like this: 50 1) Write a python analysis macro {{{examples/InvariantMass.py}}} that selects two electrons or muons and produces the histograms of the invariant mass. 51 To see an example check out {{{examples/Example1.py}}}. 72 52 73 {{{ 74 python examples/Example1.py delphes_ee_zh_zmumu.root out.root 75 }}} 53 2) Run the analysis macro on the {{{pp_ll_sm.root}}} and {{{pp_ll_bsm.root}}} samples. 76 54 77 This Example1.py macro does not produce anything interesting here (it most likely produce an empty plot). The above command is simply shown as an example for how to run a macro. You should open Example1.py with a text editor, and write a small analysis that first selects events with two muons and then reconstructs and plot the recoil Higgs mass using the formula found in III.1) 55 3) Plot the di-electron and di-muon invariant on the same plot for both the SM sample. Which final state provides the best resolution? Why? 56 57 4) Plot the di-electron and di-muon invariant on the same plot for both the BSM sample. Which final state provides the best resolution? Why? 78 58 79 59 80 Solution:81 82 {{{83 # Recoil Mass macro84 #!/usr/bin/env python85 86 import sys87 import ROOT88 89 if len(sys.argv) < 2:90 print " Usage: python examples/MissingMass.py delphes_ee_zh_zmumu.root hist_mrec.root"91 sys.exit(1)92 93 ROOT.gSystem.Load("libDelphes")94 95 try:96 ROOT.gInterpreter.Declare('#include "classes/SortableObject.h"')97 ROOT.gInterpreter.Declare('#include "classes/DelphesClasses.h"')98 ROOT.gInterpreter.Declare('#include "external/ExRootAnalysis/ExRootTreeReader.h"')99 except:100 pass101 102 inputFile = sys.argv[1]103 outputFile = sys.argv[2]104 105 # Create chain of root trees106 chain = ROOT.TChain("Delphes")107 chain.Add(inputFile)108 109 # Create object of class ExRootTreeReader110 treeReader = ROOT.ExRootTreeReader(chain)111 numberOfEntries = treeReader.GetEntries()112 113 # Get pointers to branches used in this analysis114 branchMuon = treeReader.UseBranch("Muon")115 116 # Book histograms117 histMass = ROOT.TH1F("mass", "M_{recoil} [GeV]", 60, 100.0, 160.0)118 119 ptot = ROOT.TLorentzVector(0.,0.,0.,240.)120 # Loop over all events121 for entry in range(0, numberOfEntries):122 # Load selected branches with data from specified event123 treeReader.ReadEntry(entry)124 125 # If event contains at least 2 muons126 if branchMuon.GetEntries() > 1:127 128 mu1 = branchMuon.At(0)129 mu2 = branchMuon.At(1)130 131 pll = mu1.P4() + mu2.P4()132 ph = ptot - pll133 134 histMass.Fill(ph.M())135 136 out_root = ROOT.TFile(outputFile,"RECREATE")137 histMass.Write()138 }}}139 60 140 61 == IV) Modify the Delphes detector card ==