Fork me on GitHub

Changes between Version 4 and Version 5 of WorkBook/Tutorials/Prefit


Ignore:
Timestamp:
Mar 5, 2020, 5:26:25 PM (5 years ago)
Author:
Michele Selvaggi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WorkBook/Tutorials/Prefit

    v4 v5  
    1818cd Delphes-3.4.2
    1919curl -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/download
     20curl -o pp_ll_bsm.hepmc  https://cernbox.cern.ch/index.php/s/Y71ZOw8ZiWWE0p2/download
    2121}}}
    2222
     23
     24The 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.
    2325
    2426
     
    3840
    3941
    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 
     421) Open the ({{{pp_ll_sm.root}}} Delphes ROOT tree and explore the branches, plot the electrons transverse momentum.
     432) Draw the muon and electron multiplicity via the ROOT command line.Do you understand these distributions?
    56443) 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 
    6545
    6646
    6747== III) Write a simple analysis macro ==
    6848
    69 1) Write down the formula for the recoil Higgs mass.
    7049
    71 2) You can find a simple analysis macro in "example/Example1.py". It can be executed like this:
     501) Write a python analysis macro {{{examples/InvariantMass.py}}} that selects two electrons or muons and produces the histograms of the invariant mass.
     51To see an example check out {{{examples/Example1.py}}}.
    7252
    73 {{{
    74 python examples/Example1.py delphes_ee_zh_zmumu.root out.root
    75 }}}
     532) Run the analysis macro on the {{{pp_ll_sm.root}}} and {{{pp_ll_bsm.root}}} samples.
    7654
    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)
     553) 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
     574) 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?
    7858
    7959
    80 Solution:
    81 
    82 {{{
    83 # Recoil Mass macro
    84 #!/usr/bin/env python
    85 
    86 import sys
    87 import ROOT
    88 
    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   pass
    101 
    102 inputFile = sys.argv[1]
    103 outputFile = sys.argv[2]
    104 
    105 # Create chain of root trees
    106 chain = ROOT.TChain("Delphes")
    107 chain.Add(inputFile)
    108 
    109 # Create object of class ExRootTreeReader
    110 treeReader = ROOT.ExRootTreeReader(chain)
    111 numberOfEntries = treeReader.GetEntries()
    112 
    113 # Get pointers to branches used in this analysis
    114 branchMuon = treeReader.UseBranch("Muon")
    115 
    116 # Book histograms
    117 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 events
    121 for entry in range(0, numberOfEntries):
    122   # Load selected branches with data from specified event
    123   treeReader.ReadEntry(entry)
    124 
    125   # If event contains at least 2 muons
    126   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 - pll
    133 
    134     histMass.Fill(ph.M())
    135 
    136 out_root = ROOT.TFile(outputFile,"RECREATE")
    137 histMass.Write()
    138 }}}
    13960
    14061== IV) Modify the Delphes detector card ==