Fork me on GitHub

Changeset 816b1a9 in git for README.md


Ignore:
Timestamp:
Mar 8, 2018, 11:48:59 AM (7 years ago)
Author:
Christophe Delaere <christophe.delaere@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
44b0a31
Parents:
a2152c2
Message:

merge README and README.md and rework CONTRIBUTING.md

File:
1 edited

Legend:

Unmodified
Added
Removed
  • README.md

    ra2152c2 r816b1a9  
    55
    66More details can be found on the Delphes website http://cp3.irmp.ucl.ac.be/projects/delphes
     7
     8Quick start with Delphes
     9========================
     10
     11Commands to get the code:
     12
     13```
     14   wget http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.4.1.tar.gz
     15
     16   tar -zxf Delphes-3.4.1.tar.gz
     17```
     18
     19Commands to compile the code:
     20
     21```
     22   cd Delphes-3.4.1
     23
     24   make
     25```
     26
     27Finally, we can run Delphes:
     28
     29```
     30   ./DelphesHepMC
     31```
     32
     33Command line parameters:
     34
     35```
     36   ./DelphesHepMC config_file output_file [input_file(s)]
     37     config_file - configuration file in Tcl format
     38     output_file - output file in ROOT format,
     39     input_file(s) - input file(s) in HepMC format,
     40     with no input_file, or when input_file is -, read standard input.
     41```
     42
     43Let's simulate some Z->ee events:
     44
     45```
     46   wget http://cp3.irmp.ucl.ac.be/downloads/z_ee.hep.gz
     47   gunzip z_ee.hep.gz
     48   ./DelphesSTDHEP cards/delphes_card_CMS.tcl delphes_output.root z_ee.hep
     49```
     50
     51or
     52
     53```
     54   curl -s http://cp3.irmp.ucl.ac.be/downloads/z_ee.hep.gz | gunzip | ./DelphesSTDHEP cards/delphes_card_CMS.tcl delphes_output.root
     55```
     56
     57For more detailed documentation, please visit
     58
     59https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook
     60
     61Configure Delphes on lxplus.cern.ch
     62====================================
     63
     64```
     65git clone git://github.com/delphes/delphes.git Delphes
     66
     67cd Delphes
     68
     69source  /afs/cern.ch/sw/lcg/external/gcc/4.9.3/x86_64-slc6/setup.sh
     70
     71source /afs/cern.ch/sw/lcg/app/releases/ROOT/6.06.00/x86_64-slc6-gcc49-opt/root/bin/thisroot.sh
     72
     73make
     74```
     75
     76
     77Simple analysis using TTree::Draw
     78=================================
     79
     80Now we can start ROOT and look at the data stored in the output ROOT file.
     81
     82Start ROOT and load Delphes shared library:
     83
     84```
     85   root -l
     86   gSystem->Load("libDelphes");
     87```
     88
     89Open ROOT file and do some basic analysis using Draw or TBrowser:
     90
     91```
     92   TFile::Open("delphes_output.root");
     93   Delphes->Draw("Electron.PT");
     94   TBrowser browser;
     95```
     96
     97Note 1: Delphes - tree name, it can be learned e.g. from TBrowser
     98
     99Note 2: Electron - branch name; PT - variable (leaf) of this branch
     100
     101Complete description of all branches can be found in
     102
     103   doc/RootTreeDescription.html
     104
     105This information is also available at
     106
     107   https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook/RootTreeDescription
     108
     109Macro-based analysis
     110====================
     111
     112Analysis macro consists of histogram booking, event loop (histogram filling),
     113histogram display.
     114
     115Start ROOT and load Delphes shared library:
     116
     117```
     118   root -l
     119   gSystem->Load("libDelphes");
     120```
     121
     122Basic analysis macro:
     123
     124```
     125{
     126  // Create chain of root trees
     127  TChain chain("Delphes");
     128  chain.Add("delphes_output.root");
     129 
     130  // Create object of class ExRootTreeReader
     131  ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
     132  Long64_t numberOfEntries = treeReader->GetEntries();
     133 
     134  // Get pointers to branches used in this analysis
     135  TClonesArray *branchElectron = treeReader->UseBranch("Electron");
     136
     137  // Book histograms
     138  TH1 *histElectronPT = new TH1F("electron pt", "electron P_{T}", 50, 0.0, 100.0);
     139
     140  // Loop over all events
     141  for(Int_t entry = 0; entry < numberOfEntries; ++entry)
     142  {
     143
     144    // Load selected branches with data from specified event
     145    treeReader->ReadEntry(entry);
     146 
     147    // If event contains at least 1 electron
     148    if(branchElectron->GetEntries() > 0)
     149    {
     150      // Take first electron
     151      Electron *electron = (Electron*) branchElectron->At(0);
     152     
     153      // Plot electron transverse momentum
     154      histElectronPT->Fill(electron->PT);
     155     
     156      // Print electron transverse momentum
     157      cout << electron->PT << endl;
     158    }
     159
     160  }
     161
     162  // Show resulting histograms
     163  histElectronPT->Draw();
     164}
     165```
     166
     167
     168More advanced macro-based analysis
     169==================================
     170
     171The 'examples' directory contains ROOT macros Example1.C, Example2.C and Example3.C.
     172
     173Here are the commands to run these ROOT macros:
     174
     175```
     176   root -l
     177   .X examples/Example1.C("delphes_output.root");
     178```
     179
     180or
     181
     182```
     183   root -l examples/Example1.C'("delphes_output.root")'
     184```
Note: See TracChangeset for help on using the changeset viewer.