evtgen is hosted by Hepforge, IPPP Durham

EvtGen installation

Using an LCG installation of EvtGen

EvtGen is released as part of the LCG releases. As such, to be able to use EvtGen on a machine with access to CVMFS, it is sufficient to source the setup script for a particlar LCG release, e.g.

source /cvmfs/sft.cern.ch/lcg/views/setupViews.sh LCG_101 x86_64-centos7-gcc11-opt
The first argument to the script is the LCG release to use and the second argument specifies the architecture and compiler combination.

Building from source

From version 2.0.0 of the package, the installation of EvtGen uses the CMake build system. The instructions below refer to that system. If you wish to install a previous version of EvtGen, please refer to the instructions in the README file that comes with that version.

Standalone build of EvtGen and all dependencies

To simplify the procedure you can download and use the setupEvtGen script, which automates the process of downloading and building EvtGen and all its dependencies from source.

There are variables in the script that can be edited to set the installation location and the versions of EvtGen and each dependency (for more details see below) to be used. These should at least be checked before running the script.

Alternatively, if you already have an existing installation of EvtGen's dependencies, for example in an LCG release, you can build only the EvtGen package, which is rather more straightforward. This procedure is described in the rest of this section.

Build EvtGen against an existing installation of its dependencies

To build the EvtGen code, first make sure that there is a valid (C++) version of HepMC available. HepMC is used to store particle information. We now recommend using HepMC3 but support for HepMC2 continues to be available.

Optionally, it is possible to use other external generators, such as Pythia8 (for Pythia decays in the DECAY.DEC file, for example), Photos (for radiative corrections) and Tauola (for tau decays):

All of these packages are installed in the LCG releases and also have instructions for building them if you wish to use a different version.

For HepMC3 support the following versions are required:

  • Pythia8: 8.201 or newer
  • Photos: 3.64 or newer
  • Tauola: 1.1.8 or newer
For example, LCG_98 and LCG_98python3 contain the following versions:
  • Pythia8: 8.244
  • Photos: 3.64
  • Tauola: 1.1.8

Once you have installations of these packages available, build the EvtGen release by creating a build directory alongside the EvtGen source directory (assumed here to be called evtgen.git) and running:

cmake ../evtgen.git <options>
within the EvtGen build directory, using the following options:
  -DCMAKE_INSTALL_PREFIX=<location> : Location in which to install EvtGen (highly recommended)

  -DEVTGEN_HEPMC3=ON                : Enable HepMC3 support (default)
                                      To use HepMC2, set this to OFF instead.

  -DHEPMC3_ROOT_DIR=<location>      : Location of HepMC3 install directory
                                      While linking with either HepMC2 or HepMC3 is mandatory,
                                      depending on your environment the installation may be
                                      detected automatically.  Failing this, you can specify
                                      the location via this option.

  -DHEPMC2_ROOT_DIR=<location>      : Location of HepMC2 install directory
                                      While linking with either HepMC2 or HepMC3 is mandatory,
                                      depending on your environment the installation may be
                                      detected automatically.  Failing this, you can specify
                                      the location via this option.

  -DEVTGEN_PYTHIA=ON                : Enable linking with Pythia 8 (OFF by default)

  -DPYTHIA8_ROOT_DIR=<location>     : Location of Pythia8 install directory
                                      As with HepMC this may be automatically detected
                                      depending on your build environment, otherwise the
                                      location can be specified via this option.

  -DEVTGEN_PHOTOS=ON                : Enable linking with Photos++ (OFF by default)

  -DPhotos++_ROOT_DIR=<location>
  or
  -DPHOTOSPP_ROOT_DIR=<location>    : Location of Photos++ install directory
                                      As with HepMC this may be automatically detected
                                      depending on your build environment, otherwise the
                                      location can be specified via this option.

  -DEVTGEN_TAUOLA=ON                : Enable linking with Tauola++ (OFF by default)

  -DTauola++_ROOT_DIR=<location>
  or
  -DTAUOLAPP_ROOT_DIR=<location>    : Location of Tauola++ install directory
                                      As with HepMC this may be automatically detected
                                      depending on your build environment, otherwise the
                                      location can be specified via this option.

  -DEVTGEN_BUILD_DOC=ON             : Enable building documentation in 'doc' directory (OFF by default)

  -DEVTGEN_BUILD_TESTS=ON           : Enable building executables in 'test' directory (OFF by default)

  -DEVTGEN_BUILD_VALIDATIONS=ON     : Enable building executables in 'validation' directory (OFF by default)
When building against an LCG release it should not be necessary to manually specify the various ROOT_DIR variables.

Then compile and (optionally, although highly recommended) install the EvtGen code using

make
make install

This should create the libraries libEvtGen.so and libEvtGenExternal.so, as well as the archives libEvtGen.a and libEvtGenExternal.a (the "EvtGenExternal" library/archive will not be created if linking is not enabled for any of the external generators).

A series of validation and test executables are also created (if the appropriate option is enabled).

The build/install will also create CMake config files that allow the library targets to be easily imported into other projects.

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