Sample Main Programs
Descriptions of available classes, methods and settings are all
very good and useful. Ultimately they are necessary for you to
be able to fine-tune your runs to the task at hand. To get going,
however, nothing helps like having explicit examples to study.
This is what is provided in the examples
subdirectory,
along with instructions how they should be run:
main01.cc
: a simple study of the charged multiplicity
for jet events at the LHC. (Brief example fitting on one slide.)
main02.cc
: a simple study of the pT spectrum
of Z bosons at the Tevatron. (Brief example fitting on one slide.)
main03.cc
: a simple single-particle analysis of jet
events, where input is set by main03.cmnd
"cards file".
main04.cc
: a simple study of several different kinds
of events, with the choice to be made in the main04.cmnd
"cards file".
main05.cc
: generation of QCD jet events at the LHC,
with jet analysis using the CellJet
cone-jet finder.
main06.cc
: tests of cross sections for elastic and
diffractive topologies, using main06.cmnd
to pick process.
main07.cc
: tests of cross sections for minimum-bias
events, using main07.cmnd
to pick options.
main08.cc
: generation of the QCD jet cross section
by splitting the run into subruns, each in its own pT bin,
and adding the results properly reweighted. Two options, with limits
set either in the main program or by subrun specification in the
main08.cmnd
file.
main09.cc
: generation of LEP1 hadronic events, i.e.
e^+e^- -> gamma*/Z^0 -> q qbar, with charged multiplicity,
sphericity, thrust and jet analysis.
main10.cc
: illustration how userHooks can be used
interact directly with the event-generation process.
main11.cc
: generation of two predetermined hard
interactions in each event.
main12.cc
: a study of top events, fed in from the
Les Houches Event File ttbar.lhe
, here generated by
PYTHIA 6.4. This file currently only contains 100 events
so as not to make the distributed PYTHIA package too big, and so serves
mainly as a demonstration of the principles involved.
main13.cc
: a more sophisticated variant of
main12.cc
, where two Les Houches Event Files
(ttbar.lhe
and ttbar2.lhe
) successively
are used as input. Also illustrating some other aspects, like the
capability to mix in internally generated events.
main14.cc
: a systematic comparison of several
cross section values with their corresponding values in PYTHIA 6.4,
the latter available as a table in the code.
main15.cc
: loop over several tries, either to redo
B decays only or to redo the complete hadronization chain of an event.
Since much of the generation process is only made once this is a way
to increase efficiency.
main16.cc
: put all user analysis code into a class
of its own, separate from the main program; provide the "cards file"
name as a command-line argument.
main17.cc
: collect the Pythia calls in a wrapper class,
thereby simplifying the main program; provide the "cards file" name
as a command-line argument.
main18.cc
: shows how to write an event filter class,
where you keep a vector of pointers to the subset of particles you
want to study further. The event record itself remains unchanged.
main19.cc
: use several instances of Pythia, one for
signal events and others for a variable number of pileup and "beam-gas"
events, combined into one common event record.
main20.cc
: shows how PYTHIA 8 can write a Les Houches
Event File, using facilities potentially useful also for other programs
to write an LHEF.
main21.cc
: an example how a single particle or various
parton-level configurations can be input directly for hadronization,
without being tied to the full process-generation machinery, e.g. to
study the hadronization of junction topologies.
main22.cc
: tests of internally implemented cross sections
for Supersymmetric particle production, with SYSY spectrum defined in
sps1a.spc
and settings in main22.cmnd
.
main23.cc
: shows how an external decay handler can
be linked to handle the decays of some particles.
main24.cc
: shows how an external random number
generator can be linked to replace the internal one.
main25.cc
: shows how an external process can be
implemented as a new class derived from a PYTHIA base class, and then
handed in for generation as with a normal internal process.
main26.cc
: shows how an external resonance can be
implemented as a new class derived from a PYTHIA base class, and be
used in an external process, both of which are then handed in for
generation as with a normal internal resonance and process.
main27.cc
: shows how an external beam momentum spread
and vertex location generator can be implemented as a new class derived
from a PYTHIA base class, and then handed in for internal use.
main28.cc
: test program for processes in scenarios
with large extra dimensions or unparticles.
main29.cc
: set up a fictitious production process
to a generic resonance, where you easily can compose your own list
of (two-body) decay modes to a variety of final states. Also traces
decay chains down to truly stable particles: gamma, e+-, p/pbar and
neutrinos. Suitable for astroparticle applications, like neutralino
pair annihilation, where cross sections are calculated separately
in another program.
main31.cc
: similar to main01, except that the
event record is output in the HepMC event record format. Requires
that HepMC is properly linked.
main32.cc
: a streamlined version for the generation
of events that are then stored in HepMC format, without any event
analysis. That is, all physics studies will have to be done afterwards.
The name of the input "cards file" (e.g. main32.cmnd
)
and output HepMC event file are to be provided as command-line arguments.
Requires that HepMC is properly linked.
main41.cc
: a test of the shape of parton densities,
as a check prior to using a given PDF set in a generator. Requires
that LHAPDF is properly linked.
main42.cc
: compares the charged multiplicity
distribution, and a few other minimum-bias physics aspects, between
default PYTHIA PDF and another one. Requires that LHAPDF is properly
linked.
main43.cc
: tests the possibility to do backwards
evolution from an incoming photon at the hard interaction. Requires
that you link to a LHAPDF set that includes the photon PDF.
main44.cc
: exemplifies how you create your own
PDF set and link it in for use in the process generation.
main51.cc
: exemplifies how you can link in runtime
generation of hard processes from PYTHIA 6, using the Les Houches
Accord facilities. This example is deprecated, since PYTHIA 8 by now
contains essentially all hard processes found in PYTHIA 6.
main61.cc
: an example how the FastJet jet finding
package can be linked to allow an analysis of the final state,
in this case for a study of W + jet production.