# Prerequisites of the Herwig program¶

The Herwig program is a large framework which incorporates many third party libraries. If you are Using the Herwig bootstrap script you do not need to take care of the installation of these packages. However, it may be that you want to install some of these packages manually or have them already installed on your machine. To make sure that Herwig works correctly make sure that all installations are performed with parameters such as outlined below.

We start with the numerical tools underlying Herwig. In the second section we describe the the different tools Herwig uses to compute the matrix elements.

Note: If you have already running ThePEG or Herwig++ installations on your system, make sure that while installing the programs no leftovers of these are present in your LD_LIBRARY_PATH.

We assume that all the packages are to be installed in a common location specified by the environment variable INSTALL_LOC which can be set using

export INSTALL_LOC=/where/to/install/the/packages


## Tools¶

### BOOST¶

Boost is a collection of widely used C++ libraries and headers for numerical computation. However, the Boost package will only work with Herwig if installed with --layout=tagged and the libraries are installed. To have only the headers (e.g. Rivet’s default) is not enough. This means your Boost installation should look similar to the following (use the --with-python if you also like to use Boost libraries within python code)

cd /where/to/build/boost
tar -xvf boost_1_62_0.tar.gz
cd boost_1_62_0
./bootstrap.sh --prefix=$INSTALL_LOC --with-python=$(which python)
./b2 install --layout=tagged


Note: without this tag wrong BOOST installs might get linked against the build, which leads to an error during make.

Note: this is not necessary if you are Using the Herwig bootstrap script.

Note: the above BOOST version is the most current one at the time of writing. You may find newer versions and additional information on the BOOST web-page.

### RIVET¶

RIVET is a standardized HEP analysis tool. A thorough installation guide can be found on the Rivet web-page. However, make sure to NOT install BOOST with RIVET as this will not work for Herwig. Using the rivet-bootstrap this means your installation might look like

make -j$(nproc) make check make install  Note: the above FastJet version is the most current one at the time of writing. You might find newer versions and additional information on the FastJet web-page. #### LHAPDF¶ LHAPDF is a HEP tool to compute and interface the parton density functions. A local installation might look like cd /where/to/build/lhapdf wget "http://www.hepforge.org/archive/lhapdf/LHAPDF-6.1.6.tar.gz" tar -xvf LHAPDF-6.1.6.tar.gz cd LHAPDF-6.1.6 ./configure --prefix=$INSTALL_LOC --with-boost=$INSTALL_LOC make -j$(nproc)
make check
make install


The pdf sets themselves have to be installed manually with lhapdf install <PDFSET>. As Herwig is using the MMHT 2014 PDF sets by default it is a good idea to install these using

lhapdf install MMHT2014nlo68cl
lhapdf install MMHT2014lo68cl


Note: the above LHAPDF version is the most current one at the time of writing. You may find newer versions and additional information on the LHAPDF web-page.

### ThePEG¶

ThePEG is the standardized event generator frame work Herwig relies on. Therefore, it has mostly the same prerequisites as Herwig itself. In addition it provides the interface to the parton density functions (pdf’s) via the LHAPDF tool. The code can be downloaded using

wget "http://www.hepforge.org/archive/thepeg/ThePEG-2.1.0.tar.bz2"
tar xjf ThePEG-2.1.0.tar.bz2


Alternatively advanced users may wish to checkout the code from the Mercurial repository

The code can then be configured and built

 cd ThePEG-2.1.0
./configure --prefix=$INSTALL_LOC --with-fastjet=$INSTALL_LOC \
--with-gsl=$INSTALL_LOC --with-rivet=$INSTALL_LOC \
--with-hepmc=$INSTALL_LOC --with-lhapdf=$INSTALL_LOC \
--with-boost=$INSTALL_LOC make -j$(nproc)
make check
make install


## External amplitude providers¶

You do not need to install any of these packages for Herwig to work for simple processes. However, for more complicated processes we would recommend installing at least Madgraph and one of the general one-loop programs.

### GoSam¶

GoSam is a general package for the calculation of tree-level and one-loop amplitudes. It can be installed by first downloading the GoSam installer and then running it. It is advisable to do this in a new directory

mkdir gosam
cd gosam
wget "http://gosam.hepforge.org/gosam_installer.py"
chmod 0755 ./gosam_installer.py
make -s install


### PHOTOS¶

The PHOTOS program simulates the QED radiation in decays, it is only used by EvtGen. It can be downloaded and installed using

wget "http://photospp.web.cern.ch/photospp/resources/PHOTOS.3.61/PHOTOS.3.61.tar.gz"
tar xzf PHOTOS.3.61.tar.gz
cd PHOTOS
./configure --prefix=$INSTALL_LOC --with-hepmc=$INSTALL_LOC
make -s install


### EvtGen¶

The EvtGen decay package can be used to perform the decays of, in particular bottom, hadrons. It can be downloaded and installed using

wget "http://evtgen.warwick.ac.uk/static/srcrep/R01-06-00/EvtGen.R01-06-00.tar.gz"
tar xzf EvtGen.R01-06-00.tar.gz
cd EvtGen/R01-06-00
./configure --prefix=$INSTALL_LOC --prefix=$INSTALL_LOC --hepmcdir=$INSTALL_LOC \ --tauoladir=$INSTALL_LOC --photosdir=$INSTALL_LOC --pythiadir=$INSTALL_LOC
make -s -j\$(nproc)
make -s install