3
<title>Sample Main Programs</title>
4
<link rel="stylesheet" type="text/css" href="pythia.css"/>
5
<link rel="shortcut icon" href="pythia32.gif"/>
9
<script language=javascript type=text/javascript>
10
function stopRKey(evt) {
11
var evt = (evt) ? evt : ((event) ? event : null);
12
var node = (evt.target) ? evt.target :((evt.srcElement) ? evt.srcElement : null);
13
if ((evt.keyCode == 13) && (node.type=="text"))
17
document.onkeypress = stopRKey;
20
if($_POST['saved'] == 1) {
21
if($_POST['filepath'] != "files/") {
22
echo "<font color='red'>SETTINGS SAVED TO FILE</font><br/><br/>"; }
24
echo "<font color='red'>NO FILE SELECTED YET.. PLEASE DO SO </font><a href='SaveSettings.php'>HERE</a><br/><br/>"; }
28
<form method='post' action='SampleMainPrograms.php'>
30
<h2>Sample Main Programs</h2>
32
Descriptions of available classes, methods and settings are all
33
very good and useful. Ultimately they are necessary for you to
34
be able to fine-tune your runs to the task at hand. To get going,
35
however, nothing helps like having explicit examples to study.
36
This is what is provided in the <code>examples</code> subdirectory,
37
along with instructions how they should be run:
40
<li><code>main00.cc</code> : does not exist, but it has been defined
41
in the <code>Makefile</code>, so this name could be used for a simple
44
<li><code>main01.cc</code> : a simple study of the charged multiplicity
45
for jet events at the LHC. (Brief example fitting on one slide.)</li>
47
<li><code>main02.cc</code> : a simple study of the <i>pT</i> spectrum
48
of Z bosons at the Tevatron. (Brief example fitting on one slide.)</li>
50
<li><code>main03.cc</code> : a simple study of several different kinds
51
of events, with the choice to be made in the <code>main03.cmnd</code>
54
<li><code>main04.cc</code> : tests of cross sections, multiplicities and
55
average transverse momenta for elastic, diffractive and nondiffractive
56
topologies, using <code>main04.cmnd</code> to pick processes.</li>
58
<li><code>main05.cc</code> : generation of QCD jet events at the LHC,
59
with jet analysis using the <code>SlowJet</code> inclusive anti-<i>kT</i>
60
sequential-recombination finder and the <code>CellJet</code>
63
<li><code>main06.cc</code> : generation of LEP1 hadronic events, i.e.
64
<i>e^+e^- -> gamma*/Z^0 -> q qbar</i>, with charged multiplicity,
65
sphericity, thrust and jet analysis.</li>
67
<li><code>main07.cc</code> : set up a fictitious production process
68
to a generic resonance, where you easily can compose your own list
69
of (two-body) decay modes to a variety of final states. Also traces
70
decay chains down to truly stable particles: gamma, e+-, p/pbar and
71
neutrinos. Suitable for astroparticle applications, like neutralino
72
pair annihilation, where cross sections are calculated separately
75
<li><code>main08.cc</code> : generation of the QCD jet cross section
76
by splitting the run into subruns, each in its own <i>pT</i> bin,
77
and adding the results properly reweighted. Two options, with limits
78
set either in the main program or by subrun specification in the
79
<code>main08.cmnd</code> file.</li>
81
<li><code>main09.cc</code> : generation of two predetermined hard
82
interactions in each event.</li>
84
<li><code>main10.cc</code> : illustration how userHooks can be used
85
interact directly with the event-generation process.</li>
87
<li><code>main11.cc</code> : a study of top events, fed in from the
88
Les Houches Event File <code>ttbar.lhe</code>, here generated by
89
PYTHIA 6.4. This file currently only contains 100 events
90
so as not to make the distributed PYTHIA package too big, and so serves
91
mainly as a demonstration of the principles involved. </li>
93
<li><code>main12.cc</code> : a more sophisticated variant of
94
<code>main11.cc</code>, where two Les Houches Event Files
95
(<code>ttbar.lhe</code> and <code>ttbar2.lhe</code>) successively
96
are used as input. Also illustrating some other aspects, like the
97
capability to mix in internally generated events.</li>
99
<li><code>main13.cc</code> : a streamlined version of
100
<code>main12.cc</code>, where two Les Houches Event Files
101
(<code>ttbar.lhe</code> and <code>ttbar2.lhe</code>) successively
102
are used as input in <code>main13.cmnd</code> file.</li>
104
<li><code>main14.cc</code> : a systematic comparison of several
105
cross section values with their corresponding values in PYTHIA 6.4,
106
the latter available as a table in the code.</li>
108
<li><code>main15.cc</code> : loop over several tries, either to redo
109
B decays only or to redo the complete hadronization chain of an event.
110
Since much of the generation process is only made once this is a way
111
to increase efficiency.</li>
113
<li><code>main16.cc</code> : put all user analysis code into a class
114
of its own, separate from the main program; provide the "cards file"
115
name as a command-line argument.</li>
117
<li><code>main17.cc</code> : shows (a) how to use UserHooks to
118
regularize onium cross section for pT -> 0, and (b) how decays
119
could be handled externally.</li>
121
<li><code>main18.cc</code> : shows how to write an event filter class,
122
where you keep a vector of pointers to the subset of particles you
123
want to study further. The event record itself remains unchanged.</li>
125
<li><code>main19.cc</code> : use several instances of Pythia, one for
126
signal events and others for a variable number of pileup and "beam-gas"
127
events, combined into one common event record.</li>
129
<li><code>main20.cc</code> : shows how PYTHIA 8 can write a Les Houches
130
Event File, using facilities potentially useful also for other programs
131
to write an LHEF.</li>
133
<li><code>main21.cc</code> : an example how a single particle or various
134
parton-level configurations can be input directly for hadronization,
135
without being tied to the full process-generation machinery, e.g. to
136
study the hadronization of junction topologies. </li>
138
<li><code>main22.cc</code> : shows how an external resonance can be
139
implemented as a new class derived from a PYTHIA base class, and be
140
used in an external process, both of them handed in for generation
141
as with normal internal classes.</li>
143
<li><code>main23.cc</code> : shows how an external beam momentum spread
144
and vertex location generator can be implemented as a new class derived
145
from a PYTHIA base class, and then handed in for internal use.
146
Also how to use an external random-number generator and an external
147
parton distribution set.</li>
149
<li><code>main24.cc</code> : tests of internally implemented cross sections
150
for Supersymmetric particle production, with SYSY spectrum defined in
151
<code>cmssm.spc</code> and settings in <code>main24.cmnd</code>. For
152
illustration, an alternative example spectrum is also
153
available, <code>sps1aWithDecays.spc</code>, which contains a decay
154
table in SLHA format.</li>
156
<li><code>main25.cc</code> : input RPV-SUSY events from an LHEF file that
157
contains an SLHA spectrum inside its <code><header></code>. The
158
event file, <code>main25.lhe</code>, contains a sample events that
159
illustrate how to arrange color tags in the presence of the
160
color-space epsilon tensors that accompany baryon number violating
161
event topologies. </li>
163
<li><code>main26.cc</code> : test program for processes in scenarios
164
with large extra dimensions or unparticles. </li>
166
<li><code>main27.cc</code> : production of Kaluza-Klein <i>gamma/Z</i>
167
states in TeV-sized extra dimensions. </li>
169
<li><code>main28.cc</code> : production of long-lived R-hadrons, that
170
are forced to decay at a separate vertices and possibly with changed
173
<li><code>main31.cc</code> : exemplifies an improved matching of
174
parton showers to LHEF-style input based on the POWHEG approach.
175
The <code>main31.cmnd</code> allows to switch between several
176
different matching options. It also allows to select input process,
177
in this case either for the POWHEG-hvq program applied to top
178
pair production [<a href="Bibliography.php" target="page">Cor10</a>] or for QCD 2+3-jet events. The small
179
samples of input events are stored in the <code>powheg-hvq.lhe</code>
180
and <code>powheg-dijets.lhe</code> files, respectively.
183
<li><code>main41.cc</code> : similar to <code>main01</code>, except that
184
the event record is output in the HepMC event record format. Requires that
185
HepMC is properly linked. Note that the <code>hepmcout41.dat</code> output
186
file can become quite big; so no example is included in this
189
<li><code>main42.cc</code> : a streamlined version for the generation
190
of events that are then stored in HepMC format, without any event
191
analysis. That is, all physics studies will have to be done afterwards.
192
The name of the input "cards file" (e.g. <code>main42.cmnd</code>)
193
and output HepMC event file (e.g. <code>hepmcout42.dat</code>) are to
194
be provided as command-line arguments. Requires that HepMC is properly
195
linked. Note that the HepMC output file can become quite big; so no
196
example is included in this distribution.</li>
198
<li><code>main51.cc</code> : a test of the shape of parton densities,
199
as a check prior to using a given PDF set in a generator. Requires
200
that LHAPDF is properly linked.</li>
202
<li><code>main52.cc</code> : compares the charged multiplicity
203
distribution, and a few other minimum-bias physics aspects, between
204
default PYTHIA PDF and another one. Requires that LHAPDF is properly
207
<li><code>main53.cc</code> : tests the possibility to do backwards
208
evolution from an incoming photon at the hard interaction. Requires
209
that you link to a LHAPDF set that includes the photon PDF.</li>
211
<li><code>main61.cc</code> : a streamlined version for the generation
212
of events that are then stored in HepMC format, without any event
213
analysis. That is, just like <code>main42.cc</code>, with the difference
214
that <code>main61.cc</code> can be used in conjunction with LHAPDF.
215
The name of the input "cards file" (e.g. <code>main61.cmnd</code>)
216
and output HepMC event file (e.g. <code>hepmcout61.dat</code>) are to
217
be provided as command-line arguments. Requires that HepMC and LHAPDF
218
are properly linked. Note that the HepMC output file can become quite
219
big; so no example is included in this distribution.</li>
221
<li><code>main62.cc</code> : a further extension of <code>main61.cc</code>,
222
where subruns are used to process several consecutive LHEF,
223
as in <code>main13.cc</code>, with information stored e.g in
224
<code>main62.cmnd</code>. Other comments as for <code>main61.cc</code>.</li>
226
<li><code>main71.cc</code> : an example how the FastJet jet finding
227
package can be linked to allow an analysis of the final state,
228
in this case for a study of W + jet production.</li>
230
<li><code>main72.cc</code> : a comparison of SlowJet and FastJet
231
jet finding, showing that they find the same jets if run under
232
identical conditions, in this case for QCD jets.</li>
234
<li><code>main81.cc</code> : do CKKW-L merging with a merging scale
235
defined in <i>kT</i>. Input is provided by the <code>main81.cmnd</code>
236
file and the three data files <code>w+_production_lhc_0.lhe</code>,
237
<code>w+_production_lhc_1.lhe</code> and <code>w+_production_lhc_2.lhe</code>.
240
<li><code>main82.cc</code> : do CKKW-L merging with a user-defined
241
merging scale function. Input is provided by the <code>main82.cmnd</code>
242
file and the three data files <code>w+_production_lhc_0.lhe</code>,
243
<code>w+_production_lhc_1.lhe</code> and <code>w+_production_lhc_2.lhe</code>.
246
<li><code>main83.cc</code> : as <code>main82.cc</code> but with an
247
additional cut on the lowest multiplicity allowed for the reclustered
248
state. The same input as for <code>main82.cc</code> can be used.
251
<li><code>main84.cc</code> : do CKKW-L merging with output in such a way
252
that it can be used in subsequent RIVET analyses. Input is provided by
253
the <code>main84.cmnd</code> file and the three data files
254
<code>w+_production_lhc_0.lhe</code>, <code>w+_production_lhc_1.lhe</code>
255
and <code>w+_production_lhc_2.lhe</code>.
258
<li><code>main91.cc</code> : exemplifies how you can link in runtime
259
generation of hard processes from PYTHIA 6, using the Les Houches
260
Accord facilities. This example is deprecated, since PYTHIA 8 by now
261
contains essentially all hard processes found in PYTHIA 6.</li>
265
In addition two main program illustrating the use of ROOT are available
266
in the <code>rootexamples</code> subdirectory:
270
<li><code>hist.cc</code> : shows how ROOT can be used for histogramming
271
in a program that for the rest is structured like a normal PYTHIA run.
274
<li><code>hist.cc</code> : shows how PYTHIA events can be stored as
279
This subdirectory also contains a special Makefile and related
286
<!-- Copyright (C) 2012 Torbjorn Sjostrand -->