Fork me on GitHub

Changes between Version 2 and Version 3 of WorkBook/TutorialBologna


Ignore:
Timestamp:
Jun 8, 2016, 1:56:43 PM (8 years ago)
Author:
Michele Selvaggi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WorkBook/TutorialBologna

    v2 v3  
    1818Once it is installed, type:
    1919
    20 {{{source [path_to_installation]/root/bin/thisroot.sh}}}
     20{{{
     21source [path_to_installation]/root/bin/thisroot.sh
     22}}}
    2123
    2224Then simply type in a terminal:
    2325
    24 {{{echo $ROOTSYS}}}
     26{{{
     27echo $ROOTSYS
     28}}}
    2529
    2630If a path is shown then root is properly installed.
    2731
    2832 
     33== MadGraph5/MadEvent basic tutorial (@Leading Order) ==
     34
     35In this part you are going to learn how to generate pardon-level and showered events with MadGraph5 (interfaced with Pythia6).
     36
     370) Create a new directory:
     38
     39{{{
     40mkdir DelphesTutorial
     41cd DelphesTutorial
     42}}}
     43
     441) Download and install MG5 by typing in a terminal:
     45{{{
     46wget https://launchpad.net/mg5amcnlo/2.0/2.4.0/+download/MG5_aMC_v2.4.0.tar.gz
     47tar xzvf MG5_aMC_v2.4.0.tar.gz
     48}}}
     492) Launch MG5:
     50{{{
     51cd MG5_aMC_v2_4_0
     52./bin/mg5_aMC
     53}}}
     543) Install Pythia6 and !MadAnalysis:
     55{{{
     56install pythia-pgs
     57install MadAnalysis
     58}}}
     594) Generate a LO Drell-Yan process:
     60{{{
     61generate p p > e+ e-
     62display diagrams
     63}}}
     645) Generate a LO Higgs process:
     65{{{
     66generate p p > h > e+ e- mu+ mu-
     67}}}
     68The diagram generation fails ... do you understand why? Type instead:
     69{{{
     70import model heft
     71generate p p > h > e+ e- mu+ mu-
     72display diagrams
     73}}}
     74This generates also diagrams containing photon internal lines. To veto that diagram type the following:
     75{{{
     76generate p p > h > e+ e- mu+ mu-  / a
     77display diagrams
     78}}}
     796) Let's generate some events
     80{{{
     81output pp_h_eemm
     82launch pp_h_eemm
     83}}}
     84
     85You will be prompted with a screen asking questions ... Type "ENTER". Another screen comes and asks you if you want to edit a bunch of configuration cards:
     86
     87 - "param_card.dat" is where the parameters of the model are stored (masses, couplings)
     88 - "run_card.dat" is where the parameters of run are defined (ecm, number of events,
     89    generation level cuts ..)
     90 - "pythia_card.dat" is where parameters of the shower are defined
     91
     92Open "param_card.dat" and "run_card.dat" by typing respectively "1" and "2"and have a look at them, but do not modify them for now. The editor is "vi", so to quit type ":q". Type ENTER to launch the parton-level generation.
     93
     947) When it's done, you should be prompted with a web browser. If not quit MG5 by typing "exit", and open the html file that was created and the end of the run with your web browser:
     95{{{
     96firefox [MG5DIR]/pp_h_eemm/Events/index.html
     97}}}
     98Click on "Results and Event Database" and then on "LHE plots". Have a look at the automatically generated parton-level plots. Explain the Ecm plot (this is the total invariant mass of the system, i.e of the four final state leptons).
     998) Enter in MG5 again, and type:
     100{{{
     101./bin/mg5_aMC
     102import model heft
     103}}}
     104{{{
     105generate p p > h , h > e+ e- mu+ mu- / a
     106display diagrams
     107}}}
     108Then:
     109{{{
     110output pp_h_eemm_res
     111launch pp_h_eemm_res
     112}}}
     113Note the different syntax.
     114This time, when you will be prompted with the screen asking questions ... Type "1". This will activate parton and hadronization with Pythia6, and then type ENTER.
     115When the generation is done, have a look again at the parton-level plots.
     116
     1177) Generate a new set of events, this time setting in the param_card mH = 750 GeV. !! Note that since we are keeping the higgs width value corresponding to mH = 125 GeV, this won't be a proper SM higgs with mH = 750 GeV !!
     118
     119For this we don't need to re-generate the diagrams, we can simply type "launch" and edit the param_card by changing the higgs mass when prompted. If everything worked smoothly you should have two event samples with 10k events each. Events are stored in [MG5DIR]/pp_h_eemm_res/Events/run_01(02)
     120
     121Now to quit MG5, type "exit". In each run sub-directory, only two files are interesting for us:
     122
     123- "unweighted_events.lhe" contains hard-interaction events only, pre-hadronization and PS,
     124it is human readable, in so-called Les-Houches Event format (in short LHE)
     125- "tag_1_pythia_events.hep" contains showered and hadronized events, it is the event file
     126that we are going to give as input to the Delphes simulation.
     127
     128This ends the very basic introduction to MG5. For an extensive list of tutorials, lectures about this tool (including matching, NLO generation, etc..) , have a look at the !MadGraph School 2015 page:
     129
     130http://www.physics.sjtu.edu.cn/madgraphschool/
     131
     132== Delphes Tutorial ==
     133
     134=== Part I - Getting Started ===
     135
     1360) Go back to the !DelphesTutorial directory
     137
     1381) Get Delphes:
     139{{{
     140git clone https://github.com/delphes/delphes.git
     141cd delphes
     142}}}
     143or, if you don't have "git" installed, simply type:
     144{{{
     145wget http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.3.2.tar.gz
     146tar -zxf Delphes-3.3.2.tar.gz
     147mv Delphes-3.3.2 delphes
     148cd delphes
     149}}}
     1502) Install it:
     151{{{
     152./configure
     153make -j 4
     154}}}
     1553) Unzip the event files previously generated with MG5, and move them in your delphes directory
     156{{{
     157gunzip ../MG5_aMC_v2_4_0/pp_h_eemm_res/Events/run_01/tag_1_pythia_events.hep.gz
     158gunzip ../MG5_aMC_v2_4_0/pp_h_eemm_res/Events/run_02/tag_1_pythia_events.hep.gz
     159}}}
     160{{{
     161mkdir -p input
     162mv ../MG5_aMC_v2_4_0/pp_h_eemm_res/Events/run_01/tag_1_pythia_events.hep input/pp_h_eemm_m125.hep
     163mv ../MG5_aMC_v2_4_0/pp_h_eemm_res/Events/run_02/tag_1_pythia_events.hep input/pp_h_eemm_m750.hep
     164}}}
     165
     1664) Finally, let's run Delphes. If the compilation went right, you should have three executables:
     167
     168- DelphesLHEF  -> should not be used
     169- DelphesHepMC -> to be used on HepMC input format (*.hepmc)
     170- DelphesSTDHEP -> to be used on STDHEP input format (*.hep)
     171
     172Type for instructions (note that output file comes before input file):
     173{{{
     174./DelphesSTDHEP
     175}}}
     176To run on our your input file, type:
     177{{{
     178./DelphesSTDHEP cards/delphes_card_CMS.tcl delphes_output_m125.root input/pp_h_eemm_m125.hep
     179}}}
     1805) Open freshly produced Delphes output with ROOT, and explore it.
     181{{{
     182root -l delphes_output_m125.root
     183TBrowser t;
     184}}}
     185In the browser, double click on the "delphes_output_m125.root", and then on the "Delphes" tree. Play around by double clicking on the various branches/observables.
     186
     187You can then play plot important observable with a simple selection with the following syntax:
     188{{{
     189Delphes->Draw("Muon.PT", "Muon.PT > 20");
     190Delphes->Draw("Electron.PT", "Electron.PT > 20");
     191}}}
     192- Note 1: Delphes - tree name, it can be learnt e.g. from TBrowser
     193- Note 2: Muon/Electron - branch name; PT - variable (leaf) of this branch
     194{{{
     195Delphes->Draw("Muon.Eta", "Muon.PT > 20");
     196Delphes->Draw("Electron.Eta", "Electron.PT > 20");
     197Delphes->Draw("Jet_size","Electron_size > 1 && Muon_size > 1");
     198}}}
     199Objects are already ordered in PT, you can then plot leading ele/mu in this way:
     200{{{
     201Delphes->Draw("Muon[0].PT", "Muon.PT > 20");
     202Delphes->Draw("Electron[0].PT", "Electron.PT > 20");
     203}}}
     204For more information on ROOT trees:
     205
     206http://cp3.irmp.ucl.ac.be/downloads/RootTreeDescription.html
     207
     208=== Part II - Run a macro-based analysis on Delphes output ===
     209
     2101) The macro examples/Example3.C produces resolution plots comparing reconstructed vs MC truth quantities. Run it on the delphes output:
     211
     212root -b -q examples/Example3.C'("delphes_output_m125.root")'
     213
     214It produces a bunch of plots in "png" format. Open them with your favourite image viewer:
     215
     216{{{
     217open *.png
     218}}}
     219or
     220{{{
     221eog *.png
     222}}}
     223
     224Understand:
     225
     226 - Why is the eta resolution plot for electron and muons different compared to photons?
     227 - Where do photons come from?
     228 - Why is the jet resolution plot shifted?
     229
     230
     2312) Let's now run a real event selection, and plot some interesting quantities. We select events with:
     232
     233-   >= 2 opposite sign isolated electrons , pT > 10 GeV, |eta| < 2.5
     234-   >= 2 opposite sign isolated muons , pT > 10 GeV, |eta| < 2.5
     235
     236Construct 3 invariant masses and fill them in histograms:
     237
     238- min( m(e+ e-), m(mu+ mu-) )
     239- max( m(e+ e-), m(mu+ mu-) )
     240- m (e+ e- mu+ mu-)
     241
     242Open the "HZZ.C" macro with your favorite text editor, and make sure you understand what it
     243does. Then run it:
     244{{{
     245root -b -q  examples/HZZ.C'("delphes_output_m125.root")';
     246}}}
     247Some plots are produced. Open the produced png file.
     248
     249- Explain the left plot.
     250- Appreciate the effect of detector resolution by comparing the gen and reco histograms
     251
     252Now redo this analysis, but this time using the mH = 750 GeV input file. Do not edit directly the HZZ.C file, make a copy of it and edit the copy rather.
     253
     254- Spot and explain the differences with the mH = 125 GeV case.
     255