forked from uhh-cms/hh2bbtautau
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
2,269 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[flake8] | ||
|
||
# line length of 100 is recommended, but set it to a forgiving value | ||
max-line-length = 120 | ||
|
||
# codes of errors to ignore | ||
ignore = E128, E306, E402, E722, E731, W504 | ||
|
||
# enforce double quotes | ||
inline-quotes = double |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.pdf filter=lfs diff=lfs merge=lfs -text | ||
*.png filter=lfs diff=lfs merge=lfs -text | ||
*.jpg filter=lfs diff=lfs merge=lfs -text | ||
*.jpeg filter=lfs diff=lfs merge=lfs -text | ||
*.root filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
*.sublime-project | ||
*.sublime-workspace | ||
*.pyc | ||
*.log | ||
*.DS_Store | ||
*.egg-info | ||
*.pkl | ||
*.png | ||
*.root | ||
*.npy | ||
*.npz | ||
*.h5 | ||
*.hdf5 | ||
*.json | ||
*.yaml | ||
*.pb | ||
*.out | ||
*.parquet | ||
.env_*.sh | ||
.env_*.sh.tmp | ||
.coverage | ||
coverage*.xml | ||
requirements_user.txt | ||
__pycache__ | ||
dist | ||
build | ||
static | ||
docs/_build | ||
tmp | ||
store | ||
software | ||
data | ||
.data | ||
.law | ||
.setups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[submodule "modules/columnflow"] | ||
path = modules/columnflow | ||
url = ../columnflow.git | ||
|
||
[submodule "modules/cmsdb"] | ||
path = modules/cmsdb | ||
url = ../cmsdb.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,47 @@ | ||
# hh2bbtautau | ||
HH → bb𝜏𝜏 analysis with CMS | ||
# HH → bb𝜏𝜏 | ||
|
||
### Quickstart | ||
|
||
A couple test tasks are listed below. | ||
They might require a **valid voms proxy** for accessing input data. | ||
|
||
```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 st_tchannel_t \ | ||
--branch 0 | ||
|
||
# create a plot | ||
law run cf.PlotVariables \ | ||
--version v1 \ | ||
--datasets st_tchannel_t \ | ||
--producers features \ | ||
--variables jet1_pt \ | ||
--categories 1e \ | ||
--branch 0 | ||
|
||
# create a (test) datacard (CMS-style) | ||
law run cf.CreateDatacards \ | ||
--version v1 \ | ||
--producers features \ | ||
--inference-model test \ | ||
--workers 3 | ||
``` | ||
|
||
|
||
### 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# coding: utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# coding: utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Calibration methods for testing purposes. | ||
""" | ||
|
||
from columnflow.calibration import Calibrator, calibrator | ||
from columnflow.production.seeds import deterministic_seeds | ||
from columnflow.util import maybe_import | ||
from columnflow.columnar_util import set_ak_column | ||
|
||
np = maybe_import("numpy") | ||
ak = maybe_import("awkward") | ||
|
||
|
||
@calibrator( | ||
uses={ | ||
"nJet", "Jet.pt", "Jet.mass", | ||
}, | ||
produces={ | ||
"Jet.pt", "Jet.mass", | ||
"Jet.pt_jec_up", "Jet.mass_jec_up", | ||
"Jet.pt_jec_down", "Jet.mass_jec_down", | ||
}, | ||
) | ||
def jec_test(self: Calibrator, events: ak.Array, **kwargs) -> ak.Array: | ||
# a) "correct" Jet.pt by scaling four momenta by 1.1 (pt<30) or 0.9 (pt<=30) | ||
# b) add 4 new columns representing the effect of JEC variations | ||
|
||
# a) | ||
a_mask = ak.flatten(events.Jet.pt < 30) | ||
n_jet_pt = np.asarray(ak.flatten(events.Jet.pt)) | ||
n_jet_mass = np.asarray(ak.flatten(events.Jet.mass)) | ||
n_jet_pt[a_mask] *= 1.1 | ||
n_jet_pt[~a_mask] *= 0.9 | ||
n_jet_mass[a_mask] *= 1.1 | ||
n_jet_mass[~a_mask] *= 0.9 | ||
|
||
# b) | ||
set_ak_column(events, "Jet.pt_jec_up", events.Jet.pt * 1.05) | ||
set_ak_column(events, "Jet.mass_jec_up", events.Jet.mass * 1.05) | ||
set_ak_column(events, "Jet.pt_jec_down", events.Jet.pt * 0.95) | ||
set_ak_column(events, "Jet.mass_jec_down", events.Jet.mass * 0.95) | ||
|
||
return events | ||
|
||
|
||
@calibrator( | ||
uses={jec_test, deterministic_seeds}, | ||
produces={jec_test, deterministic_seeds}, | ||
) | ||
def test(self: Calibrator, events: ak.Array, **kwargs) -> ak.Array: | ||
self[jec_test](events, **kwargs) | ||
|
||
self[deterministic_seeds](events, **kwargs) | ||
|
||
return events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# coding: utf-8 |
Oops, something went wrong.