This directory contains examples for using HepMC as an interface with various Monte Carlo event generators, such as PYTHIA. It also include an example for demonstrating MC truth handling with HepMC.
Note: examples were tested only on Linux with gcc.
This class is derived from G4VPrimaryGenerator, and is a base class for primary generation via HepMC object.
protected members:
public members:
This derived class is for reading primary information from an Ascii file generated by HepMC.
This derived class is for directly calling PYTHIA functions. Users can set parameters, initialize, generate, and terminate by command line operation.
HEPMC_DIR the path to HepMC installation.
2A. With CMake: Build pythia6 library
For a convenience a CMake file for building Pythia6 library from the source is provided in examples/extended/eventgenerator/CMakeLists.txt.pythia6. Build the pythia6 library following the instructions in this file and then define the environment variables:
PYTHIA6 the path where pythia6 library is installed PYTHIA6_VERSION the pythia version
2B. With GNUmake: Define the environment variables:
PYTHIA6 the path to pythia-versionX.f source code PYTHIA6_VERSION the pythia version
e.g. If you download pythia-6.4.26.f.gz and unzip it in $HOME, then you have to set: export PYTHIA6=$HOME export PYTHIA6_VERSION="6.4.26"
pythia6 will be then compiled together with example code.
See more details in Example HepMCEx01 and Example HepMCEx02.
We attached a sample HepMC Ascii data file, "data/example_MyPythia.dat", which contains 10 PYTHIA events created by "data/example_MyPythia.cxx".
Application MCTruth demonstrating handling of Monte-Carlo truth information through the HepMC package.