Fork me on GitHub

Version 2 (modified by mselvaggi, 3 months ago) (diff)


Delphes Tutorial - DESY March 2020


To successfully run this tutorial the Delphes virtual machine should be installed, see here for more information:

If you have successfully produced Pythia8 event files in the MadGraph? and Parton Shower lecture (Admir Greljo, Ilaria Brivio), copy (or move) the pp->ll (SM and BSM) into the Delphes directory Delphes-3.4.2

FIXME: find out how these files where named during tutorial

If not you can download the files from here (but it might take a while):

cd Delphes-3.4.2
curl -o pp_ll_sm.hepmc
curl -o pp_ll_bsm.hepmc

I) Produce Delphes root files

In this section you will run Delphes Fast Detector simulation using the default CMS card. Delphes will produce a ROOT file starting from the hepmc format produced by MG5+Pythia8.

./DelphesHepMC cards/delphes_card_CMS.tcl pp_ll_sm.root pp_ll_sm.hepmc ./DelphesHepMC cards/delphes_card_CMS.tcl pp_ll_bsm.root pp_ll_bsm.hepmc

II) Simple Interactive Tree analysis

1) Open Delphes ROOT tree and explore the branches

root -l pp_ll_sm.root
TBrowser t;

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?


3) Compare the leading muon transverse momentum and pseudo-rapidity in the SM and the BSM sample.


III) Write a simple analysis macro

1) Write down the formula for the recoil Higgs mass.

2) You can find a simple analysis macro in "example/". It can be executed like this:

python examples/ delphes_ee_zh_zmumu.root out.root

This 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 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)


# Recoil Mass macro
#!/usr/bin/env python

import sys
import ROOT

if len(sys.argv) < 2:
  print " Usage: python examples/ delphes_ee_zh_zmumu.root hist_mrec.root"


  ROOT.gInterpreter.Declare('#include "classes/SortableObject.h"')
  ROOT.gInterpreter.Declare('#include "classes/DelphesClasses.h"')
  ROOT.gInterpreter.Declare('#include "external/ExRootAnalysis/ExRootTreeReader.h"')

inputFile = sys.argv[1]
outputFile = sys.argv[2]

# Create chain of root trees
chain = ROOT.TChain("Delphes")

# Create object of class ExRootTreeReader
treeReader = ROOT.ExRootTreeReader(chain)
numberOfEntries = treeReader.GetEntries()

# Get pointers to branches used in this analysis
branchMuon = treeReader.UseBranch("Muon")

# Book histograms
histMass = ROOT.TH1F("mass", "M_{recoil} [GeV]", 60, 100.0, 160.0)

ptot = ROOT.TLorentzVector(0.,0.,0.,240.)
# Loop over all events
for entry in range(0, numberOfEntries):
  # Load selected branches with data from specified event

  # If event contains at least 2 muons
  if branchMuon.GetEntries() > 1:

    mu1 = branchMuon.At(0)
    mu2 = branchMuon.At(1)

    pll = mu1.P4() + mu2.P4()
    ph = ptot - pll


out_root = ROOT.TFile(outputFile,"RECREATE")

IV) Modify the Delphes detector card

You have now produced a Delphes simulated event with the hypothetical CEPC default detector configuration.

1) Can you think of 2 detector parameters that determine and drive the sensitivity of the Higgs recoil measurement in this particular final state?

2) Identify where they are configured in the delphes detector card.

3) Create two new detector configurations by degrading these two parameters by a sizable factor.

4) Reproduce a Delphes sample with these new configurations and observe the impact on the recoil mass distribution.

Attachments (2)

Download all attachments as: .zip