Skip to content
Merged
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
34 changes: 19 additions & 15 deletions _episodes/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ keypoints:

# Introduction and first steps

See this (old, but still useful) review of Monte Carlo event generators for some background: [link](https://arxiv.org/pdf/1304.6677.pdf).
See this (old, but still useful) review of Monte Carlo event generators for some background: [[link](https://arxiv.org/pdf/1304.6677.pdf)].
Monte Carlo event generators are essential components of almost all experimental analyses and are also widely used by theorists and experiments to make predictions and preparations for future experiments.
It is one of the topics where we CMS experimentalists and theorists have the closest connections to, theorists give us predictions and experimentalists verify them with the actual data.
Although Monte Carlo event generators are extremely important tools in HEP, they are often used as black boxes which we more or less treat them as "data".
Our aim is to get the minimal background of how these tools are working and analyze them using the generator level information.
It is one of the topics where we CMS experimentalists and theorists have the closest connections to each other -- theorists give us predictions and experimentalists verify them with the actual data.
Although Monte Carlo event generators are extremely important tools in HEP, they are often used as black boxes, whose output we more or less treat as "data".
Our aim is to get the some background on how these tools work and analyze some outputs using generator level information.

Samples that are used by CMS experiments go through several steps of simulation :
Samples that are used by CMS experiments go through several steps of simulation:
1. Monte Carlo event generator
2. Detector simulation
3. Pileup mixing
3. Detector digitization and pileup mixing
4. Trigger emulation
5. Object reconstruction

Expand All @@ -43,15 +43,15 @@ Parton shower & hadronization further describes how the particles involved in th

## Using Standalone Madgraph

In the first part of the exercise, we will use the matrix element generator MadGraph5 _aMC@NLO, or in short MadGraph [link](https://launchpad.net/mg5amcnlo).
Note that MadGraph is a "matrix element" generator, and not an event generator. MadGraph can calculate the hard scattering (large momentum transfer) partonic process at the core of an event, but, as noted above, this is only part of the story.
In the first part of the exercise, we will use the matrix element generator MadGraph5 _aMC@NLO, or "MadGraph" for short [[link](https://launchpad.net/mg5amcnlo)].
Note that MadGraph is a "matrix element" generator, represents only one step in the chain to a physically observable process. MadGraph can calculate the hard scattering (large momentum transfer) partonic process at the core of an event, but, as noted above, this is only part of the story.
MadGraph can perform the calculations for many different physics processes (both SM and BSM) at leading and next-to-leading order (LO & NLO) in QCD.
Because of its easy user interface and flexibility with UFO models (that let you define the theory you are interested in), you can test a wide variety of physics hypotheses.
We will first see how MadGraph runs interactively in standalone mode using simple `W+` (wplus) process as an example.
We will first see how MadGraph runs interactively in standalone mode using simple `w+` (wplus) process as an example.

We will first use the interactive prompt of MadGraph to generate proton proton collision events that produce W bosons.
First, log in to a new session on the LPC cluster (`ssh -Y <USERNAME>@cmslpc-el8.fnal.gov`).
Make sure you have completed the <a href="../setup.html">setup</a> steps!
(Make sure you have completed the <a href="../setup.html">setup</a> steps!)
Then, start the interactive prompt of Madgraph:
~~~bash
cd ~/nobackup/cmsdas_2026_gen/MG5_aMC_v3_5_2/
Expand Down Expand Up @@ -82,7 +82,7 @@ output wplustest_4f_LO -nojpeg
~~~
{: .output}

**Copy/paste the commands line-by-line and pay attention to the output.**
**Copy/paste the commands line-by-line and pay attention to the output. The lines starting with `#` are comments.**

The two most important lines of this block are the model import (`import model sm-ckm`) and the instructions on the process to generate (`generate p p > w+, w+ > ell+ vl`).
Within the MG directory you can find a directory `models`, that contains different pre-installed models.
Expand Down Expand Up @@ -166,6 +166,8 @@ DECAY 25 6.382339e-03 # WH
~~~
{: .output}

Close the current editor -- if you haven't explicitly changed your editor, you're likely in `vim`. In this case, you can exit with `:q`.

Let's take a look at the `run card` and see how the values are set, press `2` and `ENTER` (\<RETURN\>) to investigate the run settings.
~~~
#*********************************************************************
Expand Down Expand Up @@ -222,8 +224,8 @@ Let's take a look at the `run card` and see how the values are set, press `2` an
~~~
{: .output}

Try editting the beam energy (`ebeam1` and `ebeam2`) `6500` to `6800` as we are now running at 13.6TeV beam energy.
When done with editting, escape after saving the changes in the text file.
Try editting the beam energy (`ebeam1` and `ebeam2`) `6500` to `6800` as we are now running at 13.6 TeV beam energy.
When done with editting, escape after saving the changes in the text file (again, if in `vim`, `:wq` will save the changes (`w`) and quit (`q`)).

MadGraph allows you to change settings by interactively typing in below as well.
~~~
Expand All @@ -246,7 +248,7 @@ Keep in mind that the cuts you give before doing `set no_parton_cut` will be rem
So don't forget to do `set no_parton_cut` before giving the cuts you wish to give.


Once you are done, please provide the path to the pre-made run_card: `wplustest_4f_LO_run_card.dat`
Once you are done, notice that the prompt allows you to hand it a path to a valid card. Please provide the path to the pre-made run_card that's in the same directory by just giving it: `wplustest_4f_LO_run_card.dat`


What is the cross section determined by Madgraph?
Expand Down Expand Up @@ -457,7 +459,7 @@ There are multiple ways of analyzing an LHE file, each of which has its own adva
For the purpose of this exercise, we will use a pre-made pyroot script.
~~~bash
cd ~/nobackup/cmsdas_2026_gen/
cp /eos/uscms/store/user/cmsdas/2026/short_exercises/generators/LHEReader.py .
xrdcp root://cmseos.fnal.gov//store/user/cmsdas/2026/short_exercises/Generators/LHEReader.py .
~~~
{: .source}

Expand All @@ -474,6 +476,8 @@ python3.9 LHEReader.py --input genproductions_mg352/bin/MadGraph5_aMCatNLO/work/
~~~
{: .source}

Note: Make sure to hand the `--input` parameter your valid LHE file. If you ran the generation step multiple times, you may have other `run_XX` folders. It's always useful to take a direct look into the file you're looking to convert, as we did above. This `LHEReader.py` script is also expecting an ASCII LHE file and MadGraph outputs a compressed `.gz` file. You may need to uncompress it with e.g. `gunzip`.

Feel free to experiment here and plot various quantities. What are the shapes of the lepton pT distributions? What is the shape of the pT distribution of the W system? Are these shapes physical?

<!-- The most straightforward tool: MadAnalysis (MA).
Expand Down
16 changes: 8 additions & 8 deletions _episodes/02-particle_level.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The dominant corrections arise from collinear and/or soft gluon emissions, which
soft and collinear gluons to be added to the hard process.
A hadronization model is needed to transform the quarks and gluons produced from the hard process and the parton shower into the
physical (colorless) particles observed in Nature.
In CMS, one of the most widely used tools for the parton shower and hadronization is Pythia8 (however, do note that Pythia8 is a multipurpose generator that is able to calculate hard process for certain physics processes).
In CMS, one of the most widely used tools for the parton shower and hadronization is Pythia8 (however, do note that Pythia8 is a multipurpose generator that is able to calculate the hard process for certain physics processes).
In this exercise, instead of compiling Pythia8 and running it in standalone mode as we did for MadGraph, we will take Pythia8 that is already compiled under CMSSW environment.

## (1) Running Pythia8 interface in CMSSW
Expand Down Expand Up @@ -301,11 +301,11 @@ If not, the event is rejected.

In this exercise, we will see how to set up this method technically and validate the outcome.

We have prepared an MG5 gridpack for a W+jet process, which you can find at this location:
`/eos/uscms/store/user/cmsdas/2026/short_exercises/Generators/WJetsToLNu_HT-0toInf_slc7_amd64_gcc700_CMSSW_10_6_19_tarball.tar.xz`
We have prepared an MG5 gridpack for a W+jet process, which you can download with:
`xrdcp root://cmseos.fnal.gov//store/user/cmsdas/2026/short_exercises/Generators/WJetsToLNu_HT-0toInf_slc7_amd64_gcc700_CMSSW_10_6_19_tarball.tar.xz .`

If you are curious, you
can look at the `proc_card.dat` and `run_card.dat` either by unpacking the gridpack, or by opening it directly with e.g. `vim /eos/uscms/store/user/cmsdas/2026/short_exercises/Generators/WJetsToLNu_HT-0toInf_slc7_amd64_gcc700_CMSSW_10_6_19_tarball.tar.xz` (for non-vim users: \<ESC\>, `: q` to close).
can look at the `proc_card.dat` and `run_card.dat` either by unpacking the gridpack, or by opening it directly with e.g. `vim WJetsToLNu_HT-0toInf_slc7_amd64_gcc700_CMSSW_10_6_19_tarball.tar.xz` (for non-vim users: \<ESC\>, `: q` to close).

However, we replicate the relevant information here for the "proc" card:
~~~
Expand Down Expand Up @@ -374,15 +374,15 @@ Before running it, make sure that it has the correct gridpack path in it.

Define a path variable to reduce our typing of long names:
~~~bash
export CDGPATH=/eos/uscms/store/user/cmsdas/2026/short_exercises/Generators
export CDGPATH=root://cmseos.fnal.gov//store/user/cmsdas/2026/short_exercises/Generators/
export CONFIG_PATH=Configuration/GenProduction/python
~~~
Then, move to your local distribution of CMSSW (CMSSW_12_4_8) if you are
not already there:

~~~bash
cd CMSSW_12_4_8/src/
cp ${CDGPATH}/fragments/Hadronizer_TuneCP5_13TeV_MLM_5f_max2j_qCut10_LHE_pythia8_cff.py ${CONFIG_PATH}/
cd ~/nobackup/cmsdas_2026_gen/CMSSW_12_4_8/src
xrdcp ${CDGPATH}/fragments/Hadronizer_TuneCP5_13TeV_MLM_5f_max2j_qCut10_LHE_pythia8_cff.py ${CONFIG_PATH}/
cmsenv
scram b

Expand Down Expand Up @@ -421,7 +421,7 @@ It is called "1->2" because as we decrease the cutoff scale from >20 GeV to <20
In the genproductions repository, there is a macro that plots these quantities for a given EDM file:

~~~bash
root -l -b -q ${CDGPATH}/genproductions_mg265/bin/MadGraph5_aMCatNLO/macros/plotdjr.C\(\"w2jets_qcut10.root\",\"djr_qcut10.pdf\"\)
root -l -b -q ~/nobackup/cmsdas_2026_gen/genproductions_mg352/bin/MadGraph5_aMCatNLO/macros/plotdjr.C\(\"w2jets_qcut10.root\",\"djr_qcut10.pdf\"\)
~~~
{:. source}

Expand Down
8 changes: 4 additions & 4 deletions _episodes/03-systematic_uncertainties.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ generate p p > t t~ [QCD]
It would be not so difficult to realize `[QCD]` has been added in the process definition.
This is a flag which tells MadGraph that you wish to do the calculations at NLO in QCD.

Before going further, try concatenating top decays into a W boson and a b quark similar to what we did for `Z -> ee` example.
Before going further, try concatenating top decays into a W boson and a b quark similar to what we did for `W -> lv` example.
~~~
generate p p > t t~, t > w+ b [QCD]
generate p p > t t~ [QCD], t > w+ b
Expand All @@ -108,14 +108,14 @@ shower = PYTHIA8
Two lines are noticeably added, `shower = PYTHIA8` and `4` (which can be replaced with `madspin = ON`).
We are again not going to do the parton shower here.
This is because depending on which parton shower generator one chooses later, "counter term" calculation differs which accounts as negatively weighted events.
Press `tab` to turn off timer.

> ## Negative weighted events
> We won't cover what it is in the tutorial but important things to remember are that
> 1. Some portion of the events are negatively weighted so one needs to be careful with the normalization.
> 2. LHE files at NLO are even more unphysical than LHE files at LO before parton shower.
{: .challenge}

Press `tab` to turn off timer.
MadGraph again asks if you would like to edit the cards now including `madspin_card.dat`.
~~~
/------------------------------------------------------------\
Expand Down Expand Up @@ -151,8 +151,8 @@ decay t~ > w- b~, w- > mu- vm~
~~~
{: .output}

This forces top to decay into positron and antitop to decay into muon.
Remove unnecessary decay definitions and add these two lines to make a top pair sample that ends up giving you positron and a muon.
This forces the top to decay to a positron (+v) and the antitop to decay to a muon (+v).
Remove the unnecessary decay definitions that are in there and replace them with these two lines to make a top pair sample that ends up giving you positron and a muon.
Before moving on, do `set run_card nevents 50` to save time, producing only 50 events.

You will see inclusive top pair production cross section being computed which includes all possible decays for the top quark.
Expand Down
2 changes: 2 additions & 0 deletions setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ cmsrel CMSSW_12_4_8
~~~
{: .source}

Reminder: If the `cmsrel` command isn't found, it's likely because you have to `source /cvmfs/cms.cern.ch/cmsset_default.sh` or have that in your `.bash_profile`/`.bashrc`. Refer back to the DAS Pre-Exercises for more information

<!-- ## Preparing CMSSW working area
We start with pulling and installing the required CMS software (CMSSW).
We use two versions: the older 10.6.19 is used for sample generation,
Expand Down