"Did you select the **Herwig server**? If not, shut down this instance and start a new one selecting the Herwig server!\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
...
...
%% Cell type:markdown id: tags:
# Event Generation with Herwig7
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Note:</strong>
Did you select the **Herwig server**? If not, shut down this instance and start a new one selecting the Herwig server!
</div>
%% Cell type:markdown id: tags:
## 1. Getting Started
%% Cell type:markdown id: tags:
### Preparations
For this exercise you will need to execute the commands in a terminal. For this: click on `File` on top left, then select `New` and finally select `Terminal` to open a terminal next to this notebook.
After having opened the terminal, access the folder for this exercise:
```
cd TP1_forStudents/Exercise08
```
Confirm you are in the correct folder by executing `ls`: you should see few files including this notebook, `Exercise08.ipynb`.vents.vents.
%% Cell type:markdown id: tags:
Then to set the environment for running Herwig, execute:
```
source /herwig/bin/activate
```
Type `Herwig --help` to see the execution options for Herwig:
Herwig is a multi-purpose Monte-Carlo event generator for particle physics. See
arXiv:0803.0883 for a detailed manual, or arXiv:1101.2599 for a more general
description of the physics behind MC event generation.
[...]
```
%% Cell type:markdown id: tags:
You are now ready to start generating your first events.
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Note:</strong>
Whenever you are asked to run a command in the terminal, please copy the output here in a notebook cell!
</div>
%% Cell type:markdown id: tags:
### Getting Familiar
Open the inputfile for this exercise `LHC-Matchbox.in` and have a look at the last line
```
saverun <YOUR_GENERATOR_NAME> EventGenerator
```
%% Cell type:markdown id: tags:
This defines your `EventGenerator` object with the identifier `<YOUR_GENERATOR_NAME>` composed of the many module objects defined and configured above.
Set `<YOUR_GENERATOR_NAME>` to a unique string, so you will be able to identify your generator later on.
You do not have to understand each configurable module in the file in detail, but you will need to adjust some of them for this exercise.
For example, to adjust the center-of-mass energy of the collision and the type of process, you need to change the lines 18 and 39, respectively, in your input file to
```
set EventHandler:LuminosityFunction:Energy 13000*GeV
[...]
do Factory:Process p p -> mu+ mu-
```
to generate $pp \rightarrow \mu^+ \mu^-$ events at $13\,\mathrm{GeV}$ center-of-mass energy as produced for example at the LHC.
%% Cell type:markdown id: tags:
To start your first generation of events execute the following:
```
Herwig read LHC-Matchbox.in
```
in your Bash shell. This will read in your input file, build and compile all modules with your chosen configurations and produce a few outputs. The read step will usually take a while.
%% Cell type:raw id: tags:
--> Your output
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 1.1:</strong>
How many Feynman diagrams are contributing at leading order (LO) perturbation theory?
Why is there no top quark involved?
</div>
**Hint**: Have a look at the output generated by the `Herwig read` step and divide this number by a factor of two.
**Cheat**: Open the `<YOUR_GENERATOR_NAME>.out` file **after** you generated a few events with the `Herwig run` command below for another hint in case you need it.
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 1.2:</strong>
Explicitly draw the diagrams.
</div>
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
Until now the preparations should have been finished and you should have now a new directory `Herwig-cache` and a `<YOUR_GENERATOR_NAME>.run` file in your working directory.
Use them to generate 10 events of the process $pp \rightarrow \mu^+ \mu^-$ at a center-of-mass energy of 13TeV events by executing:
```
Herwig run LHC-Matchbox.run -N 10
```
%% Cell type:raw id: tags:
--> Your output
%% Cell type:markdown id: tags:
**Note**: By default each `Herwig run` will use the same seed for the random number generator, i.e., subsequent excecution of the same `.run` file will produce the exact same events. You can add the option `--seed=<ARBITRARY_INT_NUMBER>` to ensure that you use different random seeds in different runs.
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 1.3:</strong>
What is the LO cross-section of this process and its uncertainty? Does the cross-section change if you change the random seed?
</div>
**Hint**: Again, look at the output of the `Herwig run` command.
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 1.4:</strong>
What is the LO cross-section of this process and its uncertainty if you generate 10000 events? What's the difference compared to the generation of 10 events?
</div>
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
## 2. Understanding the Event History
%% Cell type:markdown id: tags:
Now let's try to understand, what is generated. When the generation is finished, a
```
<YOUR_GENERATOR_NAME>-Plot-1.dot
```
file was produced in your working directory.
Use this to generate a graphical representation of your first generated event by executing:
Open now the resulting `plot.png` file (rightklick in the file browser to open it in a new browser tab, will give you a nicer layout to observe the plot) to see the whole history of this particular event.
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 2.1:</strong>
Find the colliding particles and required collision products you've specified above ($pp \rightarrow \mu^+ \mu^-$).
</div>
**Hint**: The time direction in the plot goes from left to right. You can also search with `CTRL + F` for the particles of interest if it is opened in a new tab and you created a `.svg` file instead of `.png`.
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
Let's try to deconstruct the whole event generation by switching-off certain parts of the simulation.
For simple changes in the configuration of the modules, which do not influence the calculation of the hard scattering transition matrix element (amplitude squared) Herwig allows to use a short cut, skipping the necessity of rerunning the `Herwig read` step by using a setupfile.
In the provided setupfile `setupfile.txt` you have all necessary switches already set to switch-off all generation steps except for the hard scattering process you have defined above in the input file. To re-enable a step you can simply comment out the corresponding line. It will be sufficient to generate only a few events for this purpose, as this will save you a lot of processing time.
Generate some events executing:
```
Herwig run LHC-Matchbox.run --setupfile=setupfile.txt -N 10
```
with options as defined in the setupfile `<YOUR_SETUP_FILE>`. The generated outputs will automatically include the string `<YOUR_SETUP_FILE>` in the name, which simplifies to distinguish between the separate runs.
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 2.2:</strong>
Plot the event history for five different scenarios and save them:
* for all switches off,
* only the `CascadeHandler` (for parton shower) turned on,
* additionally the `HadronizationHandler` (for Hadronization) turned on,
*`CascadeHandler` and `HadronizationHandler` and `DecayHandler` (for Hadron-decays) turned on,
* and the full simulation with all switches on (including the `MPIHandler` for Underlying-Event generation). (**Hint**: You already generated this.)
Hence, you will get an incremental representation of an event for each additional generation step.
</div>
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 2.3:</strong>
Compare the plots. What do you observe? Why are some arrows black, others colored?
Recall what you learned in the lecture about **parton shower (PS)**, **Hadronization** and **Underlying Event (UE)**. What would be different at an $e^+$-$e^-$-collider like for example LEP? Try to rerun Herwig with the provided **LEP-Matchbox.in** as input to generate events like they would occurr at the LEP-Collider. Compare the event representation with the full simulation of the LHC event.)
</div>
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 2.4:</strong>
Briefly explain Asymptotic Freedom and Confinement and how they motivate the observed event generation chain
</div>
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
## 3. Generating at NLO Perturbation Theory
%% Cell type:markdown id: tags:
Try to improve on the description of measured data by running a generation at next-to-leading order (NLO) in perturbative QCD.
In the file `LHC-Matchbox.in`, uncomment line 101 (`read Matchbox/MCatNLO-DefaultShower.in`) and comment line 104 (`read Matchbox/MCatLO-DefaultShower.in`) to set the ME generation to NLO QCD.
To prevent overwriting your previous generated outputs, set `<YOUR_GENERATOR_NAME>` in line 151 to a new value. We need both the LO and NLO simulation later in the exercise.
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 3.1:</strong>
Rerun the `Herwig read` and `Herwig run` steps to generate another ten thousand events at NLO perturbative QCD.
</div>
%% Cell type:raw id: tags:
--> Your output
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 3.2:</strong>
How many subprocesses have to be calculated for the NLO generation? What are the corresponding Feynman diagrams?
</div>
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 3.3:</strong>
What is the NLO cross-section for this process?
</div>
%% Cell type:markdown id: tags:
--> Your answer
%% Cell type:markdown id: tags:
<divclass="alert alert-info">
<strong>Question 3.4:</strong>
How one could improve further the cross section calculation? Is it realistically achieveable?