A framework for fast simulation of a generic collider experiment
pavel-demin Merge pull request #63 from basilschneider/muon-efficiency
Fix the efficiency for tight muons at high eta
Latest commit 0882413 Oct 11, 2018
Failed to load latest commit information.
.circleci replace ubuntu-1710 with ubuntu-1404 Jun 22, 2018
cards Fix the efficiency for tight muons at high eta Aug 31, 2018
classes fix DelphesLHEFReader.cc compilation under Ubuntu 14.04 Aug 24, 2018
cmake move cmake/Modules/FindPythia8.cmake to cmake/FindPythia8.cmake May 18, 2018
converters open pileup and STDHEP files in binary mode Jun 14, 2018
display Merge pull request #39 from jlingema/master Mar 7, 2017
doc fix formatting in genMakefile.tcl and Makefile Aug 10, 2018
examples adapt Example1.py to Python 3 Nov 17, 2017
external update FastJet library to 3.3.1 and FastJet Contrib library to 1.036 Jun 6, 2018
modules improve formatting in DenseTrackFilter.cc Jun 6, 2018
python Fixing pythonisation of classes for recent ROOT versions Sep 18, 2018
readers Corrected ProIO reader to make it consistent ProIO. Aug 30, 2018
validation run all validation in parallel Nov 21, 2017
.clang-format add AllowShortCaseLabelsOnASingleLine to .clang-format Sep 2, 2018
.gitignore update gitignore Jun 6, 2018
AUTHORS first version of the new licensing clarifications Mar 8, 2018
CHANGELOG added CHANGELOG for 3.4.1 Apr 4, 2017
CMakeLists.txt add PYTHIA8_LIBRARIES to DelphesDisplay in CMakeLists.txt Jun 2, 2018
CONTRIBUTING.md merge README and README.md and rework CONTRIBUTING.md Mar 8, 2018
COPYING replace GPLv2 with GPLv3 May 6, 2013
DelphesEnv.sh missing env file for DelphesAnalysis Aug 6, 2014
LICENSE Update pythia and copyrights Mar 22, 2018
Makefile fix formatting in genMakefile.tcl and Makefile Aug 10, 2018
MinBias.pileup implemented FastJetGridMedianEstimator module, added 1k events MinBia… Nov 26, 2014
NOTICE first version of the new licensing clarifications Mar 8, 2018
README remove unneeded empty lines from README Oct 11, 2018
README.md add CircleCI status to README.md Apr 20, 2018
README_4LHCb added instruction for running on lxplus Jan 7, 2016
VERSION set version to 3.4.1 Apr 4, 2017
configure move branches/ModularDelphes to trunk Apr 15, 2013




Delphes is a C++ framework, performing a fast multipurpose detector response simulation.

More details can be found on the Delphes website http://cp3.irmp.ucl.ac.be/projects/delphes

Quick start with Delphes

Commands to get the code:

   wget http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.4.1.tar.gz

   tar -zxf Delphes-3.4.1.tar.gz

Commands to compile the code:

   cd Delphes-3.4.1


Finally, we can run Delphes:


Command line parameters:

   ./DelphesHepMC config_file output_file [input_file(s)]
     config_file - configuration file in Tcl format
     output_file - output file in ROOT format,
     input_file(s) - input file(s) in HepMC format,
     with no input_file, or when input_file is -, read standard input.

Let's simulate some Z->ee events:

   wget http://cp3.irmp.ucl.ac.be/downloads/z_ee.hep.gz
   gunzip z_ee.hep.gz
   ./DelphesSTDHEP cards/delphes_card_CMS.tcl delphes_output.root z_ee.hep


   curl -s http://cp3.irmp.ucl.ac.be/downloads/z_ee.hep.gz | gunzip | ./DelphesSTDHEP cards/delphes_card_CMS.tcl delphes_output.root

For more detailed documentation, please visit https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook

Configure Delphes on lxplus.cern.ch

git clone git://github.com/delphes/delphes.git Delphes

cd Delphes

source  /afs/cern.ch/sw/lcg/external/gcc/4.9.3/x86_64-slc6/setup.sh

source /afs/cern.ch/sw/lcg/app/releases/ROOT/6.06.00/x86_64-slc6-gcc49-opt/root/bin/thisroot.sh


Simple analysis using TTree::Draw

Now we can start ROOT and look at the data stored in the output ROOT file.

Start ROOT and load Delphes shared library:

   root -l

Open ROOT file and do some basic analysis using Draw or TBrowser:

   TBrowser browser;


  • Delphes is the tree name. It can be learned e.g. from TBrowser.
  • Electronis the branch name; PT is a variable (leaf) of this branch.

Complete description of all branches can be found in doc/RootTreeDescription.html. This information is also available in the workbook.

Macro-based analysis

Analysis macro consists of histogram booking, event loop (histogram filling), histogram display.

Start ROOT and load Delphes shared library:

   root -l

Basic analysis macro:

  // Create chain of root trees
  TChain chain("Delphes");
  // Create object of class ExRootTreeReader
  ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
  Long64_t numberOfEntries = treeReader->GetEntries();
  // Get pointers to branches used in this analysis
  TClonesArray *branchElectron = treeReader->UseBranch("Electron");

  // Book histograms
  TH1 *histElectronPT = new TH1F("electron pt", "electron P_{T}", 50, 0.0, 100.0);

  // Loop over all events
  for(Int_t entry = 0; entry < numberOfEntries; ++entry)

    // Load selected branches with data from specified event
    // If event contains at least 1 electron
    if(branchElectron->GetEntries() > 0)
      // Take first electron
      Electron *electron = (Electron*) branchElectron->At(0);
      // Plot electron transverse momentum
      // Print electron transverse momentum
      cout << electron->PT << endl;


  // Show resulting histograms

More advanced macro-based analysis

The 'examples' directory contains ROOT macros Example1.C, Example2.C and Example3.C.

Here are the commands to run these ROOT macros:

   root -l
   .X examples/Example1.C("delphes_output.root");


   root -l examples/Example1.C'("delphes_output.root")'