Skip to content

Commit

Permalink
vbf templates script
Browse files Browse the repository at this point in the history
  • Loading branch information
rkansal47 committed Mar 28, 2024
1 parent eec88c4 commit 1a0f8c7
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/HHbbVV/postprocessing/CreateDatacard.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,6 @@
samples=nonres_sig_keys,
samples_corr=False,
),
# TODO: separate into individual
"JES": Syst(name="CMS_scale_j", prior="shape", samples=all_mc),
"txbb": Syst(
name=f"{CMS_PARAMS_LABEL}_PNetHbbScaleFactors_correlated",
prior="shape",
Expand All @@ -306,6 +304,8 @@
samples=all_mc,
uncorr_years=["2016APV", "2016", "2017"],
),
# TODO: separate into individual
"JES": Syst(name="CMS_scale_j", prior="shape", samples=all_mc),
"JER": Syst(name="CMS_res_j", prior="shape", samples=all_mc),
"JMS": Syst(name=f"{CMS_PARAMS_LABEL}_jms", prior="shape", samples=all_mc),
"JMR": Syst(name=f"{CMS_PARAMS_LABEL}_jmr", prior="shape", samples=all_mc),
Expand Down
44 changes: 42 additions & 2 deletions src/HHbbVV/postprocessing/bash_scripts/BDTPlots.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,49 @@
#!/bin/bash
# shellcheck disable=SC2086,SC2043

####################################################################################################
# BDT Sculpting plots
# Author: Raghav Kansal
####################################################################################################

MAIN_DIR="../../.."
TAG=23Nov7BDTSculpting
data_dir="$MAIN_DIR/../data/skimmer/24Mar14UpdateData"
bdt_preds_dir="$data_dir/24_03_07_new_samples_max_depth_5/inferences"
TAG=""


options=$(getopt -o "" --long "tag:" -- "$@")
eval set -- "$options"

while true; do
case "$1" in
--tag)
shift
TAG=$1
;;
--)
shift
break;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
shift
done

if [[ -z $TAG ]]; then
echo "Tag required using the --tag option. Exiting"
exit 1
fi

for year in 2016APV 2016 2017 2018
do
python postprocessing.py --year $year --data-dir "$MAIN_DIR/../data/skimmer/Feb24/" --signal-data-dir "$MAIN_DIR/../data/skimmer/Jun10/" --bdt-preds-dir "$MAIN_DIR/../data/skimmer/Feb24/23_05_12_multiclass_rem_feats_3/inferences" --no-lp-sf-all-years --sig-samples GluGluToHHTobbVV_node_cHHH1 --bg-keys QCD --bdt-plots --plot-dir "$MAIN_DIR/plots/PostProcessing/$TAG"
python postprocessing.py --year $year --data-dir $data_dir --bdt-preds-dir $bdt_preds_dir --no-lp-sf-all-years \
--sig-samples GluGluToHHTobbVV_node_cHHH1 --bg-keys QCD TT "Z+Jets" \
--bdt-plots --plot-dir "$MAIN_DIR/plots/PostProcessing/$TAG"
done
48 changes: 48 additions & 0 deletions src/HHbbVV/postprocessing/bash_scripts/VBFTemplates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
# shellcheck disable=SC2086,SC2043

####################################################################################################
# Script for creating VBF templates
# Author: Raghav Kansal
####################################################################################################

MAIN_DIR="../../.."
data_dir="/ceph/cms/store/user/annava/projects/HHbbVV/24Mar5AllYears/"
TAG=""


options=$(getopt -o "" --long "tag:" -- "$@")
eval set -- "$options"

while true; do
case "$1" in
--tag)
shift
TAG=$1
;;
--)
shift
break;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
shift
done

if [[ -z $TAG ]]; then
echo "Tag required using the --tag option. Exiting"
exit 1
fi

for year in 2016APV 2016 2017 2018
do
python -u postprocessing.py --year $year --data-dir "$data_dir" --templates \
--plot-dir "${MAIN_DIR}/plots/PostProcessing/$TAG" \
--template-dir "templates/$TAG" --plot-shifts --vbf --nonres-vbf-thww-wp 0.945
done
2 changes: 1 addition & 1 deletion src/HHbbVV/postprocessing/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ def plot_bdt_sculpting(
cuts = [0, 0.1, 0.5, 0.9, 0.95]
# bdtvars = ["", "TT", "VJets"]
bdtvars = [""]
plot_keys = ["QCD", "HHbbVV"]
plot_keys = ["QCD", "TT", "Z+Jets", "HHbbVV"]

shape_var = ShapeVar(
var="bbFatJetParticleNetMass", label=r"$m^{bb}_{reg}$ (GeV)", bins=[20, 50, 250]
Expand Down

0 comments on commit 1a0f8c7

Please sign in to comment.