Fork me on GitHub

source: git/README@ d4b718a

ImprovedOutputFile Timing dual_readout llp
Last change on this file since d4b718a was d4b718a, checked in by ksuruliz <kerim.suruliz@…>, 6 years ago

Test

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