This tutorial teaches you the basics of the Monte Carlo Event Generator [[https://herwig.hepforge.org/ | Herwig]] 7]] Monte Carlo Event Generator. An installation of Herwig on your own device is not necessary if you use the provided Docker image (see below). An installation ofIf you plan to use Herwig onfor your own device is not necessary if you use the provided docker image (see next section).research, If you plan to use Herwig for your own researchplease follow the instructions provided under [[ https://phab.hepforge.org/w/herwigtutorial/installation/ | Installation ]] for a local build. **For the purpose of this tutorial, you do not need to install Herwig.**
In this tutorial, you will learn:
- How to simulatee generic LHC Events;
- How to combine Herwig with NLO Tools like MadGraph and OpenlLoops;
- 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 Hadronizsation 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 dDocker image for Herwig. This contains a working copy of Herwig's latest version, HewrHerwig-7.3.0, with ThePEG-2.3.0. If you have not already installed dDocker, please follow the instructions on the [[https://docs.docker.com/install/ | dDocker website]] and install dDocker on your device.
The required dDocker containers can be pulled directly from the [[https://hub.docker.com/ | dDocker hHub]] 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, we will use thise alias **DRH** to denote that you prefixrunning Herwig-7.3.0 from its Docker image.
If this works, you are ready to start the tutorial with [[ https://phab.hepforge.org/w/mcnet2019/firstrun/ | First run]]. 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 [[ https://gitlab.com/stefan-kiebacher/desy-terascale-herwig-tutorial | gitlab repository ]], which you can clone and follow the instructions.
**Instructions:**
# [[ https://phab.hepforge.org/w/herwigtutorial/installation/ | Installation ]]
# [[ https://phab.hepforge.org/w/herwigtutorial/firstrun/ | First run: Z production at the LHC]]
# [[ https://phab.hepforge.org/w/herwigtutorial/secondrun/ | Second run: NLO Z production at the LHC ]]
# [[ https://phab.hepforge.org/w/herwigtutorial/thirdrun/ | Third run: minimum bias events and soft physics ]]
# [[ https://phab.hepforge.org/w/herwigtutorial/leshouches/ | The Les Houches Event Handler ]]
# [[ https://phab.hepforge.org/w/herwigtutorial/photoninduced/ | Photon Induced Process in Herwig ]]
# [[ https://phab.hepforge.org/w/herwigtutorial/MCNetSchoolDurham2023 | W mass measurement project with Herwig (MC Net School Durham 2023) ]]
**Helpful literature**
[[ https://arxiv.org/abs/0803.0883 | Herwig manual ]]