Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
d7c5aef
Initial commit, get things running on lxplus, expand base selection t…
tolange May 9, 2025
a7b2e31
lint and missing files
tolange May 9, 2025
f49148f
update cmsdb to include multilepton signals
tolange May 28, 2025
df75ec1
Add first multilepton samples
tolange May 28, 2025
b0bcd92
raw update of CF
tolange Aug 8, 2025
9624399
update CF again, now up to date with current developments
tolange Aug 11, 2025
86d8bfb
Code changes required for CF update, fine tuning to manivald, fixing …
tolange Aug 12, 2025
185ca8b
linting
tolange Aug 12, 2025
5a7f4b1
Update Readme and change setup to multilepton.
tolange Aug 12, 2025
7257e60
hbt->multilepton
tolange Aug 12, 2025
b46105f
Update README.md
tolange Aug 12, 2025
3b5d3c7
improve logo
tolange Aug 13, 2025
1ae6e96
Merge branch 'master' of github.com:HEP-KBFI/hhmultilepton
tolange Aug 13, 2025
ecac4d2
Implementing new lepton selection code. 4l category fully implemented.
MatheuspCoelho Aug 16, 2025
b5ffb07
Merge pull request #1 from MatheuspCoelho/newselection_dev
tolange Aug 16, 2025
19ace5a
4l and 3l categories fully implemented.
MatheuspCoelho Aug 20, 2025
b817a2e
Merge pull request #3 from MatheuspCoelho/newselection_dev
tolange Aug 22, 2025
c8d4d56
Update README.md
tolange Aug 22, 2025
d34af7b
Merge pull request #2 from HEP-KBFI/newselection_dev
tolange Aug 22, 2025
f006f59
Implementing new selection scheme. Implementing new category for the …
MatheuspCoelho Sep 2, 2025
e3ae1fd
Adding new leptons masks. Adding b-veto flags.
MatheuspCoelho Sep 7, 2025
cd31a7e
Adding OS and SS selections for the physical channels. Fixing channel…
MatheuspCoelho Sep 8, 2025
8d101c8
Merge pull request #4 from MatheuspCoelho/newselection_dev
tolange Sep 16, 2025
0cbe61d
Merge pull request #5 from HEP-KBFI/newselection_dev
tolange Sep 16, 2025
cd668f9
WIP commit for lep mva training, disable hh-btag, clean ejts manually…
tolange Sep 26, 2025
63cae70
Fix python package and default jet ID
Sep 26, 2025
209f91a
Loosening eta cuts and disabling tau vetoes in the ceormu selection. …
MatheuspCoelho Sep 27, 2025
7dfc0a6
Merge pull request #6 from MatheuspCoelho/master
tolange Sep 27, 2025
3e08fd8
Fix file permissions on T2
tolange Sep 29, 2025
968556c
Add central nanoAod v12 for QCD
tolange Sep 29, 2025
b8e5ce4
change readme recommendation forjobs location on manivald
tolange Sep 29, 2025
738ed37
Adding the remaining channels. Saving all lepton ids.
MatheuspCoelho Oct 2, 2025
3c2d1f4
Setting the new collections to be saved in the parquet files.
MatheuspCoelho Oct 2, 2025
d314d60
make lepton selection compatible with v12
tolange Oct 4, 2025
254d989
Merge pull request #7 from MatheuspCoelho/master
tolange Oct 4, 2025
2a7f4ce
Adding SR/SB for all seven categories. Category combinations disabled.
MatheuspCoelho Oct 12, 2025
e23e16f
Adding SR/SB for all seven categories. Category combinations disabled.
MatheuspCoelho Oct 12, 2025
5636e8b
Adding SR/SB for all seven categories. Category combinations disabled.
MatheuspCoelho Oct 12, 2025
e47a676
Merge pull request #8 from MatheuspCoelho/master
tolange Oct 24, 2025
099d59d
Added uncleaned Jet selection (lep MVA), unfiltered taus (for PNet st…
tolange Oct 24, 2025
884cb88
clean up
Sep 29, 2025
b96d6a1
Restored my version of configs_multilepton.py; kept theirs for defaul…
kjaffel Oct 15, 2025
b419699
Recovered all my changes from stash after rebase
kjaffel Oct 15, 2025
3f2d58a
code clean up
kjaffel Oct 23, 2025
1e567d2
add missing tags
kjaffel Oct 23, 2025
e806da4
remove script not in use
kjaffel Oct 23, 2025
5cc88dd
fix code duplicate and trying to sort issue with missing signals when…
kjaffel Oct 23, 2025
597043e
add workaround for 2024 corrections and compaigns
kjaffel Oct 24, 2025
ff6cd16
fix more issues with code updates
kjaffel Oct 25, 2025
bb91a7e
trying different dataset
kjaffel Oct 25, 2025
655769a
get back to old categorization until later update
kjaffel Oct 25, 2025
5342530
fix unecssary printout
kjaffel Oct 25, 2025
26c214d
fix typ in external met file
kjaffel Oct 25, 2025
382a893
updated cmsdb version
kjaffel Oct 25, 2025
8a8acdb
add support for nanov15
kjaffel Oct 25, 2025
e102588
few fixes for 2024 nano v15 campaign
kjaffel Oct 25, 2025
48d294a
remove old code that need external files
kjaffel Oct 25, 2025
3b0ea86
fix file system of nano v15 and some other external files related to…
kjaffel Oct 25, 2025
f2e567e
uodate readme and fix jec sources for 2024
kjaffel Oct 26, 2025
1c5e150
fix a typo
kjaffel Oct 26, 2025
d4d8533
configs_multilepton.py
kjaffel Oct 26, 2025
204a334
fix correction lib import
kjaffel Oct 26, 2025
a616098
remove qcd hooks fron bbtautau and clean grouping
kjaffel Oct 27, 2025
1d194d1
clean up grouping
kjaffel Oct 27, 2025
acd3aae
remove HHBJet picked up from tlange commit #51a0ca8
kjaffel Oct 27, 2025
3df894f
update readme
kjaffel Oct 27, 2025
1956607
more clean up
kjaffel Oct 27, 2025
2ee9fed
update columnflow version
kjaffel Oct 30, 2025
b56c74f
update columnflow and multilepons code: remove venv duplicate, updat…
kjaffel Oct 30, 2025
3f4dda8
remove old venv files
kjaffel Oct 30, 2025
72d73c9
update modules
kjaffel Oct 30, 2025
9ee13b6
trying to fix wrong correction name for 2024 egmma in correctionlib
kjaffel Oct 30, 2025
6dcffad
trying to reduce number of venv available, adding arg to setup scrip…
kjaffel Oct 30, 2025
267cc42
fix py packages compatibility issue with new columnflow
kjaffel Nov 3, 2025
f8c965a
find a workaround for some SFs and switch to debug mode for some pri…
kjaffel Nov 3, 2025
8f8a985
remove old export
kjaffel Nov 3, 2025
64addf7
fix some defaut input to law as well variavle that are scattered around
kjaffel Nov 3, 2025
7056cdf
uodate readme and change dev.sh to a tempate.sh so do not interefer …
kjaffel Nov 3, 2025
541e273
samll fix in README
kjaffel Nov 3, 2025
897ac24
update readme and fix missing btag correction
kjaffel Nov 4, 2025
4ec4f08
fix issue with select events related to missing branches in nanov15,…
kjaffel Nov 4, 2025
e1c40d2
few more changes are needed for this to work
kjaffel Nov 4, 2025
a05d9bf
add patch for missing cross-section, code should not break
kjaffel Nov 4, 2025
ac551c0
fix banner in readme
kjaffel Nov 4, 2025
397ba92
add banner
kjaffel Nov 4, 2025
a547a51
add missing trigger sf files
kjaffel Nov 4, 2025
2666ba9
fix some dupliacte in exports template
kjaffel Nov 5, 2025
3c97985
Implement dataset pruning and update config handling
kjaffel Nov 7, 2025
584ec5e
fix typo in slurn jobs path
kjaffel Nov 9, 2025
4f3f76a
fix paths scattered all over the place
kjaffel Nov 9, 2025
4532c3f
keep CF_STORE_NAME , needed later
kjaffel Nov 9, 2025
4ce4d82
add my latest changes to make limit-datastes-files works
kjaffel Nov 11, 2025
06e8b35
fix missing commits from mathias
kjaffel Nov 11, 2025
8fb4fad
fix missing categories
kjaffel Nov 11, 2025
4911916
fix merge conflict, restore my cnahges
kjaffel Nov 11, 2025
cc72741
fetch promptMVA instead of mvaTTH for nano v15 since do not exist
kjaffel Nov 11, 2025
d3d7d71
fetch promptMVA instead of mvaTTH for nano v15 since do not exist
kjaffel Nov 11, 2025
de3b4c5
fix some naming exceptions for some 4flavor scheme datasets
kjaffel Nov 12, 2025
adc03ed
fix egamma correction for private nano v14
kjaffel Nov 26, 2025
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
10 changes: 2 additions & 8 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
[flake8]

# line length of 100 is recommended, but set it to a forgiving value
max-line-length = 120

# codes of errors to ignore
max-line-length = 119
ignore = E128, E306, E402, E722, E731, W504, Q003

# enforce double quotes
inline-quotes = double
inline-quotes = double
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ docs/_build
tmp
store
software
data
columnflow_venv
.data
.law
.setups
Expand Down
1 change: 1 addition & 0 deletions .markdownlint
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
modules/columnflow/.markdownlint
36 changes: 36 additions & 0 deletions .setups/template.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export CF_CERN_USER="kjaffel"
export CF_CERN_USER_FIRSTCHAR="${CF_CERN_USER:0:1}"
export CF_DATA="$CF_REPO_BASE/columnflow_venv"
export CF_SOFTWARE_BASE="$CF_DATA/software"
export CF_VENV_BASE="$CF_SOFTWARE_BASE/venvs"
export CF_STORE_NAME="cf_store"
export CF_WLCG_USE_CACHE="true"
export CF_WLCG_CACHE_CLEANUP="false"
export CF_VENV_SETUP_MODE_UPDATE="false"
export CF_VENV_SETUP_MODE="update"
export CF_INTERACTIVE_VENV_FILE=""
export CF_LOCAL_SCHEDULER="true"
export CF_SCHEDULER_HOST="127.0.0.1"
export CF_SCHEDULER_PORT="8082"
export CF_FLAVOR="cms"
export LAW_CMS_VO="cms"

# on manivald
export CF_CRAB_STORAGE_ELEMENT="T2_EE_Estonia"
export CF_SLURM_FLAVOR="manivald"
export CF_SLURM_PARTITION="main"
export CF_CLUSTER_LOCAL_PATH="/local/$CF_CERN_USER/HHMultilepton_Run3/"
export CF_CRAB_BASE_DIRECTORY="/store/user/$CF_CERN_USER/HHMultilepton_Run3/cf_crab_outputs"
export TMPDIR="/scratch/local/$CF_CERN_USER"

# on lxplus
#export CF_CRAB_STORAGE_ELEMENT="T2_CH_CERN"
#export CF_HTCONDOR_FLAVOR="cern_el9" # or "cern" for older versions of lxplus not using ELMA9
#export CF_CLUSTER_LOCAL_PATH="/eos/user/$CF_CERN_USER_FIRSTCHAR/$CF_CERN_USER/HHMultilepton_Run3/"
#export CF_CRAB_BASE_DIRECTORY="$CF_CLUSTER_LOCAL_PATH/cf_crab_outputs"
#export TMPDIR="/tmp/$CF_CERN_USER"


export CF_STORE_LOCAL="$CF_CLUSTER_LOCAL_PATH/$CF_STORE_NAME"
export CF_WLCG_CACHE_ROOT="$CF_CLUSTER_LOCAL_PATH/cf_scratch"
export CF_JOB_BASE="$CF_CLUSTER_LOCAL_PATH/cf_jobs"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
All rights reserved.

The UHH HH -> bbtautau developers.
The HH -> Multilepton developers.
172 changes: 117 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,125 @@
# HH → bb𝜏𝜏
# HH (H → WW/ZZ/𝜏𝜏) → Multi-Leptons Analysis

[![Lint and test](https://github.com/uhh-cms/hh2bbtautau/actions/workflows/lint_and_test.yaml/badge.svg)](https://github.com/uhh-cms/hh2bbtautau/actions/workflows/lint_and_test.yaml)
**Table of contents**
- [Introduction](#introduction)
- [Installation (first time)](#first-time-setup)
- [Usage](#usage)
- [Useful links](#useful-links)
- [Contributors](#contributors)
- [Development](#development)

## Quickstart

A couple test tasks are listed below.
They might require a **valid voms proxy** for accessing input data.
## Introduction

This is the code base for the Run2+Run3 iteration of the CMS HH Multileptons analysis.

The code is forked and for now heavily based on the UHH bersion of the [HH → bb𝜏𝜏 analysis](https://github.com/uhh-cms/hh2bbtautau)
and still very much WIP. Expect remnants from the bb𝜏𝜏 analysis, crashes and bugs, you have been warned!

Please make sure you are subscribed to our e-group: [email protected]
It controls the acess to our indico etc. and is a good way to get updates for our meetings.

Also join our channel on [mattermost](https://mattermost.web.cern.ch/cms-exp/channels/hh-multilepton-run3).
(You will need to join the CMS team first if not done so).

The code is currently developed with the Tallinn T2 (and lxplus) in mind.
For further questions please, contact t\*\*\*\*.l\*\*\*\*@no-spam-cern.ch.

## First time setup

```shell
# clone the project
git clone --recursive [email protected]:uhh-cms/hh2bbtautau.git
cd hh2bbtautau

# source the setup and store decisions in .setups/dev.sh (arbitrary name)
source setup.sh dev

# index existing tasks once to enable auto-completion for "law run"
law index --verbose

# run your first task
# (they are all shipped with columnflow and thus have the "cf." prefix)
law run cf.ReduceEvents \
--version v1 \
--dataset hh_ggf_bbtautau_madgraph \
--branch 0

# create a plot
law run cf.PlotVariables1D \
--version v1 \
--datasets hh_ggf_bbtautau_madgraph \
--producers default \
--variables jet1_pt \
--categories incl \
--branch 0
# 1. clone the project
git clone --recursive [email protected]:HEP-KBFI/hhmultilepton.git
cd hhmultilepton

# create a (test) datacard (CMS-style)
law run cf.CreateDatacards \
--version v1 \
--producers default \
--inference-model test \
--workers 3
# 2. get a voms token
voms-proxy-init -voms cms -rfc -valid 196:00

# 3. copy the provided template to a new file (you can choose any <setup_name>):
cp .setups/template.sh .setups/mydev.sh

# 4. open .setups/mydev.sh in your editor and adjust any environment variables or paths as needed for your local setup.
# then source the main setup script with your custom setup name:
source setup.sh <setup_name> [sandbox_type]
```
```bash
source setup.sh --help
Arguments:
<setup_name> Name of the setup (random name of your choice)
[sandbox_type] Optional: choose between 'minimal' (default) or 'full'
Examples:
source setup.sh mydev # uses 'minimal' environment from (sandboxes/venv_multilepton.sh)
source setup.sh mydev full # uses 'full' environment from (sandboxes/venv_multilepton_dev.sh)
```

## Useful commands
Note: If you prefer not to use the provided template, you can still activate the environment manually by running:
source setup.sh `<setup_name>`
In this case, `<setup_name>` should not already exist under the `.setups/` directory.
When you run the command, the setup script will guide you interactively, prompting you to enter the required environment variables (as `export` commands). Once completed, these settings will be automatically saved to `.setups/<setup_name>.sh`.


<img width="1336" height="506" alt="image" src="img.png" />


Code can now be run but first storage locations for the tasks outputs should be checked as configured [here](https://github.com/HEP-KBFI/hhmultilepton/blob/master/law_outputs.cfg#L26-L90). Currently outputs point to the user store of the `T2_EE_Estonia on manivald` so that outputs are also accessible remotely, but we will likely adapt this over time depending on the output.
I.e large outputs available in a remote reachable location, smaller ones on local stores. Larger ones likely also split by user/cluster so that central versions can be reused.

**For development on lxplus "i strongly" advise to change `wlcg_fs_manivald` to `wlcg_fs_cernbox` in the beginning.**

## Usage

### Full reduction
1. Setup your enviorement (**always**):

```shell
law run cf.ReduceEventsWrapper \
--version prod1 \
--configs run3_2022_preEE \
--datasets "*" \
--shifts "nominal,{tune,hdamp,mtop}_{up,down}" \
--cf.ReduceEvents-workflow htcondor \
--cf.ReduceEvents-pilot \
--cf.ReduceEvents-tasks-per-job 3 \
--local-scheduler False \
--workers 6
voms-proxy-init -voms cms -rfc -valid 196:00

# source the setup and export env in the sorted file " .setups/mydev.sh " in this case
source setup.sh mydev
```

2. Try to run on 1 signal, 1 backgound and 1 data locally:

```shell
law run cf.PlotVariables1D \
--version test \
--producers default \
--variables nmu \
--datasets hh_ggf_htt_hvv_kl1_kt1_powheg,zz_pythia,data_e_c \
```

3. And if the above run sucessfully, you can proceed to submit jobs via slurm/condor adding

```shell
--workflow slurm \ # or
--workflow htcondor \ # or
--workflow crab \ # to be tested!?
```

## Documentation

- Lives here: https://gitlab.cern.ch/hh-multileptons-full-analysis/hh-multileptons-doc
- Talks:
- slides: https://indico.cern.ch/event/1580193/contributions/6660044/attachments/3121091/5534653/multilep%20framework.pdf

## 🙏 Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->

<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tolange"><img src="https://avatars.githubusercontent.com/u/11850680?s=96&v=4" width="100px;" alt="`Torben Lange`"/><br /><sub><b>Torben Lange</b></sub></a><br /><a href="https://github.com/HEP-KBFI/hhmultilepton/commits/master/?author=tolange" title="Code">💻</a> </td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/MatheuspCoelho"><img src="https://avatars.githubusercontent.com/u/85200761?v=4" width="100px;" alt="`Matheus Coelho`"/><br /><sub><b>Matheus Coelho</b></sub></a><br /><a href="https://github.com/HEP-KBFI/hhmultilepton/commits/master/?author=MatheuspCoelho" title="Code">💻</a> </td>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->

## Useful links

- [columnflow documentation](https://columnflow.readthedocs.io/en/latest/index.html)
Expand All @@ -68,19 +129,20 @@ law run cf.ReduceEventsWrapper \
- [GrASP](https://cms-pdmv-prod.web.cern.ch/grasp/)
- [XSDB](https://xsdb-temp.app.cern.ch)
- [DAS](https://cmsweb.cern.ch/das)
NanoAOD:
NanoAOD
- [Nano documentation](https://gitlab.cern.ch/cms-nanoAOD/nanoaod-doc)
- [Correctionlib files](https://gitlab.cern.ch/cms-nanoAOD/jsonpog-integration)
- JME
- [Docs](https://cms-jerc.web.cern.ch)
- BTV
- [Docs](https://btv-wiki.docs.cern.ch)
- [JME](https://cms-jerc.web.cern.ch)
- [BTV](https://btv-wiki.docs.cern.ch)
- TAU
- [Run 2 Twiki](https://twiki.cern.ch/twiki/bin/viewauth/CMS/TauIDRecommendationForRun2)
- [Run 3 Twiki](https://twiki.cern.ch/twiki/bin/viewauth/CMS/TauIDRecommendationForRun3)
- [Correctionlib files](https://gitlab.cern.ch/cms-tau-pog/jsonpog-integration/-/tree/TauPOG_v2_deepTauV2p5/POG/TAU?ref_type=heads)

## Development

- Source hosted at [GitHub](https://github.com/uhh-cms/hh2bbtautau)
- Report issues, questions, feature requests on [GitHub Issues](https://github.com/uhh-cms/hh2bbtautau/issues)
- Source hosted at [GitHub](https://github.com/HEP-KBFI/hhmultilepton)
- Report issues, questions, feature requests on [GitHub Issues](https://github.com/HEP-KBFI/hhmultilepton/issues)
- Ideally also ping us on [mattermost](https://mattermost.web.cern.ch/cms-exp/channels/hh-multilepton-run3).
- For new features open a new branch before merging into master, ask for a code review by a felllow contributor and dont forget linting!
- Happy coding 😊
Loading