Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions 2-gen-and-fastsim/2-1-event-generation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ which mg5_aMC
## Hands-on case study: ditau events with Pythia8, Whizard and KKMCee

In this section we describe, with exercises, the generation of an equivalent sample of Monte Carlo events with three diffent generators: `Pythia8`, `Whizard` and `KKMCee`. The process chosen is $e^{-}e^{+} \rightarrow \tau^{-}\tau^{+}$
(hereafter referred to as _ditaus_), with both _taus_ decaying leptonically with a _muon_ in the final state. The centre of mass energy of 91.2 GeV. In the three cases 10000 will be generated and saved in `ROOT` files in `EDM4hep` format: the steps to arrive at this results are however different.
(hereafter referred to as _ditaus_), with both _taus_ decaying leptonically with a _muon_ in the final state. The centre of mass energy of 91.2 GeV. Each workflow produces an EDM4hep ROOT file. The Pythia8 and KKMCee examples use 10,000 events, and the Whizard example uses a 10-event sample.

### Generating ditaus with Pythia8

Expand Down Expand Up @@ -824,13 +824,18 @@ i.e. 1458.0 +- 7.7 pb.

As explained in the dedicated [Whizard section](#whizard), to use `whizard` we need a `Sindarin` configuration file. To generate ditau events we will use the file
[Z_tautau.sin](https://fccsw.web.cern.ch/tutorials/apr2023/tutorial1/Z_tautau.sin):

<!-- ci-fragment: whizard-ditau -->
```bash
wget https://fccsw.web.cern.ch/tutorials/apr2023/tutorial1/Z_tautau.sin
```
and run it in a dedicate directory to not pollute the working one with the many files produced:
Run it in a dedicated directory to keep the generated files together. The downloaded
card generates 10 events, which is enough to exercise the conversion.

<!-- ci-fragment: whizard-ditau -->
```bash
mkdir -p whizard; cd whizard;
whizard ../Z_tautau.sin
mkdir -p whizard
(cd whizard && whizard ../Z_tautau.sin)
```
The output created by `whizard` is `LHEf` (Les Houches Event format); this is because the current build does not support writing `HepMC`; this may change in the future.

Expand All @@ -851,18 +856,21 @@ In order to get the events in `EDM4hep` format, we exploit the fact that
`Pythia` provides `LHEf` reader functionality. To activate that we will use
`Gaudi` and a special `.cmd` file which considers the input `LHEf` input file as
a `Beam`. This special `.cmd` is called `p8_lhereader.cmd` and it is available
on the web:
on the web. Download the card and the same Pythia8 steering used above:

<!-- ci-fragment: whizard-ditau -->
```bash
cd ../cards
wget https://fccsw.web.cern.ch/tutorials/apr2023/tutorial1/p8_lhereader.cmd
mkdir -p cards config gen/wz_tautau_ecm91
wget -O cards/p8_lhereader.cmd https://fccsw.web.cern.ch/tutorials/apr2023/tutorial1/p8_lhereader.cmd
wget -O config/pythia.py https://raw.githubusercontent.com/HEP-FCC/k4Gen/main/k4Gen/options/pythia.py
```
Please note the lines
```
! 4) Read-in Les Houches Event file - alternative beam and process selection.
Beams:frameType = 4 ! read info from a LHEF
Beams:LHEF = z_tautau.lhe ! the LHEF to read from
```
This file needs to be edited to enter the exact locaton of the input file (it could also be a symlink to avoid always editng the file.
Run the conversion from the `whizard` directory so Pythia8 finds `z_tautau.lhe` at the relative path in the card.

Also note the lines:
```
Expand All @@ -879,9 +887,10 @@ As steering we will use the file `pythia.py`.
:::{admonition} Answer
:class: solution toggle

<!-- ci-fragment: whizard-ditau -->
```bash
cd whizard
k4run ../config/pythia.py -n 10000 --out.filename ../gen/wz_tautau_ecm91/events_1.root --Pythia8.PythiaInterface.pythiacard ../cards/p8_lhereader.cmd | tee wz_ee_Ztautau_mumu_ecm91.log
k4run ../config/pythia.py -n 10 --IOSvc.Output ../gen/wz_tautau_ecm91/events_1.root --Pythia8.PythiaInterface.pythiacard ../cards/p8_lhereader.cmd | tee wz_ee_Ztautau_mumu_ecm91.log
```
:::

Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ endfunction()

add_fragment_test("2-gen-and-fastsim/2-1-event-generation/README" pythia8
--validate p8_mumu_500.e4h.root:500)

add_fragment_test("2-gen-and-fastsim/2-1-event-generation/README" whizard-ditau
--validate gen/wz_tautau_ecm91/events_1.root:10)
Loading