Page MenuHomeHEPForge

Herwig Tutorial
Updated 275 Days AgoPublic

This tutorial teaches you the basics of the Monte Carlo Event Generator Herwig. An installation of Herwig on your own device is not necessary if you use the provided docker image (see next section). If you plan to use Herwig for your own research follow the instructions provided under Installation. For the purpose of this tutorial, you do not need to install Herwig.

In this tutorial you will learn:

How to simulate LEP events
How to simulate LHC events
How to include rivet analyses and compare a simulation with data
How to switch parts of the Event Generator on and off
How to modify parameters of the Parton shower and the Hadronization model
How to run LHE files in Herwig with its Les Houches Event Handler

Before you start: setting up Herwig's docker containers

All exercises within this tutorial can be done by using the provided docker image for Herwig. This contains a working copy of Herwig's latest version, Hewrig-7.3.0 with ThePEG-2.3.0. If you have not already installed docker, please follow the instructions on the docker website and install docker on your device.

The required docker containers can be pulled directly from the docker hub with

docker pull herwigcollaboration/herwig-7.3:7.3.0

Linux users will need to add sudo to the beginning of the above command.

In order to run Herwig, execute the following shell command

docker run -i --rm -u `id -u $USER`:`id -g` -v $PWD:$PWD -w $PWD herwigcollaboration/herwig-7.3:7.3.0 Herwig --help

This allows the container to access your local files and to write to the current working directory

Create an alias for the run command by editing the file ~/.bashrc on your local machine. Simply add the following line to the end of .bashrc

alias DRH='docker run -i --rm -u `id -u $USER`:`id -g` -v $PWD:$PWD -w $PWD herwigcollaboration/herwig-7.3:7.3.0'

To run Herwig execute

DRH Herwig

Similar commands like rivet-mkhtml can be run in the same fashion

DRH rivet-mkhtml

From here on if you use this alias note that you prefix

If this works, you are ready to start the tutorial with First run: LEP. If you encounter problems, please talk to a tutor.

For attendees of the McNet school

If you are interested in doing a Merging run, you can use the file LHC-W-Merging.in file, but this will take a long time for the integration step. For the sake of making more runs with more stats better use the LHC-W-Matching.in input file

For using the Rivet analysis: copy the MY_W_ANALYSIS.cc, MY_W_ANALYSIS.plot and MY_W_ANALYSIS.yoda.gz to the herwig directory and type make RivetMY_W_ANALYSIS.so to compile the analysis

For changing the W boson mass there is a snippet called MassW.in where you can change the value for the W+ and W- boson individually, so remember to change both masses to the same value to be consistent.

For parallelising the run steps :

DRH Herwig run LHC-W-Matching.run --jobs=N_CORES -N N_EVENTS
DRH rivet-merge -e LHC-W-Matching-*.yoda -o  LHC-W-Matching.yoda

For not doing the read step again do:

DRH Herwig run LHC-W-Matching.run --jobs=N_CORES -N N_EVENTS --setup=MassW.in
DRH rivet-merge -e LHC-W-Matching-*.yoda -o  LHC-W-Matching.yoda

For attendees of the DESY Terascale School

We prepared a gitlab repository, which you can clone and follow the instructions.

Instructions:

  1. Installation
  2. First run: LEP
  3. Second run: Z production and jets at the LHC
  4. Third run: minimum bias events and soft physics
  5. The Les Houches Event Handler
  6. Photon Induced Process in Herwig
  7. W mass measurement project with Herwig (MC Net School Durham 2023)

Helpful literature
Herwig manual

Last Author
stefan.kiebacher
Last Edited
Feb 19 2024, 12:50 PM

Event Timeline

admin changed the edit policy from "Administrators" to "Custom Policy".May 30 2023, 10:16 AM
aidin changed the edit policy from "Custom Policy" to "Restricted Project (Project)".Jul 5 2023, 4:02 PM
stefan.kiebacher edited the content of this document. (Show Details)
stefan.kiebacher published a new version of this document.
stefan.kiebacher edited the content of this document. (Show Details)
stefan.kiebacher edited the content of this document. (Show Details)
stefan.kiebacher edited the content of this document. (Show Details)
stefan.kiebacher edited the content of this document. (Show Details)
stefan.kiebacher edited the content of this document. (Show Details)