Skip to content

Commit

Permalink
Merge branch 'update-parT' of github.com:LPC-HH/HH4b into update-parT
Browse files Browse the repository at this point in the history
  • Loading branch information
cmantill committed Sep 27, 2024
2 parents 51994e7 + c61d3aa commit 9beae06
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
26 changes: 18 additions & 8 deletions src/HH4b/boosted/TrainBDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
txbb_preselection = {
"bbFatJetPNetTXbb": 0.3,
"bbFatJetPNetTXbbLegacy": 0.8,
"bbFatJetParTTXbb": 0.3
"bbFatJetParTTXbb": 0.3,
}
msd1_preselection = {
"bbFatJetPNetTXbb": 40,
Expand All @@ -68,7 +68,7 @@
msd2_preselection = {
"bbFatJetPNetTXbb": 30,
"bbFatJetPNetTXbbLegacy": 0,
"bbFatJetParTTXbb": 30,
"bbFatJetParTTXbb": 30,
}

control_plot_vars = [
Expand Down Expand Up @@ -130,9 +130,9 @@ def get_legtitle(txbb_str):
title += "\n" + "PNet 103X"

title += "\n" + r"m$_{reg}$ > 50 GeV"
if "Legacy" not in txbb_str:
title += "\n" + r"m$_{SD}^{0}$ > "+f"{msd1_preselection[txbb_str]} GeV"
title += "\n" + r"m$_{SD}^{1}$ > "+f"{msd2_preselection[txbb_str]} GeV"
if "Legacy" not in txbb_str:
title += "\n" + r"m$_{SD}^{0}$ > " + f"{msd1_preselection[txbb_str]} GeV"
title += "\n" + r"m$_{SD}^{1}$ > " + f"{msd2_preselection[txbb_str]} GeV"

return title

Expand All @@ -155,7 +155,13 @@ def apply_cuts(events_dict, txbb_str, mass_str):
mass2 = events_dict[key][mass_str][1]
# add msd > 40 cut for the first jet FIXME: replace this by the trigobj matched jet
events_dict[key] = events_dict[key][
(pt1 > 250) & (pt2 > 250) & (txbb1 > txbb_preselection[txbb_str]) & (msd1 > msd1_preselection[txbb_str]) & (msd2 > msd2_preselection[txbb_str]) & (mass1 > 50) & (mass2 > 50)
(pt1 > 250)
& (pt2 > 250)
& (txbb1 > txbb_preselection[txbb_str])
& (msd1 > msd1_preselection[txbb_str])
& (msd2 > msd2_preselection[txbb_str])
& (mass1 > 50)
& (mass2 > 50)
].copy()

return events_dict
Expand Down Expand Up @@ -1133,7 +1139,9 @@ def main(args):
if args.apply_cuts:
# apply cuts
events_dict_years[year] = apply_cuts(
events_dict_years[year], args.txbb_str, args.mass_str,
events_dict_years[year],
args.txbb_str,
args.mass_str,
)

# concatenate data
Expand Down Expand Up @@ -1265,7 +1273,9 @@ def main(args):
)
if args.apply_cuts:
events_dict[year] = apply_cuts(
events_dict[year], args.txbb_str, args.mass_str,
events_dict[year],
args.txbb_str,
args.mass_str,
)

plot_allyears(
Expand Down
7 changes: 3 additions & 4 deletions src/HH4b/postprocessing/PostProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import argparse
import importlib
import logging
import logging.config
import pprint
from collections import OrderedDict
from pathlib import Path
Expand All @@ -26,6 +28,7 @@
txbbsfs_decorr_pt_bins,
txbbsfs_decorr_txbb_wps,
)
from HH4b.log_utils import log_config
from HH4b.postprocessing import (
Region,
combine_run3_samples,
Expand All @@ -35,10 +38,6 @@
)
from HH4b.utils import ShapeVar, check_get_jec_var, get_var_mapping, singleVarHist

import logging
import logging.config
from HH4b.log_utils import log_config

log_config["root"]["level"] = "INFO"
logging.config.dictConfig(log_config)
logger = logging.getLogger(__name__)
Expand Down

0 comments on commit 9beae06

Please sign in to comment.