Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/rkansal47/HHbbVV
Browse files Browse the repository at this point in the history
  • Loading branch information
rkansal47 committed Apr 10, 2024
2 parents 22ea511 + 19820a5 commit 7f3e6b1
Show file tree
Hide file tree
Showing 996 changed files with 15,038 additions and 1,657 deletions.
1 change: 1 addition & 0 deletions .codespell-whitelist.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
subjet
fpr
tpr
datas
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ tau_check.ipynb
src/HHbbVV/postprocessing/testBDT
src/HHbbVV/postprocessing/templates/*test*
src/HHbbVV/postprocessing/templates/*Test*
src/HHbbVV/postprocessing/test_templates
tmp
src/HHbbVV/postprocessing/templates_old

# logs
src/HHbbVV/postprocessing/outs
src/HHbbVV/postprocessing/templates_old
21 changes: 11 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: "24.2.0"
rev: "24.3.0"
hooks:
- id: black-jupyter
args: [--line-length=100]
Expand Down Expand Up @@ -39,15 +40,15 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
args: [--prose-wrap=always]
# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: "v4.0.0-alpha.8"
# hooks:
# - id: prettier
# types_or: [yaml, markdown, html, css, scss, javascript, json]
# args: [--prose-wrap=always]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.14"
rev: "v0.3.4"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -70,7 +71,7 @@ repos:
args: ["--ignore-words", ".codespell-whitelist.txt"]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.6"
rev: "v0.10.0.1"
hooks:
- id: shellcheck

Expand All @@ -89,7 +90,7 @@ repos:
additional_dependencies: ["validate-pyproject-schema-store[all]"]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.27.3"
rev: "0.28.1"
hooks:
- id: check-dependabot
- id: check-github-workflows
Expand Down
38 changes: 17 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using the [coffea](https://coffeateam.github.io/coffea/) and
- [BDT Pre-Processing](#bdt-pre-processing)
- [BDT Trainings](#bdt-trainings)
- [Post-Processing](#post-processing-1)
- [Control plots with resonant and nonresonant samples](#control-plots-with-resonant-and-nonresonant-samples)
- [Control plots](#control-plots)
- [BDT sculpting plots](#bdt-sculpting-plots)
- [Making separate background and signal templates for scan and bias tests (resonant)](#making-separate-background-and-signal-templates-for-scan-and-bias-tests-resonant)
- [Create Datacard](#create-datacard)
Expand Down Expand Up @@ -325,29 +325,32 @@ python TrainBDT.py --data-path "../../../../data/skimmer/Feb24/bdt_data" --year

### Post-Processing

**Important:** If running on a Mac, make sure to install `gnu-getopt` first for
bash scripts, see [here.](#getopt-for-mac)

```bash
python postprocessing.py --templates --year "2017" --template-dir "templates/$TAG/" --plot-dir "../../../plots/PostProcessing/$TAG/" --data-dir "../../../../data/skimmer/Feb24/" (--resonant --signal-data-dir "" --control-plots)
```

All years (non-resonant):

```bash
for year in 2016 2016APV 2017 2018; do python -u postprocessing.py --templates --year $year --template-dir "templates/Jun14" --data-dir "../../../../data/skimmer/Feb24" --signal-data-dir "../../../../data/skimmer/Jun10" --bdt-preds-dir "../../../../data/skimmer/Feb24/23_05_12_multiclass_rem_feats_3/inferences"; done
./bash_scripts/NonresTemplates.sh --tag $TAG # remember to change data_dir as needed!
```

Scan (non-resonant):

```bash
for year in 2016 2016APV 2017 2018; do python -u postprocessing.py --templates --year $year --template-dir "templates/$TAG/" --data-dir "../../../../data/skimmer/Feb24/" --old-processor --nonres-txbb-wp "LP" "MP" "HP" --nonres-bdt-wp 0.995 0.998 0.999 --no-do-jshifts; done
./bash_scripts/NonresTemplatesScan.sh --tag $TAG # remember to change data_dir as needed!
```

#### Control plots with resonant and nonresonant samples

Run `postprocessing/bash_scripts/ControlPlots.sh` from inside
`postprocessing folder`.
#### Control plots

**Important:** If running on a Mac, make sure to install `gnu-getopt` first, see
[here.](#getopt-for-mac)
```bash
./bash_scripts/ControlPlot.sh --tag $TAG # w/ resonant and nonresonant samples and all control plot variables in postprocessing.py script by default
./bash_scripts/ControlPlots.sh --tag $TAG --nonresonant --controlplotvars BDTScore --nohem2d # BDT score only
./bash_scripts/MassPlots.sh --tag $TAG # mSD vs mReg plots
```

#### BDT sculpting plots

Expand Down Expand Up @@ -404,23 +407,16 @@ python PlotFits.py --fit-file "cards/test_tied_stats/fitDiagnosticsBlindedBkgOnl

### CMSSW + Combine Quickstart

```bash
cmsrel CMSSW_11_2_0
cd CMSSW_11_2_0/src
cmsenv
git clone -b py3 https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit.git HiggsAnalysis/CombinedLimit
git clone -b v2.0.0 https://github.com/cms-analysis/CombineHarvester.git CombineHarvester
scramv1 b clean; scramv1 b
```

New version:
**Warning: this should be done outside of your conda/mamba environment!**

```bash
source /cvmfs/cms.cern.ch/cmsset_default.sh
cmsrel CMSSW_11_3_4
cd CMSSW_11_3_4/src
cmsenv
# need my fork until regex for float parameters is merged into the main repo
git clone -b regex-float-parameters https://github.com/rkansal47/HiggsAnalysis-CombinedLimit.git HiggsAnalysis/CombinedLimit
# git clone -b main https://github.com/rkansal47/HiggsAnalysis-CombinedLimit.git HiggsAnalysis/CombinedLimit
# float regex PR was merged so we should be able to switch to the main branch now:
git clone -b v9.2.0 https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit.git HiggsAnalysis/CombinedLimit
git clone -b v2.0.0 https://github.com/cms-analysis/CombineHarvester.git CombineHarvester
# Important: this scram has to be run from src dir
scramv1 b clean; scramv1 b
Expand Down
4 changes: 2 additions & 2 deletions data/indexpfnano.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def get_subfolders(parent):
"/store/user/lpcpfnano/cmantill/v2_3/2016/JetHT2016",
"/store/user/lpcpfnano/cmantill/v2_3/2017/JetHT2017",
"/store/user/lpcpfnano/cmantill/v2_3/2018/JetHT2018",
# recovering missing data from ^:
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016",
"/store/user/lpcpfnano/rkansal/v2_3/2017/JetHT2017",
"/store/user/lpcpfnano/rkansal/v2_3/2018/JetHT2018",
Expand Down Expand Up @@ -136,8 +137,7 @@ def get_subfolders(parent):
# ignore_subsamples = ["SingleMuon_Run2016B_ver1_HIPM"]
ignore_subsamples = []

# for pyear in ["2016", "2016APV", "2017", "2018"]:
for pyear in ["2016", "2016APV"]:
for pyear in ["2016", "2016APV", "2017", "2018"]:
print(pyear)
index = {}
for f1 in folders_to_index:
Expand Down
39 changes: 1 addition & 38 deletions data/pfnanoindex_2016.json
Original file line number Diff line number Diff line change
Expand Up @@ -5091,44 +5091,7 @@
"/store/user/lpcpfnano/cmantill/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/220701_193717/0000/nano_data2016_96.root",
"/store/user/lpcpfnano/cmantill/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/220701_193717/0000/nano_data2016_97.root",
"/store/user/lpcpfnano/cmantill/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/220701_193717/0000/nano_data2016_98.root",
"/store/user/lpcpfnano/cmantill/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/220701_193717/0000/nano_data2016_99.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-1.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-10.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-11.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-13.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-14.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-3.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-4.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-5.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-6.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-7.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1-9.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_1.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_10.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_11.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_12.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_13.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_14.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_15.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_17.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_18.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_21.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_22.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_23.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_24.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_25.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_26.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_27.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_28.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_29.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_3.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_30.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_31.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_32.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_34.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_5.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_6.root",
"/store/user/lpcpfnano/rkansal/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/240301_221443/0000/nano_data2016_8.root"
"/store/user/lpcpfnano/cmantill/v2_3/2016/JetHT2016/JetHT/JetHT_Run2016H/220701_193717/0000/nano_data2016_99.root"
]
},
"QCD": {
Expand Down
Loading

0 comments on commit 7f3e6b1

Please sign in to comment.