Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 15, 2023
1 parent 03bfb49 commit 0f8a657
Showing 1 changed file with 30 additions and 25 deletions.
55 changes: 30 additions & 25 deletions src/HHbbVV/postprocessing/PostProcessVBFtesting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"postprocessing.apply_weights(events_dict, year, cutflow)\n",
"bb_masks = postprocessing.bb_VV_assignment(events_dict)\n",
"# events_dict[sig_key] = postprocessing.postprocess_lpsfs(events_dict[sig_key])\n",
"cutflow\n"
"cutflow"
]
},
{
Expand Down Expand Up @@ -226,48 +226,54 @@
"for df in events_dict.values():\n",
" ptlabel = \"_JES_up\"\n",
" mlabel = \"_JMS_down\"\n",
" bb_mask = (\n",
" df[(\"ak8FatJetParticleNetMD_Txbb\", 0)]\n",
" > df[(\"ak8FatJetParticleNetMD_Txbb\", 1)]\n",
" )\n",
" bb_mask = df[(\"ak8FatJetParticleNetMD_Txbb\", 0)] > df[(\"ak8FatJetParticleNetMD_Txbb\", 1)]\n",
" print(df[f\"ak8FatJetPt{ptlabel}\"])\n",
" print(df[f\"ak8FatJetPt{ptlabel}\"][0])\n",
" bbJet = vector.array(\n",
" {\n",
" \"pt\": np.where(bb_mask, df[f\"ak8FatJetPt{ptlabel}\"][0], df[f\"ak8FatJetPt{ptlabel}\"][1]),\n",
" \"phi\": np.where(bb_mask, df[\"ak8FatJetPhi\"][0], df[\"ak8FatJetPhi\"][1]),\n",
" \"eta\": np.where(bb_mask, df[\"ak8FatJetEta\"][0], df[\"ak8FatJetEta\"][1]),\n",
" \"M\": np.where(bb_mask, df[f\"ak8FatJetParticleNetMass{mlabel}\"][0], df[f\"ak8FatJetParticleNetMass{mlabel}\"][1]),\n",
" \"M\": np.where(\n",
" bb_mask,\n",
" df[f\"ak8FatJetParticleNetMass{mlabel}\"][0],\n",
" df[f\"ak8FatJetParticleNetMass{mlabel}\"][1],\n",
" ),\n",
" }\n",
" )\n",
"\n",
" VVJet = vector.array(\n",
" {\n",
" \"pt\": np.where(~bb_mask, df[f\"ak8FatJetPt{ptlabel}\"][0], df[f\"ak8FatJetPt{ptlabel}\"][1]),\n",
" \"pt\": np.where(\n",
" ~bb_mask, df[f\"ak8FatJetPt{ptlabel}\"][0], df[f\"ak8FatJetPt{ptlabel}\"][1]\n",
" ),\n",
" \"phi\": np.where(~bb_mask, df[\"ak8FatJetPhi\"][0], df[\"ak8FatJetPhi\"][1]),\n",
" \"eta\": np.where(~bb_mask, df[\"ak8FatJetEta\"][0], df[\"ak8FatJetEta\"][1]),\n",
" \"M\": np.where(~bb_mask, df[f\"ak8FatJetParticleNetMass{mlabel}\"][0], df[f\"ak8FatJetParticleNetMass{mlabel}\"][1]),\n",
" \"M\": np.where(\n",
" ~bb_mask,\n",
" df[f\"ak8FatJetParticleNetMass{mlabel}\"][0],\n",
" df[f\"ak8FatJetParticleNetMass{mlabel}\"][1],\n",
" ),\n",
" }\n",
" )\n",
"\n",
"\n",
" vbf1 = vector.array(\n",
" {\n",
" \"pt\": df[('VBFJetPt', 0)],\n",
" \"phi\": df[('VBFJetPhi', 0)],\n",
" \"eta\": df[('VBFJetEta', 0)],\n",
" \"M\": df[('VBFJetMass', 0)],\n",
" }\n",
" )\n",
" {\n",
" \"pt\": df[(\"VBFJetPt\", 0)],\n",
" \"phi\": df[(\"VBFJetPhi\", 0)],\n",
" \"eta\": df[(\"VBFJetEta\", 0)],\n",
" \"M\": df[(\"VBFJetMass\", 0)],\n",
" }\n",
" )\n",
"\n",
" vbf2 = vector.array(\n",
" {\n",
" \"pt\": df[('VBFJetPt', 1)],\n",
" \"phi\": df[('VBFJetPhi', 1)],\n",
" \"eta\": df[('VBFJetEta', 1)],\n",
" \"M\": df[('VBFJetMass', 1)],\n",
" }\n",
" )\n",
" {\n",
" \"pt\": df[(\"VBFJetPt\", 1)],\n",
" \"phi\": df[(\"VBFJetPhi\", 1)],\n",
" \"eta\": df[(\"VBFJetEta\", 1)],\n",
" \"M\": df[(\"VBFJetMass\", 1)],\n",
" }\n",
" )\n",
"\n",
" jj = vbf1 + vbf2\n",
"\n",
Expand Down Expand Up @@ -354,7 +360,6 @@
"}\n",
"\n",
"\n",
"\n",
"# variable to plot\n",
"shape_vars = [\n",
" postprocessing.ShapeVar(\n",
Expand Down Expand Up @@ -393,7 +398,7 @@
" weight_shifts={},\n",
" jshift=\"\",\n",
" plot_shifts=False,\n",
" lpsfs=False,#1.23.5\n",
" lpsfs=False, # 1.23.5\n",
" show=True,\n",
")\n",
"cutflow"
Expand Down

0 comments on commit 0f8a657

Please sign in to comment.