Fork me on GitHub

source: git/README.md@ 3ad158a

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 3ad158a was 7b720ac, checked in by Pavel Demin <pavel-demin@…>, 7 years ago

add CircleCI status to README.md

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