HEP MC and Data Analysis Tutorial 2017
Tutorial per il corso di Fisica Nucleare e Subnucleare, Dipartimento di Fisica, Universitą degli Studi di Trieste.
References
Delphes
To start
Preliminary steps:
- create a folder
HiggsTutorial
, which will be our "working directory"
- download the this version of MadGraph5:
MG5_aMC_v2.5.5
from this site: https://launchpad.net/mg5amcnlo/2.0/2.5.x/+download/MG5_aMC_v2.5.5.tar.gz
- move the downloaded file (
MG5_aMC_v2.5.5.tar.gz
) to our working directory and extract it (a new sub-directory MG5_aMC_v2_5_5
should have been created, which we will call "MG5 directory")
- copy the script
setup.sh
(attached here: setup.sh) inside the working directory
- from a terminal, from inside the working directory, execute the command
source setup.sh
: this will setup ROOT, gcc and python, and has to be done each time we open a new termnal (!)
- test MadGraph: from inside the MG5 directory, from the terminal execute:
./bin/mg5_aMC
; if it works you should be inside the MG5 shell
- try to generate a physics process: from inside the MG5 shell, give the command
generate p p > t t~
(this should prepare the generation of pp -> ttbar events)
- exit MG5 shell, with CTRL+D
MadGraph preparation:
- eventually modify the MG5 settings for the used browser and text editor: modify the text file
input/mg_configuration.txt
accordingly (suggested gedit or nano as text editor, firefox as browser)
- enter the MG5 shell: from the MG5 directory, from a terminal (after the setup!) type
./bin/mg5_aMC
- type
install pythia-pgs
to install Pythia6 (parton shower and hadronisation software)
- type
install Delphes
to install the latest version of Delphes (detector simulation and object reconstruction fast simulation software)
Generate Processes with MadGraph
Let's start with the MG5 tutorial:
- from the MG5 shell, type
tutorial
- follow the instructions on the screen
Then let's have one more exercise.
What's the cross-section (at LO) for the process pp -> ttbar, with a CME of 7 TeV and a top mass of 172.5 GeV?
- if you already have a ttbar directory, you can directly move to point 5
- from the MG5 shell, type
generate p p > t t~
- then create the output directory, still from the MG5 shell, typing
output ttbar
- exit MG5 (CTRL+D)
- enter the
ttbar
directory
- enter the
MadEvent
shell: ./bin/generate_events
- press enter
- now we are asked to modify the cards: we want to change both the CME and the top mass, so we have to modify both
run_card.dat
and param_card.dat
- to modify
run_card.dat
type 2, then ENTER
- find the lines with the energies of the two beams and set them to 3500 GeV each
- when finished, save the file and exit
- now you can modify
param_card.dat
typing 1, then ENTER
- find the line like
6 1.730000e+02 # MT
, and set 1.725000e+2 instead of 1.730000e+02
- when finished, save the file and exit
- then press ENTER and the computation will start
- wait few minutes you should get the result: you can read it from the screen or from the file
ttbar/crossx.html
Process MadGraph outputs: Pythia and Delphes
We already installed Pythia and Delphes. Now we can turn them on when generating events, in order to also simulate the parton shower and the hadronisation, as well as the detector simulation:
- if you already have a ttbar directory, you can directly move to point 5
- from the MG5 shell, generate the usual test process
generate p p > t t~
- create an output directory: output
output ttbar
- exit MG5 (CTRL+D)
- enter the ttbar directory:
cd ttbar
- enter
MadEvent
shell: ./bin/generate_events
- switch Pythia to ON
- switch Delphes to ON (NB: you might need to do it twice, until you see "Delphes" written there)
- type 0, ENTER, and then again 0, ENTER
- the events will be generated with Pythia and Delphes switched ON
- we can give a look at the text file called
tag_1_pythia.log
inside the directory ttbar/Events/run_01/
: this log contains, among other info, the full record of the fort 10 generated events (you can see the initial protons, the inital partons, the intermediate tops and their decay products, as well as all the products of the subsequent parton shower and hadronisation - quite a long list...)
- the delphes output file is also stored in the
ttbar/Events/run_01/
directory, with a .root extension
To read Delphes outputsē
- dowload the file
MyReader.C
from here: MyReader.C, and put it inside the directory Delphes/examples
(note: it's inside MG5 directory)
- open the file with a text editor
- uncomment the proper lines in order to create, fill and show a histogram, then save the file
- run the macro on the latest MG5 run output: from a terminal (again after the usual setup!), go to the directory
Delphes
and type root -l 'examples/MyReader.C("../ttbar/Events/run_XX/tag_1_delphes_events.root")'
Main exercise: Higgs to 4 leptons
Goal:
- select events coming from h->ZZ->4 lep and to produce a histogram with the reconstructed Higgs mass in these events
- compare "data" with MC simulation for Higgs signal and ZZ background
- everything should be done at CME = 8 TeV, considering the data integrated luminosity of 25
Where to get the data:
Generate the signal:
- as usual,
./bin/mg5_aMC
- IMPORTANT: before the
generate
command, type import model heft
-
generate p p > h > l+ l- l+ l-
-
output h4lep
- exit MG5, enter h4lep directory, enter MadEvent:
./bin/generate_events
- set Pythia ON, Delphes ON, the rest OFF
- when prompted, modify the run card:
- set the CME to 8 TeV (4000 GeV each beam)
- check that
False = cut_decays
(should be by default in latest MG5)
- (eventually change the Higgs mass in the param card)
- IMPORTANT: later we will multiply the signal x-sec given by MG5 by 10 (at LO both the x-sec and the BR are underestimated)
Generate the background (ZZ->4lep):
- as usual,
./bin/mg5_aMC
-
generate p p > l+ l- l+ l- /h
(the /h
excludes the Higgs as intermediate state)
-
output zz4lep
- exit MG5, enter zz4lep directory, enter MadEvent:
./bin/generate_events
- set Pythia ON, Delphes ON, the rest OFF
- when prompted, modify the run card:
- set the CME to 8 TeV (4000 GeV each beam)
- check that
False = cut_decays
(should be by default in latest MG5)
How to produce the final plot:
- look at the code
MyHiggs4l.C
: MyHiggs4l.C
- use it as a template for your macro to create a histogram out of each delphes output files (signal, background, data)
- the two inputs to the macro are the name of the root file with the delphes output and the output file where to store the histogram
- example:
-
root -l -b -q 'examples/MyHiggs4l.C("../h4lep/Events/run_01/tag_1_delphes_events.root","signal.root")'
-
root -l -b -q 'examples/MyHiggs4l.C("../zz4lep/Events/run_01/tag_1_delphes_events.root","background.root")'
-
root -l -b -q 'examples/MyHiggs4l.C("data_events.root","data.root")'
- then look at the code
MyHistMerger.C
: MyHistMerger.C
- use it as a template for your code to read the three inputs and merge them in a final plot
- note the signal x-sec multiplied by 10
--
MichelePinamonti - 2017-12-13