From e255e1cab6fa3f207ac5b7d12e1fd29453d82373 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Sun, 21 Jun 2026 21:17:01 +0200 Subject: [PATCH 01/10] fix #171: replace PlotKit submodule with redesigned cms-flaf/PlotKit; add cmsstyle to env --- .gitmodules | 2 +- PlotKit | 2 +- run_tools/mk_flaf_env.sh | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 2c0899961..66a2b1543 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "PlotKit"] path = PlotKit - url = git@github.com:kandrosov/PlotKit.git + url = git@github.com:cms-flaf/PlotKit.git diff --git a/PlotKit b/PlotKit index 0f2706e55..5a6820da8 160000 --- a/PlotKit +++ b/PlotKit @@ -1 +1 @@ -Subproject commit 0f2706e55d31f789ad6d005dca08f5133c928760 +Subproject commit 5a6820da86b9c767e3be102915ec7ac1ea810972 diff --git a/run_tools/mk_flaf_env.sh b/run_tools/mk_flaf_env.sh index 0d4d8cad9..77329012d 100755 --- a/run_tools/mk_flaf_env.sh +++ b/run_tools/mk_flaf_env.sh @@ -34,6 +34,7 @@ install() { run_cmd pip install bayesian-optimization run_cmd pip install yamllint run_cmd pip install black + run_cmd pip install cmsstyle # optional PlotKit backend (ROOT/cmsstyle); mplhep comes from LCG } install_gh_cli() { From 127cd3054ab7a882d4e5fc272cd3ba3bf56844c7 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Sun, 21 Jun 2026 21:19:02 +0200 Subject: [PATCH 02/10] docs: describe the redesigned PlotKit (mplhep/cmsstyle, standalone) (cms-flaf/FLAF#171) --- docs/concepts/architecture.md | 2 +- docs/glossary.md | 5 ++++- docs/reference/tasks.md | 8 +++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/concepts/architecture.md b/docs/concepts/architecture.md index 7847c0d6a..c34554bd9 100644 --- a/docs/concepts/architecture.md +++ b/docs/concepts/architecture.md @@ -27,7 +27,7 @@ tools with it. For example, HH→bb̄ττ looks like this: ```text HH_bbtautau/ ← the analysis repository (you clone this) ├── FLAF/ ← shared framework (submodule) -│ ├── PlotKit/ ← plotting helpers (submodule of FLAF) +│ ├── PlotKit/ ← plotting toolkit: matplotlib/mplhep (+ROOT/cmsstyle); submodule │ └── RunKit/ ← workflow utilities (vendored directory, not a submodule) ├── Corrections/ ← shared corrections (submodule) ├── StatInference/ ← shared stat tooling (submodule; HH analyses only) diff --git a/docs/glossary.md b/docs/glossary.md index 0366ce9af..94ff111e1 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -85,7 +85,10 @@ Framework and CMS-computing vocabulary, in plain terms. For the quick on-ramp ve testing set; production uses the full model. Defined in `phys_models.yaml`. **PlotKit** -: FLAF's plotting-helpers submodule. +: FLAF's plotting toolkit (a submodule of FLAF, [cms-flaf/PlotKit](https://github.com/cms-flaf/PlotKit)). + Renders the stacked CMS plots with **matplotlib + mplhep** by default (no ROOT required) and can + optionally render through **ROOT + cmsstyle**. It reads the analysis `config/plot/*.yaml` files and + can also run standalone (`python -m PlotKit.cli`). **Process** : A physics object built from one or more datasets (e.g. "TT", "DY", "signal") — what you plot and diff --git a/docs/reference/tasks.md b/docs/reference/tasks.md index 32ac78049..52b31fdfa 100644 --- a/docs/reference/tasks.md +++ b/docs/reference/tasks.md @@ -67,10 +67,16 @@ consume. - **Parameter:** `--producer-to-aggregate`. ### `HistPlotTask` -Produces the final **plots**. **Branches over variables** (one branch per variable). +Produces the final **plots** via the [PlotKit](https://github.com/cms-flaf/PlotKit) submodule +(matplotlib + mplhep by default; optional ROOT + cmsstyle). **Branches over variables** (one branch +per variable). - **Parameter:** `--variables` (string; restrict which variables). +Plot styling comes from the analysis `config/plot/*.yaml` files (`cms_stacked.yaml`, +`histograms.yaml`, `.yaml`) — unchanged from the legacy renderer. PlotKit can also render +outside FLAF; see its README for the standalone `python -m PlotKit.cli` entry point. + ## Statistical-inference tasks The limit/fit tasks (e.g. `PlotResonantLimits`, `PlotPullsAndImpacts`) come from the From c3f3cac558f391739cf6f4c3b2dc10b3c1f6449b Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 29 Jun 2026 20:39:28 +0200 Subject: [PATCH 03/10] advance PlotKit submodule: standalone CLI nested-file navigation + auto-discovery --- PlotKit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlotKit b/PlotKit index 5a6820da8..04131fd29 160000 --- a/PlotKit +++ b/PlotKit @@ -1 +1 @@ -Subproject commit 5a6820da86b9c767e3be102915ec7ac1ea810972 +Subproject commit 04131fd294dd149125d5c43cbcdf67114483015e From f9b8ae84cf4412dbf229b14885cf8e0d3c5d75d2 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 29 Jun 2026 20:55:01 +0200 Subject: [PATCH 04/10] advance PlotKit submodule: drop legacy C++ include/ headers (pure Python) --- PlotKit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlotKit b/PlotKit index 04131fd29..094c8de7b 160000 --- a/PlotKit +++ b/PlotKit @@ -1 +1 @@ -Subproject commit 04131fd294dd149125d5c43cbcdf67114483015e +Subproject commit 094c8de7b80ddfb0d0e8aae399b2c2f10394400d From 9d477f1b2b98acd3afb81ff1f4839e4177f8ba7c Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 29 Jun 2026 22:32:26 +0200 Subject: [PATCH 05/10] advance PlotKit submodule: signal 'bkg' scaling (normalise to summed background) --- PlotKit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlotKit b/PlotKit index 094c8de7b..2fb783e7c 160000 --- a/PlotKit +++ b/PlotKit @@ -1 +1 @@ -Subproject commit 094c8de7b80ddfb0d0e8aae399b2c2f10394400d +Subproject commit 2fb783e7ce4b0e2764777213f45ab0d80dd825a4 From 25e514dd2758d106c127524504ebed9349c92a7b Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 29 Jun 2026 22:33:35 +0200 Subject: [PATCH 06/10] docs: document signal_plot_scale bkg option for HistPlotTask --- docs/reference/tasks.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/reference/tasks.md b/docs/reference/tasks.md index 52b31fdfa..17d99525d 100644 --- a/docs/reference/tasks.md +++ b/docs/reference/tasks.md @@ -74,8 +74,11 @@ per variable). - **Parameter:** `--variables` (string; restrict which variables). Plot styling comes from the analysis `config/plot/*.yaml` files (`cms_stacked.yaml`, -`histograms.yaml`, `.yaml`) — unchanged from the legacy renderer. PlotKit can also render -outside FLAF; see its README for the standalone `python -m PlotKit.cli` entry point. +`histograms.yaml`, `.yaml`) — unchanged from the legacy renderer. Signal overlays are scaled by +`signal_plot_scale` in `global.yaml`: a fixed factor (e.g. `100`) **or** `bkg` to normalise each +signal's integral to the summed background (shape comparison; the legend then reads +`… (norm. to bkg)`). PlotKit can also render outside FLAF; see its README for the standalone +`python -m PlotKit.cli` entry point. ## Statistical-inference tasks From be96293f8b3071c37f0038bdb556f0a6a50b6361 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 29 Jun 2026 22:52:33 +0200 Subject: [PATCH 07/10] advance PlotKit submodule: address Copilot review (backend resolution, fallback guard, type hints) --- PlotKit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlotKit b/PlotKit index 2fb783e7c..eebe0bfb2 160000 --- a/PlotKit +++ b/PlotKit @@ -1 +1 @@ -Subproject commit 2fb783e7ce4b0e2764777213f45ab0d80dd825a4 +Subproject commit eebe0bfb2175715cf748b94292fd5a3efa032eb3 From c5da1f022757572e51887999afda09a7a8ca00cc Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 29 Jun 2026 22:57:31 +0200 Subject: [PATCH 08/10] advance PlotKit submodule to cms-flaf/PlotKit main (squash-merged #1) --- PlotKit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlotKit b/PlotKit index eebe0bfb2..b5f09e2c8 160000 --- a/PlotKit +++ b/PlotKit @@ -1 +1 @@ -Subproject commit eebe0bfb2175715cf748b94292fd5a3efa032eb3 +Subproject commit b5f09e2c82e123d85e8f7db28d5fb63fd10b2b0a From ca67b23ee3b699ab48f177dbfc32daab7c7b5422 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Tue, 30 Jun 2026 21:05:31 +0200 Subject: [PATCH 09/10] docs: document PlotKit_version override (FLAF/PlotKit sub-sub-module) in integration pipeline --- docs/ci/integration-pipeline.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/ci/integration-pipeline.md b/docs/ci/integration-pipeline.md index 915b60e94..e01ae1a0a 100644 --- a/docs/ci/integration-pipeline.md +++ b/docs/ci/integration-pipeline.md @@ -29,9 +29,12 @@ Repos with the trigger enabled: HH_bbtautau, HH_bbWW, H_mumu, FLAF, Corrections, ```text @cms-flaf-bot please test - https://github.com/cms-flaf/FLAF/pull/272 + - https://github.com/cms-flaf/PlotKit/pull/2 ``` Shorthands include `- _version=PR_`, a `…/pull/` URL, a `…/tree/` URL, and - `- gitlab_branch=` to run a non-default `flaf_integration` branch. + `- gitlab_branch=` to run a non-default `flaf_integration` branch. `PlotKit_version` + pins the `FLAF/PlotKit` sub-sub-module, which is switched after `FLAF` (so it overrides whatever + commit the requested `FLAF` pins). ## `integration_cfg.yaml` @@ -73,7 +76,9 @@ The shared trigger logic distinguishes: - **root packages** — repos with an `_active` variable (the analyses: HH_bbtautau, HH_bbWW, H_mumu); -- **packages** — repos with a `_version` but no `_active` (FLAF, Corrections, StatInference). +- **packages** — repos with a `_version` but no `_active` (FLAF, PlotKit, Corrections, + StatInference). `PlotKit` is a sub-sub-module (`FLAF/PlotKit`); the build switches it after + `FLAF`. Both may trigger the pipeline; the distinction matters only when editing the trigger logic. From 9cd62c25de896465b00781b7f1b3772a4b0f17ed Mon Sep 17 00:00:00 2001 From: Konstantin Date: Wed, 1 Jul 2026 08:22:16 +0200 Subject: [PATCH 10/10] advance PlotKit submodule to cms-flaf/PlotKit main (mathtext safety net, #2) --- PlotKit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlotKit b/PlotKit index b5f09e2c8..93c63b826 160000 --- a/PlotKit +++ b/PlotKit @@ -1 +1 @@ -Subproject commit b5f09e2c82e123d85e8f7db28d5fb63fd10b2b0a +Subproject commit 93c63b826f6681a7e6329dc2be32ee114cddc245