Skip to content

Commit

Permalink
Split lessons and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin committed Aug 15, 2024
1 parent d48c7ae commit 99a7819
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 37 deletions.
78 changes: 78 additions & 0 deletions _episodes/03-FindingTriggerInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: "Finding information about a trigger path"
teaching: 10
exercises: 10
objectives:
- "Learn different ways to look up information about a trigger path"
---
> ## Prerequisites
> Set up your machine following instructions in [setup][lesson-setup] first.
{: .prereq}

### Find the L1 seed of the MET HLT path
There are different ways to learn which is the L1 seed of a specific HLT path. Two examples will be tested in this exercise:
* looking into [OMS](https://cmsoms.cern.ch/);
* looking into [web-based confdb](https://hlt-config-editor-confdbv3.app.cern.ch/);
* inspecting a HLT configuration.

In the context of this exercise, we will retrieve the information of the `HLT_PFMET170_HBHECleaned_v*` path from OMS for a specific run (`run 284043`) and HLT configuration (`/cdaq/physics/Run2016/25ns15e33/v4.2.3/HLT/V2`).

### OMS method
As a first step, connect to [OMS](https://cmsoms.cern.ch/cms/runs/report?cms_run=284043&cms_run_sequence=GLOBAL-RUN)
* Click on `"Runs > Triggers > HLT Path Report"`,
* Use search option at the bottom left ("FILTER > Path Name") to look for `HLT_PFMET170_HBHECleaned_v*`.
* Find the information about the L1 seed names of the HLT path of interest.

Then move to the L1 Trigger rate page in OMS and search for the L1 seeds there to have a look at the rates and prescales of these L1 seeds.<br>
(Note that you might need to increase the number of rows at the bottom of the page to find them.)
### Web-based confdb
The [web-based confdb](https://hlt-config-editor-confdbv3.app.cern.ch/) is a web-based GUI of the database that holds all of CMS HLT configurations.<br>
One can **inspect** any given HLT menu without downloading one or connecting to the database.<br>
More information about the web-based confdb can be found in these [slides](https://indico.cern.ch/event/1230321/contributions/5177149/attachments/2580137/4450016/webbased%20confdb.pdf)

Let's try to find the `/cdaq/physics/Run2016/25ns15e33/v4.2.3/HLT/V2` menu in the GUI.
* Connect to [https://hlt-config-editor-confdbv3.app.cern.ch/](https://hlt-config-editor-confdbv3.app.cern.ch/)
* Click "Configurations > Open remote"
* In the drop-down menu, select `online`
* Follow the directory of the menu `/cdaq/physics/Run2016/25ns15e33/v4.2.3/`
* Select "V2" from the side penal, and click "OK"

After retriving from the DB, you can see all the paths.
* Type the name of the path `HLT_PFMET170_HBHECleaned` into the search box in the left panel
* Expand the path. This shows all the **modules** that the HLT path will run in sequence.
* The L1 seed of a HLT path is always the first module (after the `HLTBeginSequence`) starting with the name `hltL1sXXXX`
* Click on `hltL1sETM50ToETM120`
* In the right panel, the `L1SeedsLogicalExpression` shows the L1 seeds used by the path.

> You should see the same L1 seeds that you find from OMS.
{: .checklist}

### Inspecting a HLT configuration
`hltGetConfiguration` is the official command to retrive a HLT configuration from the database.<br>
> Since this involves connecting to the confdb database directly, this command should never be used in a large number of jobs or programatic loop. It should only be used interactively.
{: .caution}
~~~
ssh -f -N -D 1080 <yourUserName>@lxplus.cern.ch
hltConfigFromDB --configName --adg /cdaq/physics/Run2016/25ns15e33/v4.2.3/HLT/V2 --dbproxy --dbproxyhost localhost --dbproxyport 1080 > dump_hlt_online_2016G.py
~~~
If you have connection issue, simply inspect one that has been downloaded for you
~~~
xrdcp root://cmseos.fnal.gov//store/user/cmsdas/2023/short_exercises/Trigger/dump_hlt_online_2016G.py .
~~~
Then, inspect the HLT configuration dump_hlt_online_2016G.py to look for the information about the L1 seed of the path into it:
~~~
grep 'process.HLT_PFMET170_HBHECleaned_v9' dump_hlt_online_2016G.py
~~~
You should see the expected output below:
~~~
process.HLT_PFMET170_HBHECleaned_v9 = cms.Path(process.HLTBeginSequence+process.hltL1sETM50ToETM120+process.hltPrePFMET170HBHECleaned+process.HLTRecoMETSequence+process.hltMET90+process.HLTHBHENoiseCleanerSequence+process.hltMetClean+process.hltMETClean80+process.HLTAK4PFJetsSequence+process.hltPFMETProducer+process.hltPFMET170+process.HLTEndSequence)
~~~

> ### Questions
> To conclude, answer the following questions:
>
> Which was the lowest threshold L1 seed active in the L1 menu?
> Which is the lowest threshold L1 seed unprescaled?
> How is it called the HLT module that contains the information about the L1 seeding?
{: .challenge}

37 changes: 0 additions & 37 deletions _episodes/03-HLT_efficiency.md

This file was deleted.

56 changes: 56 additions & 0 deletions _episodes/04-HLT_efficiency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: "Measuring trigger efficiencies"
teaching: 30
exercises: 0
objectives:
- "Learn how to access the trigger information stored in MiniAOD and NanoAOD"
- "Learn what is trigger objects and how to access them"
- "Measure trigger efficiency using the tag-and-probe method"
---

> ## Prerequisites
> Set up your machine following instructions in [setup][lesson-setup] first.
{: .prereq}

> ## Objective
> The goal of the following exercises is to learn how to access and play with the trigger objects in our data and compute the efficiency of a specific HLT path and look also at its Level 1 (L1) seed.
>
> The focus will be on a HLT path used during the 2016 data-taking to select events with a certain amount of missing transverse energy: `HLT_PFMET170_HBHECleaned_v*`.
{: .objectives}

## Compute a MET trigger efficiency

We will first run this exercise on MiniAOD format, then run it again on NanoAOD.

> ## MiniAOD
> The MINIAOD format was introduced at the beginning of Run 2 to reduce the information and file size from the AOD file format.<br>
> This means that several redundant versions of Ntuples for different analysis groups are stored in the limited CMS storage spaces.<br>
> For Run 2 analyses, most of the analysis groups at CMS skimmed the centrally produced MiniAOD files into smaller, analysis-specific ROOT Ntuples.<br>
MiniAOD events contain two trigger products that we will need in these exercises.<br>
The `TriggerResults` product contains trigger bits for each HLT path, whereas the `TriggerObjectStandAlone` product contains the trigger objects used at HLT.<br>
In addition, the trigger prescales, L1 trigger decisions, and L1 objects are stored in MiniAOD.<br>
A more detailed description of the trigger-related MiniAOD event content can be found [here](https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookMiniAOD2016#Trigger).

In this exercise we work with a skimmed MiniAOD file. (In case you are wondering where this skimmed file came from: it has been created using the configuration in `ShortExerciseTrigger/test/skim_pfmet100.py`, which selects events with offline MET above a threshold of 100 GeV.)

> ### Inspect MiniAOD content
> First, inspect the contents of the skimmed MiniAOD input file as follows:
> ~~~
> edmDumpEventContent root://cmseos.fnal.gov//store/user/cmsdas/2023/short_exercises/Trigger/skim_pfmet100_SingleElectron_2016G_ReReco_87k.root --regex=Trigger
> ~~~
> You can also inspect the full file content by dropping the --regex parameter.
{: .challenge}
As you see, there are indeed multiple TriggerResults products here, as well as other trigger-related collections.<br>
We will learn how to interact with these two products and how to use their packed information in our physics analyses in this and the following exercises.
{: .solution}
> ## NanoAOD
> A centrally maintained NanoAOD format was proposed in 2018, aiming for a common Ntuple format that can be used by most of the CMS analysis groups.
> Information about the NanoAOD format can be found [here](https://cms-nanoaod-integration.web.cern.ch/integration/master-102X/mc102X_doc.html#HLT).
{: .solution}
{% include links.md %}
File renamed without changes.
File renamed without changes.

0 comments on commit 99a7819

Please sign in to comment.