evtgen is hosted by Hepforge, IPPP Durham

EvtGen Installation

Here is an example script that can be used to install EvtGen with HepMC, Pythia8, Photos and Tauola packages.

To build the EvtGen code, first make sure that there is a valid (C++) version of HepMC available (version 2.04 and above). Optionally, it is possible to use other external generators, such as Pythia8 (version 8.180 and above for Pythia decays in the DECAY.DEC file), Photos (version 3.5.2 and above) for radiative corrections, and Tauola (version 1.0.7 and above) for tau decays. All of these packages have instructions for building them, usually by running their "configure" script. HepMC is used to store particle information. Once these packages are available, set up the EvtGen release by running


within the EvtGen base directory, using the following options:

  • --hepmcdir = location of HepMC build directory (mandatory)
  • --photosdir = location of Photos base directory (optional)
  • --pythiadir = location of Pythia base directory (optional)
  • --tauoladir = location of Tauola base directory (optional)

When successful, this will create a "config.mk" file that specifies the locations of the include and library directories of these additional external generators. Then compile the EvtGen code using


This should create the libraries lib/libEvtGen.so and lib/libEvtGenExternal.so, as well as the archives lib/archive/libEvtGen.a and lib/archive/libEvtGenExternal.a. The "EvtGenExternal" library will not be created if no external generators are specified in the configuration script.

Note that gfortran is needed to compile the code (mainly for Photos/Tauola). The alternative (not recommended) compilers g77 (f77) can be used instead by changing the FC variable in the configure script.

To create an EvtGen executable, the following libraries need to be included in the link path, owing to the dependence on the above external packages and Fortran code (for some EvtGenModels and for Photos/Tauola):

  • BASEDIR = <EvtGen base directory>
  • HEPMCDIR = <base directory of HepMC>
  • PHOTOSDIR = <base directory of C++ Photos>
  • TAUOLADIR = <base directory of C++ Tauola>
  • PYTHIADIR = <base directory of Pythia8>

LIBS = -L${BASEDIR}/lib -L${HEPMCDIR}/lib -L${PHOTOSDIR}/lib \
-L${TAUOLADIR}/lib -L${PYTHIADIR}/lib -lgfortran \
-lHepMC -lPhotosCxxInterface -lPhotosFortran -lTauolaCxxInterface -lTauolaFortran \
-lpythia8 -llhapdfdummy -lEvtGen -lEvtGenExternal

Three example programs using EvtGen can be seen in the test sub-directory along with the required Makefile. If there are errors about missing shared libraries, and they have been built correctly, then the LD_LIBRARY_PATH needs to be set-up to include them:

  • setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:<location of HepMC library directory>
  • setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:<location of Pythia 8 library directory>
  • setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:<location of Tauola library directory>
  • setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:<location of Photos library directory>
  • setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:<location of EvtGen library directory>

To use Pythia 8, the environment variable PYTHIA8DATA needs to be set to the location of the corresponding xml documentation directory, which also contains the default values for particle decays and models. For Pythia versions 8.2x and above:

setenv PYTHIA8DATA <location of Pythia 8 base directory>/share/Pythia8/xmldoc

For earlier Pythia versions, use

setenv PYTHIA8DATA <location of Pythia 8 base directory>/xmldoc