Phriction HEPForge Herwig Tutorial Second run: Z production and jets at the LHC History Version 15 vs 39
Version 15 vs 39
Version 15 vs 39
Content Changes
Content Changes
This is the simulation of a P + P -> Z+jet production event at the LHC for 7 TeV center-of-mass energy, using the [[ https://rivet.hepforge.org/analyses/ATLAS_2011_I945498.html | ATLAS_2011_I945498 ]] and [[ https://rivet.hepforge.org/analyses/MC_ZINC.html | MC_ZINC ]] Rivet plugins for data analysis.
Please download the following input file and move it to your work directory:
Input file:
{F543471}
Alternatively, you can use the following command-line codes:
```
mkdir LHC-dijet
cd LHC-dijet
wget https://phab-files.hepforge.org/file/data/n36vm5xhxosaddw7xe4x/PHID-FILE-etk5vfa3ii64fngxon2w/LHC-Z_jet.in
```
and run the dijet event, using
```
Herwig read LHC-dijet.in
```
You should see an error message appearing on your console
```
Error: MatchboxFactory: No matrix elements have been found.
Please check if your order of Alpha_s and Alpha_ew have the right value.
```
This indicated that the Matchbox does not contain this specific process and you must use either an external matrix element (ME) provider or a [[ https://phab.hepforge.org/w/mcnet2019/leshouches/ | Les Houches input file ]]. Let us consider the former option at the moment. We will return to the Les Houches case later.
There is a section in the input files for choosing the possible external ME providers:
```
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
```
Please uncomment the "read Matchbox/MadGraph-OpenLoops.in" option. This would tell the event handler to use MadGraph and OpenLoops for the tree-level and one-loop MEs, respectively. You can see that there are a number of different options to choose from, based on the event that you want to simulate.
Now you are in a position to run your event correctly, using an external ME provider. This process may take several minutes to complete, based on the number of channels involved in the event. You can reduce the run time by changing the shower selection options:
```
##################################################
## Matching and shower selection
##################################################
read Matchbox/MCatNLO-DefaultShower.in
# read Matchbox/Powheg-DefaultShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DefaultShower.in
## use for improved LO showering
# read Matchbox/LO-DefaultShower.in
# read Matchbox/MCatNLO-DipoleShower.in
# read Matchbox/Powheg-DipoleShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DipoleShower.in
## use for improved LO showering
# read Matchbox/LO-DipoleShower.in
# read Matchbox/NLO-NoShower.in
# read Matchbox/LO-NoShower.in
```
The "read Matchbox/MCatNLO-DefaultShower.in" option is chosen by default, activating an MC@NLO matched angular ordered parton shower. Please choose the "read Matchbox/MCatLO-DefaultShower.in" option, to speed up the process with the price of lowering the accuracy.
Now, you can try running the event again:
```
Herwig read LHC-dijet.in
```
You will see a message, informing you that the external ME provider is engaged and will create a parton level amplitude for you:
```
Initializing external amplitudes.
>>> Compiling MadGraph amplitudes. This may take some time -- please be patient.
>>> In case of problems see ./Herwig-scratch/Build/MadGraphAmplitudes/MG.log for details.
```
After the "read" command is completed, you can run the event by:
```
Herwig run LHC-dijet.run -N 10000
```
and plot the results by
```
rivet-mkhtml LHC-dijet.yoda
```
Now, rename the yoda file with
```
mv LHC-dijet.yoda LHC-dijet-AO.yoda
```
and then, switch from "read Matchbox/MCatLO-DefaultShower.in" to "read Matchbox/MCatLO-DipoleShower.in" for your shower option. This would change the default angular ordered parton shower to a dipole parton shower.
Now, rerun the event with
```
rm -rf Herwig-scratch
Herwig read LHC-dijet.in
Herwig run LHC-dijet.run -N 10000
mv LHC-dijet.yoda LHC-dijet-Dipole.yoda
rivet-mkhtml LHC-dijet-AO.yoda:AO-shower LHC-dijet-Dipole.yoda:Dipole-shower
```
The first line is to delete the remnants of your previous ME calculation, which was stored in the "Herwig-scratch" folder inside your work directory.
You can check out your result by
```
firefox rivet-plots/index.html
```
Switching things on and off
-------------------------------
At this point, we are going to modify our copy of the LHC-dijet.in input file and make a few more runs.
1. [[ https://herwig.hepforge.org/tutorials/gettingstarted/onoffthings.html | Shower handlers ]]
These commands control the major modules of the event generator. You can switch them on and off, rerun the event and observe the produced effects of the results.
```
##################################################
## ShowerHandler(s)
##################################################
cd /Herwig/EventHandlers
# set EventHandler:CascadeHandler:MPIHandler NULL
# set EventHandler:DecayHandler NULL
# set EventHandler:HadronizationHandler NULL
# set EventHandler:CascadeHandler NULL
```
2. [[ https://herwig.hepforge.org/tutorials/hardprocess/matchbox.html#scale-choices | Scale choices ]]
Your choice for the scale of the hard-process is made in this section. The primary option for a dijet production event, "set Factory:ScaleChoice Scales/HTScale", is pre-selected here. You can choose other options and see the effect.
```
cd /Herwig/MatrixElements/Matchbox/
# set Factory:ScaleChoice Scales/FixedScale
# set Scales/FixedScale:FixedScale 91.1876*GeV
set Factory:ScaleChoice Scales/HTScale
# set Factory:ScaleChoice Scales/HTPrimeScale
# set Factory:ScaleChoice Scales/LeptonPairMassScale
# set Factory:ScaleChoice Scales/LeptonPairPtScale
# set Factory:ScaleChoice Scales/MaxJetPtScale
# set Factory:ScaleChoice Scales/SHatScale
# set Factory:ScaleChoice Scales/TopPairMassScale
# set Factory:ScaleChoice Scales/TopMTScale
```
3. [[ https://herwig.hepforge.org/tutorials/hardprocess/matchbox.html#cuts | Cuts ]]
You can impose any constraint that you want on your event. To find out the compete list of cuts and how to use them, see Herwig documentaion on [[ https://herwig.hepforge.org/tutorials/hardprocess/matchbox.html#cuts | cuts ]].
```
##################################################
## Cut selection
## See the documentation for more options
##################################################
cd /Herwig/Cuts/
## cuts on jets
read Matchbox/DefaultPPJets.in
insert JetCuts:JetRegions 0 FirstJet
insert JetCuts:JetRegions 1 SecondJet
# set /Herwig/Cuts/JetFinder:Variant Kt
# set /Herwig/Cuts/JetFinder:ConeRadius 0.4
# set /Herwig/Cuts/FirstJet:PtMin 20.*GeV
# do /Herwig/Cuts/FirstJet:YRange -5.0 5.0
```
In this section, we will simulate the 'P + P -> Z+X' process at 7 TeV center-of-mass energy and study the properties of the Z-boson with the help of the [[https://rivet.hepforge.org/analyses/MC_ZINC.html | MC_ZINC ]] Rivet analysis.
There are different stages of event generation, each of which plays a crucial role in the correct simulation of Z-bosons at the LHC:
* Hard matrix element
* Parton Shower
* Initial and final state radiation
* Multiple parton interactions
* Hadronizaion
During this exercise, we will see the different contributions to the Z shape observables, like the Z pT spectrum.
Download the following input file and move it to your work directory:
Input file:{F545117}
Alternatively, you can use the following command-line code:
```
wget https://phab-files.hepforge.org/file/download/q5by5q5tocxpquklfi34/PHID-FILE-ekoleb6f3inpmsz6xmbl/LHC-Matchbox.in
```
The input file can be used for Z production and Z+Jets production. For now, all parts except for the hard matrix element are commented out. We will uncomment the necessary parts as we progress with the exercise.
Run the input file without any modifications
```
Herwig read LHC-Matchbox.in
Herwig run LHC-Matchbox.run -N 10000
```
It is recommended to change the name of the newly created .yoda file to something meaningful after every new run s.t. you don't have to repeat runs in the end when we compare them with each other.
```
mv LHC-Matchbox.yoda LHC-noShower.yoda
```
Now plot the results with
```
rivet-mkhtml LHC-noShower.yoda
```
Have a look at the produced histograms and try to explain why there is no Z pT and why in the peak region Z pT is just a delta function. You should also have a look at the .log file and understand the first few events.
To have a more realistic simulation of the Z-boson, we uncomment some sections in the input file. Include the LO Parton shower BUT without initial and final state radiations.
The relevant section in the input file should look like this:
```
##################################################
## ShowerHandler(s)
##################################################
# Initial and final state radiation
set /Herwig/Shower/ShowerHandler:DoFSR No
set /Herwig/Shower/ShowerHandler:DoISR No
cd /Herwig/EventHandlers
#set EventHandler:CascadeHandler NULL
set EventHandler:CascadeHandler:MPIHandler NULL # switches off multi parton interactions
set EventHandler:DecayHandler NULL # switches off particle decays
set EventHandler:HadronizationHandler NULL # switches off hadronization
```
Now activate initial and final state radiation and repeat the run.
```
set /Herwig/Shower/ShowerHandler:DoFSR Yes
set /Herwig/Shower/ShowerHandler:DoISR Yes
```
Compare your results with the first run. Why do pT spectra change but the reconstructed mass of the Z boson looks roughly the same?
For the next task, we use a parton shower matched to NLO. Look at the parton shower selection section from the input file
```
##################################################
## Matching and shower selection
##################################################
#read Matchbox/MCatNLO-DefaultShower.in
# read Matchbox/Powheg-DefaultShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DefaultShower.in
## use for improved LO showering
read Matchbox/LO-DefaultShower.in
# read Matchbox/MCatNLO-DipoleShower.in
# read Matchbox/Powheg-DipoleShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DipoleShower.in
## use for improved LO showering
# read Matchbox/LO-DipoleShower.in
# read Matchbox/NLO-NoShower.in
# read Matchbox/LO-NoShower.in
```
In the input file, we choose the "read Matchbox/LO-DefaultShower.in" option activating a LO angular ordered parton shower. Now choose the "read Matchbox/MCatNLO-DefaultShower.in" option, to activate the MC@NLO matched shower and run the event again.
By now, you should have created several .yoda files. You can compare the corresponding calculations with
```
rivet-mkhtml *.yoda
```
For the final task in this section, activate multiple parton interactions, decays and hadronization options by uncommenting the relevant lines in the input file and compare the LO and the NLO matched shower simulations.
You have finished all the main parts of the Herwig tutorial.
You can choose to [[https://herwig.hepforge.org/tutorials/gettingstarted/matrixelements.html#some-scale-variations | dive deeper]] into parton shower variations, play around with different cuts and scales
or continue with [[https://phab.hepforge.org/w/mcnet2019/thirdrun/ | Third run: minimum bias events and soft physics]].
==A note on matrix elements==
As you can see, the process selection section has been completely deactivated. This is because for a process like `P + P -> Z + X`, Herwig needs to use the external matrix element (ME) providers. However, the use of these tools in the docker/VM would be problematic due to some linking issues. In an installed (and properly linked) version of Herwig, one can easily use these external ME providers by selecting the hard-process in the `Process selection` and choosing the ME providers from the `Matrix element library selection`.
```
##################################################
## Process selection
##################################################
## Model assumptions
# read Matchbox/StandardModelLike.in
# read Matchbox/DiagonalCKM.in
## Set the order of the couplings
# cd /Herwig/MatrixElements/Matchbox
# set Factory:OrderInAlphaS 1
# set Factory:OrderInAlphaEW 1
## Select the process
# do Factory:Process p p -> Z0 j
##################################################
## Matrix element library selection
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# read Matchbox/MadGraph-OpenLoops.in
```
This is the simulation of a P + P -> Z+jet production event at the LHC for 7 TeV center-of-mass energyIn this section, using the [[ https://rivet.hepforge.org/analyses/ATLAS_2011_I945498.html | ATLAS_2011_I945498 ]] and [[ we will simulate the 'P + P -> Z+X' process at 7 TeV center-of-mass energy and study the properties of the Z-boson with the help of the [[https://rivet.hepforge.org/analyses/MC_ZINC.html | MC_ZINC ]] Rivet plugins for datat analysis.
Please download the following input file and move it to your work directory:
Input fileThere are different stages of event generation, each of which plays a crucial role in the correct simulation of Z-bosons at the LHC:
{F543471} * Hard matrix element
* Parton Shower
* Initial and final state radiation
* Multiple parton interactions
* Hadronizaion
AlternativelyDuring this exercise, we will see the different contributions to the Z shape observables, you can uslike the following command-line codes:Z pT spectrum.
```
mkdir LHC-dijetDownload the following input file and move it to your work directory:
cd LHC-dijetInput file:{F545117}
Alternatively, you can use the following command-line code:
```
wget https://phab-files.hepforge.org/file/data/n36vm5xhxosaddw7xe4xownload/q5by5q5tocxpquklfi34/PHID-FILE-etk5vfa3ii64fngxon2wkoleb6f3inpmsz6xmbl/LHC-Z_jetMatchbox.in
```
and run the dijet event,The input file can be used for Z production and Z+Jets production. For now, all parts except for the hard matrix element are commented out. usingWe will uncomment the necessary parts as we progress with the exercise.
Run the input file without any modifications
```
Herwig read LHC-dijetMatchbox.in
Herwig run LHC-Matchbox.run -N 10000
```
You should see an error message appearing on your console
It is recommended to change the name of the newly created .yoda file to something meaningful after every new run s.t. you don't have to repeat runs in the end when we compare them with each other.
```
Error: mv LHC-MatchboxFactory: No matrix elements have been found..yoda LHC-noShower.yoda
```
Please check if your order of Alpha_s and Alpha_ew have the right value.Now plot the results with
```
rivet-mkhtml LHC-noShower.yoda
```
Have a look at the produced histograms and try to explain why there is no Z pT and why in the peak region Z pT is just a delta function. You should also have a look at the .log file and understand the first few events.
This indicated that the Matchbox does not contain this specific process and you must use either an external matrix element (ME) provider or a [[ https://phab.hepforge.org/w/mcnet2019/leshouches/ | Les Houches input file ]].o have a more realistic simulation of the Z-boson, Let us consider the former opwe uncomment some section ats in the momentinput file. We will return to the Les Houches case later.
There is a section in the input files for choosing the possible external ME providers:Include the LO Parton shower BUT without initial and final state radiations.
The relevant section in the input file should look like this:
```
##################################################
## Matrix element library selection## ShowerHandler(s)
##################################################
## Select a generic tree/loop combination or a
## specialized NLO package
# read Matchbox/MadGraph-GoSam.in
# Initial and final state radiation
# read Matchbox/MadGraph-MadGraph.inset /Herwig/Shower/ShowerHandler:DoFSR No
# read Matchbox/MadGraph-NJet.inset /Herwig/Shower/ShowerHandler:DoISR No
# read Matchbox/MadGraph-OpenLoops.in
cd /Herwig/EventHandlers
```#set EventHandler:CascadeHandler NULL
Please uncomment the "read Matchbox/MadGraph-OpenLoops.in" option. This would tell the event handler to use MadGraph and OpenLoops for the tree-level and one-loop MEs, respectively. You can see that there are a number of different options to choose from, based on the event that you want to simulateset EventHandler:CascadeHandler:MPIHandler NULL # switches off multi parton interactions
set EventHandler:DecayHandler NULL # switches off particle decays
set EventHandler:HadronizationHandler NULL # switches off hadronization
```
Now activate initial and final state radiation and repeat the run.
Now you are in a position to run your event correctly, using an external ME provider. This process may take several minutes to complete, based on the number of channels involved in the event. You can reduce the run time by changing the shower selection options:```
set /Herwig/Shower/ShowerHandler:DoFSR Yes
set /Herwig/Shower/ShowerHandler:DoISR Yes
```
Compare your results with the first run. Why do pT spectra change but the reconstructed mass of the Z boson looks roughly the same?
For the next task, we use a parton shower matched to NLO. Look at the parton shower selection section from the input file
```
##################################################
## Matching and shower selection
##################################################
#read Matchbox/MCatNLO-DefaultShower.in
# read Matchbox/Powheg-DefaultShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DefaultShower.in
## use for improved LO showering
# read Matchbox/LO-DefaultShower.in
# read Matchbox/MCatNLO-DipoleShower.in
# read Matchbox/Powheg-DipoleShower.in
## use for strict LO/NLO comparisons
# read Matchbox/MCatLO-DipoleShower.in
## use for improved LO showering
# read Matchbox/LO-DipoleShower.in
# read Matchbox/NLO-NoShower.in
# read Matchbox/LO-NoShower.in
```
The "read Matchbox/MCatNLO-DefaultShower.in" option is chosen by default, activating an MC@NLO matched angular ordered parton shower.In the input file, Pleaswe choose the "read Matchbox/MCatLO-DefaultShower.in" option,tion activating a LO angular ordered parton shower. to speed upNow choose the process with the price of lowering the accuracy.
Now"read Matchbox/MCatNLO-DefaultShower.in" option, you can try runningto activate the MC@NLO matched shower and run the event again:.
```
Herwig read LHC-dijet.inBy now, you should have created several .yoda files. You can compare the corresponding calculations with
```
You will see a message, informing you that the external ME provider is engaged and will create a parton level amplitude for you:
```
Initializing external amplitudes.
>>> Compiling MadGraph amplitudes. This may take some time -- please be patient.
>>> In case of problems see ./Herwig-scratch/Build/MadGraphAmplitudes/MG.log for details.rivet-mkhtml *.yoda
```
After the "read" command is completed, you can run the event by:
```
Herwig run LHC-dijet.run -N 10000
```For the final task in this section, activate multiple parton interactions, decays and hadronization options by uncommenting the relevant lines in the input file and compare the LO and the NLO matched shower simulations.
and plot the results by
```
rivet-mkhtml LHC-dijet.yoda
```
Now, rename the yoda file with
```
mv LHC-dijet.yoda LHC-dijet-AO.yoda
```
and then, switch from "read Matchbox/MCatLO-DefaultShower.in" to "read Matchbox/MCatLO-DipoleShower.in" for your shower option. This would change the default angular ordered parton shower to a dipole parton shower.
Now, rerun the event with
```
rm -rf Herwig-scratch
Herwig read LHC-dijet.in
Herwig run LHC-dijet.run -N 10000
mv LHC-dijet.yoda LHC-dijet-Dipole.yoda
rivet-mkhtml LHC-dijet-AO.yoda:AO-shower LHC-dijet-Dipole.yoda:Dipole-shower
```
The first line is to delete the remnants of your previous ME calculation, which was stored in the "Herwig-scratch" folder inside your work directory.
You can check out your result by
```
firefox rivet-plots/index.html
```
Switching things on and off
-------------------------------
At this pointYou have finished all the main parts of the Herwig tutorial.
You can choose to [[https://herwig.hepforge.org/tutorials/gettingstarted/matrixelements.html#some-scale-variations | dive deeper]] into parton shower variations, we are going to modify our copy of the LHC-dijet.in input file and make a few more runs.
1. [[ https://herwig.hepforge.org/tutorials/gettingstarted/onoffthings.html | Shower handlers ]]play around with different cuts and scales
or continue with [[https://phab.hepforge.org/w/mcnet2019/thirdrun/ | Third run: minimum bias events and soft physics]].
==A note on matrix elements==
These commands control the major modules of the event generator. You can switch them on and offAs you can see, the process selection section has been completely deactivated. This is because for a process like `P + P -> Z + X`, Herwig needs to use the external matrix element (ME) providers. However, the use of these tools in the docker/VM would be problematic due to some linking issues. In an installed (and properly linked) version of Herwig, rerun the event and observe the produced effects of the resultsone can easily use these external ME providers by selecting the hard-process in the `Process selection` and choosing the ME providers from the `Matrix element library selection`.
```
##################################################
## ShowerHandler(s)## Process selection
##################################################
cd /Herwig/EventHandlers## Model assumptions
# set EventHandler:CascadeHandler:MPIHandler NULL# read Matchbox/StandardModelLike.in
# set EventHandler:DecayHandler NULL
# set EventHandler:HadronizationHandler NULL
# set EventHandler:CascadeHandler NULL
```# read Matchbox/DiagonalCKM.in
2. [[ https://herwig.hepforge.org/tutorials/hardprocess/matchbox.html#scale-choices | Scale choices ]]## Set the order of the couplings
Your choice for the scale of the hard-process is made in this section. The primary option for a dijet production event, "set Factory:ScaleChoice Scales/HTScale", is pre-selected here. You can choose other options and see the effect.
```# cd /Herwig/MatrixElements/Matchbox
cd /Herwig/MatrixElements/Matchbox/
# set Factory:ScaleChoice Scales/FixedScaleOrderInAlphaS 1
# set Scales/FixedScale:FixedScale 91.1876*GeV
set Factory:ScaleChoice Scales/HTScaleOrderInAlphaEW 1
# set Factory:ScaleChoice Scales/HTPrimeScale
# set Factory:ScaleChoice Scales/LeptonPairMassScale
# set Factory:ScaleChoice Scales/LeptonPairPtScale
# set Factory:ScaleChoice Scales/MaxJetPtScale
# set Factory:ScaleChoice Scales/SHatScale
# set Factory:ScaleChoice Scales/TopPairMassScale
# set Factory:ScaleChoice Scales/TopMTScale
```# Select the process
3. [[ https://herwig.hepforge.org/tutorials/hardp# do Factory:Process/matchbox.html#cuts | Cuts ]] p p -> Z0 j
You can impose any constraint that you want on your event. To find out the compete list of cuts and how to use them, see Herwig documentaion on [[ https://herwig.hepforge.org/tutorials/hardprocess/matchbox.html#cuts | cuts ]].
```
##################################################
## Cut selection
## See the docu## Matrix elementation for more op library selections
##################################################
cd /Herwig/Cuts/
## cuts on jets
read Matchbox/DefaultPPJets.in
insert JetCuts:JetRegions 0 FirstJet## Select a generic tree/loop combination or a
insert JetCuts:JetRegions 1 SecondJet## specialized NLO package
# set /Herwig/Cuts/JetFinder:Variant Kt# read Matchbox/MadGraph-GoSam.in
# set /Herwig/Cuts/JetFinder:ConeRadius 0.4
# set /Herwig/Cuts/FirstJet:PtMin 20.*GeV# read Matchbox/MadGraph-MadGraph.in
# read Matchbox/MadGraph-NJet.in
# do /Herwig/Cuts/FirstJet:YRange -5.0 5.0# read Matchbox/MadGraph-OpenLoops.in
```