ASCIIEventTree
Latest version: v8317 | Compatible with: Pythia 8.310+ | Authors: Christian Bierlich christian.bierlich@fysik.lu.se 0000-0002-3978-6085
ASCIIEventTree
A PYTHIA 8 plugin that renders the event record as an ASCII decay tree after each fully-generated event. Uses box-drawing characters to show parent-daughter relationships and supports filtering of parton-shower copy chains, deduplication of shared particles, and annotation of multi-body production vertices.
Bierlich, Christian christian.bierlich@fysik.lu.se
Overview
The ASCIIEventTree plugin prints a human-readable ASCII tree structure of the PYTHIA 8 event record, including:
- Tree structure: Full decay chain from primary beam particles to final-state hadrons.
- Particle information: Name, event-record index, and PDG id for each particle.
- Copy suppression: Optionally collapse single-daughter same-id parton-shower chains (e.g.,
q → q → q → ...becomesq → ...). - Deduplication: Optionally print each particle index at most once; repeated occurrences show a cross-reference stub.
- Vertex annotation: Optionally flag multi-body production vertices (hard scatters, string fragmentation, etc.) with
{2->N: parent1 + parent2}labels.
Settings
All settings have the prefix ASCIIEventTree:.
enabled(flag, defaultoff): Enable or disable ASCII tree output.nFirst(mode, default1, range[-1, ∞)): Number of events for which to print the tree.-1= all events;0= none;N > 0= first N events.suppressCopies(flag, defaultoff): Collapse parton-shower copy chains.deduplicateShared(flag, defaultoff): Print each particle index at most once.markVertices(flag, defaultoff): Annotate multi-body production vertices.
Usage
Load the plugin and configure settings via a command file:
Init:plugins = {libASCIIEventTree.so::EventHooks}
ASCIIEventTree:enabled = on
ASCIIEventTree:nFirst = 10
Run the test program:
./testPlugins ASCIITree-ee.cmnd
Example Output
┌─ Event 1 (192 entries) ─────────────────
├── e- [idx = 1, pid = 11]
│ └── e- [idx = 6, pid = 11]
│ ├── gamma [idx = 9, pid = 22]
│ └── e- [idx = 3, pid = 11]
│ └── Z0 [idx = 8, pid = 23]
│ ├── u [idx = 40, pid = 2]
│ │ └── u [idx = 69, pid = 2]
│ │ ├── rho0 [idx = 74, pid = 113] {2->N: u + ubar}
│ │ │ ├── pi+ [idx = 121, pid = 211]
│ │ │ └── pi- [idx = 122, pid = -211]
│ │ └── ...
│ └── ubar [idx = 45, pid = -2]
│ ├── ↩ rho0 [idx = 74, pid = 113] (see above)
│ └── ...
- PYTHIA 8 documentation: https://pythia.org/
- Plugin system: See
share/Pythia8/xmldoc/Plugins.xmlin the PYTHIA 8 source.
