|
8 | 8 | "source": [
|
9 | 9 | "import pyhf\n",
|
10 | 10 | "import json\n",
|
11 |
| - "import copy\n", |
12 | 11 | "import numpy as np\n",
|
13 | 12 | "import matplotlib.pyplot as plt\n",
|
14 | 13 | "\n",
|
15 | 14 | "%matplotlib inline"
|
16 | 15 | ]
|
17 | 16 | },
|
| 17 | + { |
| 18 | + "cell_type": "markdown", |
| 19 | + "metadata": {}, |
| 20 | + "source": [ |
| 21 | + "## Download the Model" |
| 22 | + ] |
| 23 | + }, |
| 24 | + { |
| 25 | + "cell_type": "markdown", |
| 26 | + "metadata": {}, |
| 27 | + "source": [ |
| 28 | + "For this example we'll download the archive of probability models for the ATLAS analysis [JHEP 12 (2019) 060, 2019](https://inspirehep.net/literature/1748602) from its [HEPData page](https://www.hepdata.net/record/ins1748602) using its [specific DOI](https://www.hepdata.net/record/resource/1935437?landing_page=true). You can download this multiple ways, but for simplicity we'll download it using the `pyhf contrib download` command" |
| 29 | + ] |
| 30 | + }, |
18 | 31 | {
|
19 | 32 | "cell_type": "code",
|
20 | 33 | "execution_count": 2,
|
|
24 | 37 | "name": "stdout",
|
25 | 38 | "output_type": "stream",
|
26 | 39 | "text": [
|
27 |
| - "RegionA/BkgOnly.json\n" |
| 40 | + "\u001b[01;34m1Lbb-probability-models\u001b[00m\n", |
| 41 | + "├── README.md\n", |
| 42 | + "├── \u001b[01;34mRegionA\u001b[00m\n", |
| 43 | + "│ ├── BkgOnly.json\n", |
| 44 | + "│ └── patchset.json\n", |
| 45 | + "├── \u001b[01;34mRegionB\u001b[00m\n", |
| 46 | + "│ ├── BkgOnly.json\n", |
| 47 | + "│ └── patchset.json\n", |
| 48 | + "└── \u001b[01;34mRegionC\u001b[00m\n", |
| 49 | + " ├── BkgOnly.json\n", |
| 50 | + " └── patchset.json\n", |
| 51 | + "\n", |
| 52 | + "3 directories, 7 files\n" |
28 | 53 | ]
|
29 | 54 | }
|
30 | 55 | ],
|
31 | 56 | "source": [
|
32 |
| - "!curl -sL https://doi.org/10.17182/hepdata.89408.v1/r2 | tar -O -xzv RegionA/BkgOnly.json > lhood.json" |
| 57 | + "! pyhf contrib download https://doi.org/10.17182/hepdata.89408.v3/r2 1Lbb-probability-models\n", |
| 58 | + "! tree 1Lbb-probability-models" |
33 | 59 | ]
|
34 | 60 | },
|
35 | 61 | {
|
36 | 62 | "cell_type": "markdown",
|
37 | 63 | "metadata": {},
|
38 | 64 | "source": [
|
39 |
| - "### Create the Model and Fit it\n" |
| 65 | + "## Create the Model and Fit it\n" |
40 | 66 | ]
|
41 | 67 | },
|
42 | 68 | {
|
|
46 | 72 | "outputs": [],
|
47 | 73 | "source": [
|
48 | 74 | "def make_model(channel_list):\n",
|
49 |
| - " spec = json.load(open(\"lhood.json\"))\n", |
50 |
| - " spec = copy.copy(spec)\n", |
| 75 | + " spec = json.load(open(\"1Lbb-probability-models/RegionA/BkgOnly.json\"))\n", |
51 | 76 | " spec[\"channels\"] = [c for c in spec[\"channels\"] if c[\"name\"] in channel_list]\n",
|
52 | 77 | " spec[\"measurements\"][0][\"config\"][\"poi\"] = \"lumi\"\n",
|
53 | 78 | "\n",
|
|
186 | 211 | ],
|
187 | 212 | "metadata": {
|
188 | 213 | "kernelspec": {
|
189 |
| - "display_name": "Python 3", |
| 214 | + "display_name": "Python 3 (ipykernel)", |
190 | 215 | "language": "python",
|
191 | 216 | "name": "python3"
|
192 | 217 | },
|
|
200 | 225 | "name": "python",
|
201 | 226 | "nbconvert_exporter": "python",
|
202 | 227 | "pygments_lexer": "ipython3",
|
203 |
| - "version": "3.7.5" |
| 228 | + "version": "3.9.6" |
204 | 229 | }
|
205 | 230 | },
|
206 | 231 | "nbformat": 4,
|
|
0 commit comments