Explore examples by keyword

The Pythia examples directory contains about 100 examples, each showcasing one or several features of the framework.

The examples are ordered by keyword below, and cross referenced, allowing for exploration of the various features.

A new user may want to start with examples presenting the Basic Usage before going on to explore more advanced topics.

Write what you are looking for in the search box, and press Go!

Click below to get a list of all keywords:

  1. B decays
  2. BSM
  3. CKKW-L
  4. DIS
  5. EvtGen
  6. LHAPDF
  7. LHE file
  8. NL3
  9. NLO
  10. R-hadron
  11. UMEPS
  12. UNLOPS
  13. UPC
  14. aMC@NLO
  15. analysis
  16. angantyr
  17. anti-kT
  18. astroparticle
  19. basic usage
  20. beam gas
  21. beam momentum
  22. biasing
  23. celljet
  24. centrality
  25. charged multiplicity
  26. colour reconnection
  27. command file
  28. command line option
  29. cross sections
  30. dark matter
  31. diffraction
  32. displaced vertex
  33. electron-positron
  34. event filter
  35. event record
  36. event shapes
  37. external decays
  38. external derived class
  39. external resonance
  40. extra dimensions
  41. fastjet
  42. fixed target
  43. fxfx
  44. hadronization
  45. hard diffraction
  46. heavy ion
  47. heavy ions
  48. helaconia
  49. hepmc
  50. jet finding
  51. jets
  52. kT
  53. leading order
  54. madgraph
  55. matching
  56. matplotlib
  57. merging
  58. minimum bias
  59. mlm
  60. multi-instance
  61. onia
  62. pT bias
  63. parton distribution
  64. photon beam
  65. photon-photon
  66. photoproduction
  67. pileup
  68. powheg
  69. pp
  70. process cross sections
  71. process selection
  72. process veto
  73. promc
  74. proton-ion
  75. pythia 6
  76. python
  77. random number generator
  78. resonance decay
  79. rivet
  80. root
  81. rope hadronization
  82. second interaction
  83. slowjet
  84. string shoving
  85. supersymmetry
  86. tevatron
  87. top mass
  88. tuning
  89. two-body decay
  90. uncertainty bands
  91. userhooks
  92. vertex spread
  93. z production

B decays

main48.cc : demonstrates how to use the EvtGenDecays class provided by include/Pythia8Plugins/EvtGen.h to perform decays with the EvtGen package. The header contains special instructions how to configure PYTHIA for use with EvtGen.
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.

BSM

main75.cc : setup (in main75.cmnd) for Dark Matter production via an s-channel mediator, where a mono-jet pT spectrum is found with the FastJet package.
main27.cc : production of Kaluza-Klein gamma/Z states in TeV-sized extra dimensions.
main76.cc : simple setup for Dark Matter production in several different scenarios, as specified in main76.cmnd, notably with long-lived particle signatures.
main26.cc : test program for processes in scenarios with large extra dimensions or unparticles.
main28.cc : production of long-lived R-hadrons, that are forced to decay at a separate vertices and possibly with changed momenta.
main24.cc : tests of internally implemented cross sections for Supersymmetric particle production, with SUSY spectrum defined in slha2-example.spc and settings in main24.cmnd. For illustration, an alternative example spectrum is also available, sps1aWithDecays.spc, which contains a decay table in SLHA format.

CKKW-L

main84.cc : do CKKW-L merging with output in such a way that it can be used in subsequent RIVET analyses. Input is provided by the main84.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main85.cc : do CKKW-L merging, with HepMC event output. Input settings are provided by the main85.cmnd file. This example program allows the use of input Les Houches events that are regularised with only very minimal cuts, and on which Pythia itself should enforce the more restrictive merging scale cut. The example program can be used with the input files w_production_tree_0.lhe, w_production_tree_1.lhe and w_production_tree_2.lhe.

DIS

main70.cc : examplifies how to provide an external photon flux for photo-production processes.
main68.cc : examplifies hard diffraction in the context of a photon-inside-lepton beam, like a HERA.
main36.cc : demonstrates how to generate Deeply Inelastic Scattering events, e.g. in a HERA configuration.

EvtGen

main48.cc : demonstrates how to use the EvtGenDecays class provided by include/Pythia8Plugins/EvtGen.h to perform decays with the EvtGen package. The header contains special instructions how to configure PYTHIA for use with EvtGen.

LHAPDF

main51.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. Also shows how to plot histograms (with logarithmic x scale) using the Python/Matplotlib/Pyplot solution.
main53.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.
main54.cc : compares the internal and LHAPDF implementations of the NNPDF 2.3 QCD+QED sets, for results and for timing. Requires that LHAPDF is properly linked.
main52.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.

LHE file

main38.cc : an extended version of main37.cc, where additionally it is shown how to extract many different kinds of LHEF version 3.0 information.
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. See also main64.cc.
main46.cc : illustrated how the ProMC library can be used to store Pythia events in a compact format.
main43.cc : a further extension of main42.cc, where subruns are used to process several consecutive LHEF, as in main13.cc, with information stored e.g in main43.cmnd. Other comments as for main42.cc.
main25.cc : input RPV-SUSY events from an LHEF file that contains an SLHA spectrum inside its header. The event file, main25.lhe, contains a sample events that illustrate how to arrange color tags in the presence of the color-space epsilon tensors that accompany baryon number violating event topologies.
main42.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. main42.cmnd) and output HepMC event file (e.g. hepmcout42.dat) are to be provided as command-line arguments. Requires that HepMC is properly linked. Note that the HepMC output file can become quite big; so no example is included in this distribution.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main13.cc : a streamlined version of main12.cc, where two Les Houches Event Files (ttbar.lhe and ttbar2.lhe) successively are used as input in main13.cmnd file.
main62.cc : illustrates how a user hook can be made to steer the angular distribution selection in resonance decays. The prime example would be if LHEF input, e.g. from Madgraph, contains undecayed resonances with helicity information. These would then be decayed isotropically by PYTHIA, but this example shows how one could do better. Some input in main62.cmnd.
main64.cc to write an LHEF. See also .
main11.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.
main37.cc : shows how LHEF version 3.0 files can be read and used to fill several histograms of the same property, but with different event weights.
main12.cc : a more sophisticated variant of main11.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.

NL3

main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main87.cc : do NL3 NLO merging, with inclusive NLO input, and with HepMC event output. Input settings are provided by the main87.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the tree-level input files w_production_tree_0.lhe, w_production_tree_1.lhe, w_production_tree_2.lhe and the inclusive POWHEG input files w_production_powheg_0.lhe, w_production_powheg_1.lhe. The program will produce positively and negatively weighted events. See NLO Merging (NL3 section) for further details.

NLO

main88.cc : do unitarised NLO+PS (UNLOPS) merging, with inclusive NLO input, and with HepMC event output. Input settings are provided by the main88.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the tree-level input files w_production_tree_0.lhe, w_production_tree_1.lhe, w_production_tree_2.lhe and the inclusive POWHEG input files w_production_powheg_0.lhe, w_production_powheg_1.lhe. The program will produce positively and negatively weighted events. See NLO Merging (UNLOPS section) for further details.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main87.cc : do NL3 NLO merging, with inclusive NLO input, and with HepMC event output. Input settings are provided by the main87.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the tree-level input files w_production_tree_0.lhe, w_production_tree_1.lhe, w_production_tree_2.lhe and the inclusive POWHEG input files w_production_powheg_0.lhe, w_production_powheg_1.lhe. The program will produce positively and negatively weighted events. See NLO Merging (NL3 section) for further details.

R-hadron

main28.cc : production of long-lived R-hadrons, that are forced to decay at a separate vertices and possibly with changed momenta.

UMEPS

main86.cc : do unitarised ME+PS (UMEPS) merging, with HepMC event output. Input settings are provided by the main86.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the input files w_production_tree_0.lhe, w_production_tree_1.lhe and w_production_tree_2.lhe. The program will produce positively and negatively weighted events. See UMEPS Merging for further details.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.

UNLOPS

main88.cc : do unitarised NLO+PS (UNLOPS) merging, with inclusive NLO input, and with HepMC event output. Input settings are provided by the main88.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the tree-level input files w_production_tree_0.lhe, w_production_tree_1.lhe, w_production_tree_2.lhe and the inclusive POWHEG input files w_production_powheg_0.lhe, w_production_powheg_1.lhe. The program will produce positively and negatively weighted events. See NLO Merging (UNLOPS section) for further details.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.

UPC

main70.cc : examplifies how to provide an external photon flux for photo-production processes.

aMC@NLO

main34.cc : demonstrates how Madgraph5_aMC@NLO can be run "from within" Pythia, making use of the LHAupMadgraph wrapper/interface of Madgraph5_aMC@NLO and the Pythia jet matching facilities.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main34.py : a Python interface equivalent of main34.cc. Demonstrates usage of a PYTHIA plugin within the Python interface.

analysis

main93.cc : stremlined event generation with possibility to output ROOT files, output HepMC files and run RIVET analyses, all by specifying output modes in a cmnd file, where also the event generator settings are specified. The example is run with command line options, run ./main93 -h to see a full list. See ROOT Usage for information about ROOT output, RIVET Usage for information about RIVET and HepMC Interface for information about HepMC.
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. Also exemplifies how Higgs mass, width and branching ratios can be set by hand.
main92.cc : shows how PYTHIA events can be stored as ROOT trees.
main121.cc : set up automatic uncertainty band variations to PDFs and factorization and renormalization scales.
main91.cc : shows how ROOT can be used for histogramming in a program that for the rest is structured like a normal PYTHIA run.
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.
main30.cc : example how to create a tailormade copy of the ordinary event record, here with hard-process history tracing closer to the PYTHIA 6 conventions.
main112.cc : p-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.

angantyr

main113.cc : Pb-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.
main111.cc : simple pp collisions as in main01.cc, but using the Angantyr model for Heavy Ion collisions. Also shows how Rivet analyses can be set up easily using a special interface.
main112.cc : p-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.

anti-kT

main10.cc : illustration how userHooks can be used interact directly with the event-generation process.
main10.py : a Python interface equivalent of main10.cc. Provides an example of how to derive PYTHIA classes in Python.

astroparticle

main07.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. Also shows how to plot histograms using the Python/Matplotlib/Pyplot solution.

basic usage

main72.cc : a comparison of SlowJet and FastJet jet finding, showing that they find the same jets if run under identical conditions, in this case for QCD jets.
main38.cc : an extended version of main37.cc, where additionally it is shown how to extract many different kinds of LHEF version 3.0 information.
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. Also exemplifies how Higgs mass, width and branching ratios can be set by hand.
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. See also main64.cc.
main73.cc : a comparison of jet properties on the parton and the hadron level, illustrating possibilities for larger control of which particles are used in the jet analyses.
main76.cc : simple setup for Dark Matter production in several different scenarios, as specified in main76.cmnd, notably with long-lived particle signatures.
main06.cc : generation of LEP1 hadronic events, i.e. e^+e^- → gamma*/Z^0 → q qbar, with charged multiplicity, sphericity, thrust and jet analysis.
main41.cc : similar to main01, except that the event record is output in the HepMC event record format. Requires that HepMC is properly linked. Note that the hepmcout41.dat output file can become quite big; so no example is included in this distribution.
main25.cc : input RPV-SUSY events from an LHEF file that contains an SLHA spectrum inside its header. The event file, main25.lhe, contains a sample events that illustrate how to arrange color tags in the presence of the color-space epsilon tensors that accompany baryon number violating event topologies.
main42.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. main42.cmnd) and output HepMC event file (e.g. hepmcout42.dat) are to be provided as command-line arguments. Requires that HepMC is properly linked. Note that the HepMC output file can become quite big; so no example is included in this distribution.
main13.cc : a streamlined version of main12.cc, where two Les Houches Event Files (ttbar.lhe and ttbar2.lhe) successively are used as input in main13.cmnd file.
main64.cc to write an LHEF. See also .
main08.cc : generation of the QCD jet cross section biased towards higher pT values, by two different techniques. Firstly, by splitting the run into subruns, each in its own pT bin, and adding the results properly reweighted. Two suboptions, with limits set either in the main program or by subrun specification in the main08.cmnd file. Secondly, by a continuous reweighting with a pT^4 bias in the selection, compensated by a 1/pT^4 event weight. Also inclusion of soft processes is illustrated, with subruns and weighted events.
main04.cc : tests of cross sections, multiplicities and average transverse momenta for elastic, diffractive and nondiffractive topologies, using main04.cmnd to pick processes. For photoproduction one can use the alternative main04_photons.cmnd input.
main01.cc : a simple study of the charged multiplicity for jet events at the LHC. (Brief example fitting on one slide.)
main11.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.
main05.cc : generation of QCD jet events at the LHC, with jet analysis using the SlowJet inclusive anti-kT sequential-recombination finder and the CellJet cone-jet finder.
main03.cc : a simple study of several different kinds of events, with the choice to be made in the main03.cmnd "cards file". Also shows how to plot histograms using the Python/Matplotlib/Pyplot solution.
main36.cc : demonstrates how to generate Deeply Inelastic Scattering events, e.g. in a HERA configuration.
main37.cc : shows how LHEF version 3.0 files can be read and used to fill several histograms of the same property, but with different event weights.
main02.cc : a simple study of the pT spectrum of Z bosons at the Tevatron. (Brief example fitting on one slide.)
main12.cc : a more sophisticated variant of main11.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.
main24.cc : tests of internally implemented cross sections for Supersymmetric particle production, with SUSY spectrum defined in slha2-example.spc and settings in main24.cmnd. For illustration, an alternative example spectrum is also available, sps1aWithDecays.spc, which contains a decay table in SLHA format.
main01.py : a Python interface equivalent of main01.cc.

beam gas

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. Illustrates how new Pythia instances can copy existing settings and particle data.

beam momentum

main23.cc : shows how to write external classes, derived from PYTHIA base classes, that can be handed to PYTHIA for internal generation. The MIXMAX random number generator is this way compared with the default PYTHIA one. Explicit implementations are included for the generation of external beam momentum spread and vertex location, and for a simple scaling external parton distribution set.

biasing

main09.cc : generation of two predetermined hard interactions in each event.
main63.cc : exemplifies how a user hook can be used to enhance the rate of rare emissions in the shower.
main08.cc : generation of the QCD jet cross section biased towards higher pT values, by two different techniques. Firstly, by splitting the run into subruns, each in its own pT bin, and adding the results properly reweighted. Two suboptions, with limits set either in the main program or by subrun specification in the main08.cmnd file. Secondly, by a continuous reweighting with a pT^4 bias in the selection, compensated by a 1/pT^4 event weight. Also inclusion of soft processes is illustrated, with subruns and weighted events.

celljet

main05.cc : generation of QCD jet events at the LHC, with jet analysis using the SlowJet inclusive anti-kT sequential-recombination finder and the CellJet cone-jet finder.

centrality

main113.cc : Pb-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.
main112.cc : p-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.

charged multiplicity

main113.cc : Pb-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.
main112.cc : p-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.
main01.cc : a simple study of the charged multiplicity for jet events at the LHC. (Brief example fitting on one slide.)
main01.py : a Python interface equivalent of main01.cc.

colour reconnection

main101.cc : shows how the string shoving mechanism, part of the rope hadronization framework, can be set up and used to generate ridge effects.
main102.cc : shows how flavour production is changed in the rope hadronization framework.
main29.cc : colour reconnection models studied for top production. Illustrates how to set up the user hooks in include/Pythia8Plugins/ColourReconnectionHooks.h, with several models not found in the standard PYTHIA library.

command file

main93.cc : stremlined event generation with possibility to output ROOT files, output HepMC files and run RIVET analyses, all by specifying output modes in a cmnd file, where also the event generator settings are specified. The example is run with command line options, run ./main93 -h to see a full list. See ROOT Usage for information about ROOT output, RIVET Usage for information about RIVET and HepMC Interface for information about HepMC.
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. Also exemplifies how Higgs mass, width and branching ratios can be set by hand.
main43.cc : a further extension of main42.cc, where subruns are used to process several consecutive LHEF, as in main13.cc, with information stored e.g in main43.cmnd. Other comments as for main42.cc.
main42.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. main42.cmnd) and output HepMC event file (e.g. hepmcout42.dat) are to be provided as command-line arguments. Requires that HepMC is properly linked. Note that the HepMC output file can become quite big; so no example is included in this distribution.
main13.cc : a streamlined version of main12.cc, where two Les Houches Event Files (ttbar.lhe and ttbar2.lhe) successively are used as input in main13.cmnd file.
main04.cc : tests of cross sections, multiplicities and average transverse momenta for elastic, diffractive and nondiffractive topologies, using main04.cmnd to pick processes. For photoproduction one can use the alternative main04_photons.cmnd input.
main03.cc : a simple study of several different kinds of events, with the choice to be made in the main03.cmnd "cards file". Also shows how to plot histograms using the Python/Matplotlib/Pyplot solution.
main24.cc : tests of internally implemented cross sections for Supersymmetric particle production, with SUSY spectrum defined in slha2-example.spc and settings in main24.cmnd. For illustration, an alternative example spectrum is also available, sps1aWithDecays.spc, which contains a decay table in SLHA format.

command line option

main93.cc : stremlined event generation with possibility to output ROOT files, output HepMC files and run RIVET analyses, all by specifying output modes in a cmnd file, where also the event generator settings are specified. The example is run with command line options, run ./main93 -h to see a full list. See ROOT Usage for information about ROOT output, RIVET Usage for information about RIVET and HepMC Interface for information about HepMC.
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. Also exemplifies how Higgs mass, width and branching ratios can be set by hand.
main42.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. main42.cmnd) and output HepMC event file (e.g. hepmcout42.dat) are to be provided as command-line arguments. Requires that HepMC is properly linked. Note that the HepMC output file can become quite big; so no example is included in this distribution.

cross sections

main04.cc : tests of cross sections, multiplicities and average transverse momenta for elastic, diffractive and nondiffractive topologies, using main04.cmnd to pick processes. For photoproduction one can use the alternative main04_photons.cmnd input.

dark matter

main75.cc : setup (in main75.cmnd) for Dark Matter production via an s-channel mediator, where a mono-jet pT spectrum is found with the FastJet package.

diffraction

main68.cc : examplifies hard diffraction in the context of a photon-inside-lepton beam, like a HERA.
main61.cc : exemplifies the generation of hard diffractive processes.

displaced vertex

main28.cc : production of long-lived R-hadrons, that are forced to decay at a separate vertices and possibly with changed momenta.

electron-positron

main06.cc : generation of LEP1 hadronic events, i.e. e^+e^- → gamma*/Z^0 → q qbar, with charged multiplicity, sphericity, thrust and jet analysis.

event filter

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.

event record

main30.cc : example how to create a tailormade copy of the ordinary event record, here with hard-process history tracing closer to the PYTHIA 6 conventions.

event shapes

main06.cc : generation of LEP1 hadronic events, i.e. e^+e^- → gamma*/Z^0 → q qbar, with charged multiplicity, sphericity, thrust and jet analysis.

external decays

main48.cc : demonstrates how to use the EvtGenDecays class provided by include/Pythia8Plugins/EvtGen.h to perform decays with the EvtGen package. The header contains special instructions how to configure PYTHIA for use with EvtGen.
main17.cc : shows (a) how to use UserHooks to regularize onium cross section for pT → 0, and (b) how decays could be handled externally.

external derived class

main23.cc : shows how to write external classes, derived from PYTHIA base classes, that can be handed to PYTHIA for internal generation. The MIXMAX random number generator is this way compared with the default PYTHIA one. Explicit implementations are included for the generation of external beam momentum spread and vertex location, and for a simple scaling external parton distribution set.

external resonance

main22.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 them handed in for generation as with normal internal classes.
main62.cc : illustrates how a user hook can be made to steer the angular distribution selection in resonance decays. The prime example would be if LHEF input, e.g. from Madgraph, contains undecayed resonances with helicity information. These would then be decayed isotropically by PYTHIA, but this example shows how one could do better. Some input in main62.cmnd.

extra dimensions

main27.cc : production of Kaluza-Klein gamma/Z states in TeV-sized extra dimensions.
main26.cc : test program for processes in scenarios with large extra dimensions or unparticles.

fastjet

main75.cc : setup (in main75.cmnd) for Dark Matter production via an s-channel mediator, where a mono-jet pT spectrum is found with the FastJet package.
main82.cc : do CKKW-L merging with a user-defined merging scale function. Input is provided by the main82.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main72.cc : a comparison of SlowJet and FastJet jet finding, showing that they find the same jets if run under identical conditions, in this case for QCD jets.
main71.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.
main74.cc : exemplifies how to use one of the contributed add-ons to the FastJet package. In this case the modified Mass Drop Tagger is used to improve the mass reconstruction of a boosted hadronically decaying Z^0.

fixed target

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. Illustrates how new Pythia instances can copy existing settings and particle data.

fxfx

main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.

hadronization

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. Can also be used for single-resonance decays, with showers.
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.
main73.cc : a comparison of jet properties on the parton and the hadron level, illustrating possibilities for larger control of which particles are used in the jet analyses.
main101.cc : shows how the string shoving mechanism, part of the rope hadronization framework, can be set up and used to generate ridge effects.
main25.cc : input RPV-SUSY events from an LHEF file that contains an SLHA spectrum inside its header. The event file, main25.lhe, contains a sample events that illustrate how to arrange color tags in the presence of the color-space epsilon tensors that accompany baryon number violating event topologies.
main102.cc : shows how flavour production is changed in the rope hadronization framework.
main29.cc : colour reconnection models studied for top production. Illustrates how to set up the user hooks in include/Pythia8Plugins/ColourReconnectionHooks.h, with several models not found in the standard PYTHIA library.

hard diffraction

main68.cc : examplifies hard diffraction in the context of a photon-inside-lepton beam, like a HERA.

heavy ion

main70.cc : examplifies how to provide an external photon flux for photo-production processes.

heavy ions

main113.cc : Pb-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.
main111.cc : simple pp collisions as in main01.cc, but using the Angantyr model for Heavy Ion collisions. Also shows how Rivet analyses can be set up easily using a special interface.
main112.cc : p-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.

helaconia

main35.cc : demonstrates how to generate quarkonia events with the external HelacOnia package interfaced to Pythia, and compare results with the internal implementation.

hepmc

main86.cc : do unitarised ME+PS (UMEPS) merging, with HepMC event output. Input settings are provided by the main86.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the input files w_production_tree_0.lhe, w_production_tree_1.lhe and w_production_tree_2.lhe. The program will produce positively and negatively weighted events. See UMEPS Merging for further details.
main84.cc : do CKKW-L merging with output in such a way that it can be used in subsequent RIVET analyses. Input is provided by the main84.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main93.cc : stremlined event generation with possibility to output ROOT files, output HepMC files and run RIVET analyses, all by specifying output modes in a cmnd file, where also the event generator settings are specified. The example is run with command line options, run ./main93 -h to see a full list. See ROOT Usage for information about ROOT output, RIVET Usage for information about RIVET and HepMC Interface for information about HepMC.
main88.cc : do unitarised NLO+PS (UNLOPS) merging, with inclusive NLO input, and with HepMC event output. Input settings are provided by the main88.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the tree-level input files w_production_tree_0.lhe, w_production_tree_1.lhe, w_production_tree_2.lhe and the inclusive POWHEG input files w_production_powheg_0.lhe, w_production_powheg_1.lhe. The program will produce positively and negatively weighted events. See NLO Merging (UNLOPS section) for further details.
main43.cc : a further extension of main42.cc, where subruns are used to process several consecutive LHEF, as in main13.cc, with information stored e.g in main43.cmnd. Other comments as for main42.cc.
main41.cc : similar to main01, except that the event record is output in the HepMC event record format. Requires that HepMC is properly linked. Note that the hepmcout41.dat output file can become quite big; so no example is included in this distribution.
main42.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. main42.cmnd) and output HepMC event file (e.g. hepmcout42.dat) are to be provided as command-line arguments. Requires that HepMC is properly linked. Note that the HepMC output file can become quite big; so no example is included in this distribution.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main85.cc : do CKKW-L merging, with HepMC event output. Input settings are provided by the main85.cmnd file. This example program allows the use of input Les Houches events that are regularised with only very minimal cuts, and on which Pythia itself should enforce the more restrictive merging scale cut. The example program can be used with the input files w_production_tree_0.lhe, w_production_tree_1.lhe and w_production_tree_2.lhe.
main87.cc : do NL3 NLO merging, with inclusive NLO input, and with HepMC event output. Input settings are provided by the main87.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the tree-level input files w_production_tree_0.lhe, w_production_tree_1.lhe, w_production_tree_2.lhe and the inclusive POWHEG input files w_production_powheg_0.lhe, w_production_powheg_1.lhe. The program will produce positively and negatively weighted events. See NLO Merging (NL3 section) for further details.

jet finding

main75.cc : setup (in main75.cmnd) for Dark Matter production via an s-channel mediator, where a mono-jet pT spectrum is found with the FastJet package.
main82.cc : do CKKW-L merging with a user-defined merging scale function. Input is provided by the main82.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main72.cc : a comparison of SlowJet and FastJet jet finding, showing that they find the same jets if run under identical conditions, in this case for QCD jets.
main06.cc : generation of LEP1 hadronic events, i.e. e^+e^- → gamma*/Z^0 → q qbar, with charged multiplicity, sphericity, thrust and jet analysis.
main71.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.
main74.cc : exemplifies how to use one of the contributed add-ons to the FastJet package. In this case the modified Mass Drop Tagger is used to improve the mass reconstruction of a boosted hadronically decaying Z^0.
main10.cc : illustration how userHooks can be used interact directly with the event-generation process.
main05.cc : generation of QCD jet events at the LHC, with jet analysis using the SlowJet inclusive anti-kT sequential-recombination finder and the CellJet cone-jet finder.
main10.py : a Python interface equivalent of main10.cc. Provides an example of how to derive PYTHIA classes in Python.

jets

main68.cc : examplifies hard diffraction in the context of a photon-inside-lepton beam, like a HERA.

kT

main82.cc : do CKKW-L merging with a user-defined merging scale function. Input is provided by the main82.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.

leading order

main86.cc : do unitarised ME+PS (UMEPS) merging, with HepMC event output. Input settings are provided by the main86.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the input files w_production_tree_0.lhe, w_production_tree_1.lhe and w_production_tree_2.lhe. The program will produce positively and negatively weighted events. See UMEPS Merging for further details.
main84.cc : do CKKW-L merging with output in such a way that it can be used in subsequent RIVET analyses. Input is provided by the main84.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main82.cc : do CKKW-L merging with a user-defined merging scale function. Input is provided by the main82.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main81.cc : do CKKW-L merging with a merging scale defined in kT. Input is provided by the main81.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main80.cc : do CKKW-L merging with a merging scale defined in kT. Input is provided by the main80.cmnd file and input LHE files. Very basic and pedagogical setup, suitable for tutorials.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main85.cc : do CKKW-L merging, with HepMC event output. Input settings are provided by the main85.cmnd file. This example program allows the use of input Les Houches events that are regularised with only very minimal cuts, and on which Pythia itself should enforce the more restrictive merging scale cut. The example program can be used with the input files w_production_tree_0.lhe, w_production_tree_1.lhe and w_production_tree_2.lhe.
main83.cc : as main82.cc but with an additional cut on the lowest multiplicity allowed for the reclustered state. The same input as for main82.cc can be used.

madgraph

main34.cc : demonstrates how Madgraph5_aMC@NLO can be run "from within" Pythia, making use of the LHAupMadgraph wrapper/interface of Madgraph5_aMC@NLO and the Pythia jet matching facilities.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main34.py : a Python interface equivalent of main34.cc. Demonstrates usage of a PYTHIA plugin within the Python interface.

matching

main34.cc : demonstrates how Madgraph5_aMC@NLO can be run "from within" Pythia, making use of the LHAupMadgraph wrapper/interface of Madgraph5_aMC@NLO and the Pythia jet matching facilities.
main32.cc : exemplifies MLM merging, either in the ALPGEN variant or in the Madgraph one, and with input events either from ALPGEN or from Madgraph, with relevant control cards stored in main32.cmnd. See Jet Matching for further details. Traditionally the ALPGEN output is split into one file with events and another with parameters and cross sections (unlike in LHEF). Here a sample of W + 3 jets events is stored in main32.unw and the parameters to go with it in main32_unw.par. Madgraph events are taken from the w+_production_lhc_2.lhe file in this case.
main33.cc : demonstrates how to link the POWHEGBOX matrix element programs dynamically, bypassing the need for intermediate LHE files. Two special files are used in this option: include/Pythia8Plugins/LHAPowheg.h contains the LHAup class wrapper used to build the POWHEG plugin libraries, and include/Pythia8Plugins/PowhegProcs.h the simple class that facilitates loading the POWHEG plugins. In addition main33.cmnd contains the commands needed for POWHEGBOX to run the example.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main31.cc : exemplifies an improved matching of parton showers to LHEF-style input based on the POWHEG approach. The main31.cmnd allows to switch between several different matching options. It also allows to select input process, in this case either for the POWHEG-hvq program applied to top pair production Cor10 or for QCD 2+3-jet events. The small samples of input events are stored in the powheg-hvq.lhe and powheg-dijets.lhe files, respectively.
main34.py : a Python interface equivalent of main34.cc. Demonstrates usage of a PYTHIA plugin within the Python interface.

matplotlib

main07.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. Also shows how to plot histograms using the Python/Matplotlib/Pyplot solution.
main03.cc : a simple study of several different kinds of events, with the choice to be made in the main03.cmnd "cards file". Also shows how to plot histograms using the Python/Matplotlib/Pyplot solution.

merging

main86.cc : do unitarised ME+PS (UMEPS) merging, with HepMC event output. Input settings are provided by the main86.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the input files w_production_tree_0.lhe, w_production_tree_1.lhe and w_production_tree_2.lhe. The program will produce positively and negatively weighted events. See UMEPS Merging for further details.
main84.cc : do CKKW-L merging with output in such a way that it can be used in subsequent RIVET analyses. Input is provided by the main84.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main82.cc : do CKKW-L merging with a user-defined merging scale function. Input is provided by the main82.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main88.cc : do unitarised NLO+PS (UNLOPS) merging, with inclusive NLO input, and with HepMC event output. Input settings are provided by the main88.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the tree-level input files w_production_tree_0.lhe, w_production_tree_1.lhe, w_production_tree_2.lhe and the inclusive POWHEG input files w_production_powheg_0.lhe, w_production_powheg_1.lhe. The program will produce positively and negatively weighted events. See NLO Merging (UNLOPS section) for further details.
main81.cc : do CKKW-L merging with a merging scale defined in kT. Input is provided by the main81.cmnd file and the three data files w+_production_lhc_0.lhe, w+_production_lhc_1.lhe and w+_production_lhc_2.lhe.
main80.cc : do CKKW-L merging with a merging scale defined in kT. Input is provided by the main80.cmnd file and input LHE files. Very basic and pedagogical setup, suitable for tutorials.
main32.cc : exemplifies MLM merging, either in the ALPGEN variant or in the Madgraph one, and with input events either from ALPGEN or from Madgraph, with relevant control cards stored in main32.cmnd. See Jet Matching for further details. Traditionally the ALPGEN output is split into one file with events and another with parameters and cross sections (unlike in LHEF). Here a sample of W + 3 jets events is stored in main32.unw and the parameters to go with it in main32_unw.par. Madgraph events are taken from the w+_production_lhc_2.lhe file in this case.
main33.cc : demonstrates how to link the POWHEGBOX matrix element programs dynamically, bypassing the need for intermediate LHE files. Two special files are used in this option: include/Pythia8Plugins/LHAPowheg.h contains the LHAup class wrapper used to build the POWHEG plugin libraries, and include/Pythia8Plugins/PowhegProcs.h the simple class that facilitates loading the POWHEG plugins. In addition main33.cmnd contains the commands needed for POWHEGBOX to run the example.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main85.cc : do CKKW-L merging, with HepMC event output. Input settings are provided by the main85.cmnd file. This example program allows the use of input Les Houches events that are regularised with only very minimal cuts, and on which Pythia itself should enforce the more restrictive merging scale cut. The example program can be used with the input files w_production_tree_0.lhe, w_production_tree_1.lhe and w_production_tree_2.lhe.
main83.cc : as main82.cc but with an additional cut on the lowest multiplicity allowed for the reclustered state. The same input as for main82.cc can be used.
main31.cc : exemplifies an improved matching of parton showers to LHEF-style input based on the POWHEG approach. The main31.cmnd allows to switch between several different matching options. It also allows to select input process, in this case either for the POWHEG-hvq program applied to top pair production Cor10 or for QCD 2+3-jet events. The small samples of input events are stored in the powheg-hvq.lhe and powheg-dijets.lhe files, respectively.
main87.cc : do NL3 NLO merging, with inclusive NLO input, and with HepMC event output. Input settings are provided by the main87.cmnd file. This example program allows the consistent use of input Les Houches events that are regularised with only very minimal cuts, similar to main85.cc. The example program can be used with the tree-level input files w_production_tree_0.lhe, w_production_tree_1.lhe, w_production_tree_2.lhe and the inclusive POWHEG input files w_production_powheg_0.lhe, w_production_powheg_1.lhe. The program will produce positively and negatively weighted events. See NLO Merging (NL3 section) for further details.

minimum bias

main52.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.
main04.cc : tests of cross sections, multiplicities and average transverse momenta for elastic, diffractive and nondiffractive topologies, using main04.cmnd to pick processes. For photoproduction one can use the alternative main04_photons.cmnd input.

mlm

main32.cc : exemplifies MLM merging, either in the ALPGEN variant or in the Madgraph one, and with input events either from ALPGEN or from Madgraph, with relevant control cards stored in main32.cmnd. See Jet Matching for further details. Traditionally the ALPGEN output is split into one file with events and another with parameters and cross sections (unlike in LHEF). Here a sample of W + 3 jets events is stored in main32.unw and the parameters to go with it in main32_unw.par. Madgraph events are taken from the w+_production_lhc_2.lhe file in this case.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.

multi-instance

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. Illustrates how new Pythia instances can copy existing settings and particle data.

onia

main17.cc : shows (a) how to use UserHooks to regularize onium cross section for pT → 0, and (b) how decays could be handled externally.
main35.cc : demonstrates how to generate quarkonia events with the external HelacOnia package interfaced to Pythia, and compare results with the internal implementation.

pT bias

main08.cc : generation of the QCD jet cross section biased towards higher pT values, by two different techniques. Firstly, by splitting the run into subruns, each in its own pT bin, and adding the results properly reweighted. Two suboptions, with limits set either in the main program or by subrun specification in the main08.cmnd file. Secondly, by a continuous reweighting with a pT^4 bias in the selection, compensated by a 1/pT^4 event weight. Also inclusion of soft processes is illustrated, with subruns and weighted events.

parton distribution

main51.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. Also shows how to plot histograms (with logarithmic x scale) using the Python/Matplotlib/Pyplot solution.
main53.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.
main54.cc : compares the internal and LHAPDF implementations of the NNPDF 2.3 QCD+QED sets, for results and for timing. Requires that LHAPDF is properly linked.
main55.cc : exemplifies how you can use the internal implementation of interpolation in an lhagrid1 .dat file, without linking LHAPDF6. Also illustrates the topical issue of associated event properties for an intermediate spinless resonance in γ + γ → γ + γ at 750 GeV.
main52.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.
main23.cc : shows how to write external classes, derived from PYTHIA base classes, that can be handed to PYTHIA for internal generation. The MIXMAX random number generator is this way compared with the default PYTHIA one. Explicit implementations are included for the generation of external beam momentum spread and vertex location, and for a simple scaling external parton distribution set.

photon beam

main70.cc : examplifies how to provide an external photon flux for photo-production processes.
main69.cc : examplifies how to generate all relevant contributions for charged particle spectra in photon-photon and photon-proton collisions.
main53.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.
main55.cc : exemplifies how you can use the internal implementation of interpolation in an lhagrid1 .dat file, without linking LHAPDF6. Also illustrates the topical issue of associated event properties for an intermediate spinless resonance in γ + γ → γ + γ at 750 GeV.

photon-photon

main69.cc : examplifies how to generate all relevant contributions for charged particle spectra in photon-photon and photon-proton collisions.

photoproduction

main70.cc : examplifies how to provide an external photon flux for photo-production processes.
main68.cc : examplifies hard diffraction in the context of a photon-inside-lepton beam, like a HERA.
main69.cc : examplifies how to generate all relevant contributions for charged particle spectra in photon-photon and photon-proton collisions.

pileup

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. Illustrates how new Pythia instances can copy existing settings and particle data.

powheg

main33.cc : demonstrates how to link the POWHEGBOX matrix element programs dynamically, bypassing the need for intermediate LHE files. Two special files are used in this option: include/Pythia8Plugins/LHAPowheg.h contains the LHAup class wrapper used to build the POWHEG plugin libraries, and include/Pythia8Plugins/PowhegProcs.h the simple class that facilitates loading the POWHEG plugins. In addition main33.cmnd contains the commands needed for POWHEGBOX to run the example.
main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main31.cc : exemplifies an improved matching of parton showers to LHEF-style input based on the POWHEG approach. The main31.cmnd allows to switch between several different matching options. It also allows to select input process, in this case either for the POWHEG-hvq program applied to top pair production Cor10 or for QCD 2+3-jet events. The small samples of input events are stored in the powheg-hvq.lhe and powheg-dijets.lhe files, respectively.

pp

main111.cc : simple pp collisions as in main01.cc, but using the Angantyr model for Heavy Ion collisions. Also shows how Rivet analyses can be set up easily using a special interface.

process cross sections

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.

process selection

main03.cc : a simple study of several different kinds of events, with the choice to be made in the main03.cmnd "cards file". Also shows how to plot histograms using the Python/Matplotlib/Pyplot solution.

process veto

main10.cc : illustration how userHooks can be used interact directly with the event-generation process.
main10.py : a Python interface equivalent of main10.cc. Provides an example of how to derive PYTHIA classes in Python.

promc

main46.cc : illustrated how the ProMC library can be used to store Pythia events in a compact format.

proton-ion

main112.cc : p-Pb collisions at LHC energies, using the Angantyr model for Heavy Ion collisions, and analyzing events by centrality bins.

pythia 6

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.
main30.cc : example how to create a tailormade copy of the ordinary event record, here with hard-process history tracing closer to the PYTHIA 6 conventions.

python

main07.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. Also shows how to plot histograms using the Python/Matplotlib/Pyplot solution.
main03.cc : a simple study of several different kinds of events, with the choice to be made in the main03.cmnd "cards file". Also shows how to plot histograms using the Python/Matplotlib/Pyplot solution.
main34.py : a Python interface equivalent of main34.cc. Demonstrates usage of a PYTHIA plugin within the Python interface.
main01.py : a Python interface equivalent of main01.cc.
main10.py : a Python interface equivalent of main10.cc. Provides an example of how to derive PYTHIA classes in Python.

random number generator

main23.cc : shows how to write external classes, derived from PYTHIA base classes, that can be handed to PYTHIA for internal generation. The MIXMAX random number generator is this way compared with the default PYTHIA one. Explicit implementations are included for the generation of external beam momentum spread and vertex location, and for a simple scaling external parton distribution set.

resonance decay

main22.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 them handed in for generation as with normal internal classes.
main62.cc : illustrates how a user hook can be made to steer the angular distribution selection in resonance decays. The prime example would be if LHEF input, e.g. from Madgraph, contains undecayed resonances with helicity information. These would then be decayed isotropically by PYTHIA, but this example shows how one could do better. Some input in main62.cmnd.

rivet

main93.cc : stremlined event generation with possibility to output ROOT files, output HepMC files and run RIVET analyses, all by specifying output modes in a cmnd file, where also the event generator settings are specified. The example is run with command line options, run ./main93 -h to see a full list. See ROOT Usage for information about ROOT output, RIVET Usage for information about RIVET and HepMC Interface for information about HepMC.
main111.cc : simple pp collisions as in main01.cc, but using the Angantyr model for Heavy Ion collisions. Also shows how Rivet analyses can be set up easily using a special interface.

root

main93.cc : stremlined event generation with possibility to output ROOT files, output HepMC files and run RIVET analyses, all by specifying output modes in a cmnd file, where also the event generator settings are specified. The example is run with command line options, run ./main93 -h to see a full list. See ROOT Usage for information about ROOT output, RIVET Usage for information about RIVET and HepMC Interface for information about HepMC.
main92.cc : shows how PYTHIA events can be stored as ROOT trees.
main91.cc : shows how ROOT can be used for histogramming in a program that for the rest is structured like a normal PYTHIA run.

rope hadronization

main102.cc : shows how flavour production is changed in the rope hadronization framework.

second interaction

main09.cc : generation of two predetermined hard interactions in each event.

slowjet

main72.cc : a comparison of SlowJet and FastJet jet finding, showing that they find the same jets if run under identical conditions, in this case for QCD jets.
main05.cc : generation of QCD jet events at the LHC, with jet analysis using the SlowJet inclusive anti-kT sequential-recombination finder and the CellJet cone-jet finder.

string shoving

main101.cc : shows how the string shoving mechanism, part of the rope hadronization framework, can be set up and used to generate ridge effects.

supersymmetry

main76.cc : simple setup for Dark Matter production in several different scenarios, as specified in main76.cmnd, notably with long-lived particle signatures.
main24.cc : tests of internally implemented cross sections for Supersymmetric particle production, with SUSY spectrum defined in slha2-example.spc and settings in main24.cmnd. For illustration, an alternative example spectrum is also available, sps1aWithDecays.spc, which contains a decay table in SLHA format.

tevatron

main02.cc : a simple study of the pT spectrum of Z bosons at the Tevatron. (Brief example fitting on one slide.)

top mass

main29.cc : colour reconnection models studied for top production. Illustrates how to set up the user hooks in include/Pythia8Plugins/ColourReconnectionHooks.h, with several models not found in the standard PYTHIA library.

tuning

main93.cc : stremlined event generation with possibility to output ROOT files, output HepMC files and run RIVET analyses, all by specifying output modes in a cmnd file, where also the event generator settings are specified. The example is run with command line options, run ./main93 -h to see a full list. See ROOT Usage for information about ROOT output, RIVET Usage for information about RIVET and HepMC Interface for information about HepMC.
main121.cc : set up automatic uncertainty band variations to PDFs and factorization and renormalization scales.
main52.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.

two-body decay

main07.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. Also shows how to plot histograms using the Python/Matplotlib/Pyplot solution.

uncertainty bands

main121.cc : set up automatic uncertainty band variations to PDFs and factorization and renormalization scales.

userhooks

main89.cc : do matching/merging according to five alternative methods, simply by choosing which .cmnd file to read: main89ckkwl.cmnd for CKKW-L, main89fxfx.cmnd for FxFx, main89mlm.cmnd for MLM, main89umeps.cmnd for UMEPS, and main89unlops.cmnd for UNLOPS.
main63.cc : exemplifies how a user hook can be used to enhance the rate of rare emissions in the shower.
main62.cc : illustrates how a user hook can be made to steer the angular distribution selection in resonance decays. The prime example would be if LHEF input, e.g. from Madgraph, contains undecayed resonances with helicity information. These would then be decayed isotropically by PYTHIA, but this example shows how one could do better. Some input in main62.cmnd.
main10.cc : illustration how userHooks can be used interact directly with the event-generation process.
main17.cc : shows (a) how to use UserHooks to regularize onium cross section for pT → 0, and (b) how decays could be handled externally.
main10.py : a Python interface equivalent of main10.cc. Provides an example of how to derive PYTHIA classes in Python.

vertex spread

main23.cc : shows how to write external classes, derived from PYTHIA base classes, that can be handed to PYTHIA for internal generation. The MIXMAX random number generator is this way compared with the default PYTHIA one. Explicit implementations are included for the generation of external beam momentum spread and vertex location, and for a simple scaling external parton distribution set.

z production

main61.cc : exemplifies the generation of hard diffractive processes.
main02.cc : a simple study of the pT spectrum of Z bosons at the Tevatron. (Brief example fitting on one slide.)