Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rkansal47 committed Jul 22, 2024
2 parents e62d4d6 + 37523d1 commit a5bc573
Show file tree
Hide file tree
Showing 11 changed files with 1,642 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ jobs:
--durations=20
- name: Upload coverage report
uses: codecov/codecov-action@v4.4.1
uses: codecov/codecov-action@v4.5.0
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ ci:

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: "24.3.0"
rev: "24.4.2"
hooks:
- id: black-jupyter
args: [--line-length=100]

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: "1.18.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.*]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
rev: "v4.6.0"
hooks:
- id: check-added-large-files
args: ["--maxkb=2000"]
Expand Down Expand Up @@ -48,7 +48,7 @@ repos:
# args: [--prose-wrap=always]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.4"
rev: "v0.5.0"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -64,7 +64,7 @@ repos:
# - pytest

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
rev: "v2.3.0"
hooks:
- id: codespell
types_or: [python, rst, markdown]
Expand All @@ -84,13 +84,13 @@ repos:
# exclude: .pre-commit-config.yaml

- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.16"
rev: "v0.18"
hooks:
- id: validate-pyproject
additional_dependencies: ["validate-pyproject-schema-store[all]"]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.28.1"
rev: "0.28.6"
hooks:
- id: check-dependabot
- id: check-github-workflows
Expand Down
4 changes: 2 additions & 2 deletions inference_scans/run_law.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ while true; do
shift
done

# export DHI_CMS_POSTFIX="Supplementary"
export DHI_CMS_POSTFIX=""

common_args="--file-types pdf,png --unblinded $unblinded --version $VERSION $printdeps --remove-output $rmoutput,a,y --campaign run2 --use-snapshot True --cms-postfix Preliminary"
common_args="--file-types pdf,png --unblinded $unblinded --version $VERSION $printdeps --remove-output $rmoutput,a,y --campaign run2 --use-snapshot True"
custom_args="--rMax 200 --setParameterRanges r_qqhh=-40,1000:r_gghh=-40,200"


Expand Down
46 changes: 35 additions & 11 deletions paper/limit_plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"import matplotlib.patches as patches\n",
"import matplotlib.ticker as mticker\n",
"import mplhep as hep\n",
"import numpy as np\n",
"\n",
"plt.style.use(hep.style.CMS)\n",
"hep.style.use(\"CMS\")\n",
Expand All @@ -26,7 +27,7 @@
"source": [
"from pathlib import Path\n",
"\n",
"plot_dir = Path(\"plots/Limits/24Jun2\")\n",
"plot_dir = Path(\"plots/Limits/24Jun5\")\n",
"plot_dir.mkdir(parents=True, exist_ok=True)"
]
},
Expand All @@ -36,17 +37,32 @@
"metadata": {},
"outputs": [],
"source": [
"observed_values = [142, 1.1]\n",
"expected_medians = [69, 0.9]\n",
"expected_68_lows = [50, 0.7]\n",
"expected_68_highs = [80, 1.1]\n",
"expected_95_lows = [40, 0.5]\n",
"expected_95_highs = [100, 1.3]\n",
"limits = [\n",
" # 95%-, 68%-, 50%, 68%+, 95%+, observed\n",
" [32.9, 45.9, 69.1, 113, 182, 142],\n",
" [0.413, 0.585, 0.903, 1.48, 2.4, 1.06],\n",
"]\n",
"\n",
"limits = np.array(limits)\n",
"\n",
"observed_values = limits[:, 5]\n",
"expected_medians = limits[:, 2]\n",
"expected_68_lows = limits[:, 1]\n",
"expected_68_highs = limits[:, 3]\n",
"expected_95_lows = limits[:, 0]\n",
"expected_95_highs = limits[:, 4]\n",
"\n",
"limit_labels = [\n",
" r\"$\\sigma(pp \\rightarrow HH)$ $(\\kappa_{2V} = 1)$\",\n",
" r\"$\\sigma(pp \\rightarrow qqHH)$ $(\\kappa_{2V} = 0)$\",\n",
"]"
"]\n",
"\n",
"\n",
"def format_limit(number):\n",
" if number > 10:\n",
" return f\"{number:.0f}\" # No decimals\n",
" else:\n",
" return f\"{number:.1f}\" # One decimal"
]
},
{
Expand All @@ -64,7 +80,7 @@
"y_lim = top_space + limit_height * len(observed_values)\n",
"dashed = (0, (2, 2))\n",
"\n",
"xlims = [0.1, 200]\n",
"xlims = [0.1, 250]\n",
"\n",
"\n",
"plt.rcParams.update({\"text.usetex\": False, \"font.size\": 24})\n",
Expand Down Expand Up @@ -129,7 +145,7 @@
" ax.text(\n",
" textx,\n",
" y_label - 0.06,\n",
" f\"Expected: {expected_medians[i]}\\nObserved: {observed_values[i]}\",\n",
" f\"Expected: {format_limit(expected_medians[i])}\\nObserved: {format_limit(observed_values[i])}\",\n",
" verticalalignment=\"center\",\n",
" horizontalalignment=\"left\",\n",
" transform=ax.get_yaxis_transform(),\n",
Expand Down Expand Up @@ -190,12 +206,20 @@
"# Configure the x-axis to avoid scientific notation\n",
"ax.xaxis.set_major_formatter(plt.ScalarFormatter())\n",
"ax.xaxis.get_major_formatter().set_scientific(False)\n",
"ax.xaxis.set_major_formatter(mticker.FormatStrFormatter(\"%g\")) # plot decimals as needed\n",
"\n",
"hep.cms.label(label=\"Preliminary\", ax=ax, data=True, lumi=138, com=13)\n",
"hep.cms.label(label=None, ax=ax, data=True, lumi=138, com=13)\n",
"plt.tight_layout()\n",
"plt.savefig(plot_dir / \"limits.pdf\", bbox_inches=\"tight\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit a5bc573

Please sign in to comment.