Metadata-Version: 2.1
Name: pythia8mc
Version: 8.317.1
Summary: General purpose particle physics Monte Carlo generator.
Home-page: https://pythia.org
Author: Pythia 8 Team
Author-email: authors@pythia.org
License: GNU GPL v2 or later
Download-URL: https://pythia.org/download/pythia83/pythia8317.tgz
Project-URL: Physics Manual, https://pythia.org/pdfdoc/pythia8300.pdf
Project-URL: Doxygen, https://pythia.org/doxygen/pythia8317/
Project-URL: Source Repository, https://gitlab.com/Pythia8/releases
Project-URL: Issue Desk, https://gitlab.com/Pythia8/releases/-/issues
Project-URL: Documentation, https://pythia.org/manuals/pythia8317/Welcome.html
Platform: Linux
Platform: MacOS
Description-Content-Type: text/markdown


![](https://cernbox.cern.ch/remote.php/dav/public-files/t3FI2QHkue2MeXF/banner.png?scalingup=0&preview=1&a=1&c=385579588413030400%3Abb589188&x=1280&y=1280) 

# PYTHIA

PYTHIA is a program for the generation of high-energy physics collision events, i.e. for the description of collisions at high energies between electrons, protons, photons and heavy nuclei. It contains theory and models for a number of physics aspects, including hard and soft interactions, parton distributions, initial- and final-state parton showers, multiparton interactions, fragmentation and decay. It is largely based on original research, but also borrows many formulae and other knowledge from the literature. As such it is categorized as a general purpose Monte Carlo event generator.

# Installation

The PYTHIA package is natively written in C++, which is the preferred interface. To work with PYTHIA via C++ go to the [PYTHIA homepage](https://pythia.org/) and follow the instructions outlined there. The Python interface to PYTHIA can be installed directly via `pip`. **Note that for this PyPI distribution of PYTHIA, the module name has been changed from `pythia8` to `pythia8mc` as the `pythia8` project name was unavailable.** Outside of the PyPI distribution, the `pythia8` module name is always used.

```bash
pip install pythia8mc
```

The interface is also available via `conda`.

```bash
conda install -c conda-forge pythia8
```

It is possible, and in many ways preferable, to build the Python interface directly from the PYTHIA C++ distribution (as well as update the Python bindings) using the configuration script.

```bash
wget https://pythia.org/download/pythia83/pythia8XXX.tgz
tar xvfz pythia8XXX.tgz
cd pythia8XXX
./configure --with-python
make
```

# Usage

For a full description of usage, as well as examples, see the accompanying [HTML manual](https://pythia.org/documentation/) for this version of PYTHIA. 

The following imports the `pythia8mc` module and creates a `Pythia` instance.

```python
import pythia8mc
pythia = pythia8mc.Pythia()
```

PYTHIA must then be configured and initialized, in this example to produce minimum bias events at the LHC.

```python
pythia.readString("SoftQCD:all = on")
pythia.init()
```

Finally, we can produce an event, and explore the event record.

```python
pythia.next()
for prt in pythia.event: print(prt.name())
```

# Paths

PYTHIA requires the XML files which are used to build the [HTML manual](https://pythia.org/documentation/) to define settings. Additionally, settings files for tunes are also distributed with PYTHIA. For the PyPI distribution, these files can be found along the relative path,

```
../../../share/Pythia8/xmldoc
```

with respect to the `pythia8mc` module library. By default, this path should be correctly set, but it can be printed as follows.

```python
print(pythia8mc.__file__.rstrip("pythia8mc.so") + "../../../share/Pythia8/xmldoc")
```

The settings directory can be found in `../settings/` with respect to this folder. However, it is possible to overwrite the XML path by setting the environment variable `PYTHIA8DATA`,

```bash
export PYTHIA8DATA=<PYTHIA XML path> 
```

or by passing the XML path to the `Pythia` constructor.

```python
pythia8mc.Pythia("<PYTHIA XML path>")
```


