Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vbf datacards systs tt exploration #35

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/HHbbVV/postprocessing/CreateDatacard.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,6 @@ def createDatacardABCD(args, templates_dict, templates_summed, shape_vars):
if args.model_name is not None
else args.cards_dir
)

with open(f"{out_dir}/datacard.txt", "w") as f:
f.write(helpers.abcd_datacard_template.substitute(datacard_dict))

Expand Down
2 changes: 1 addition & 1 deletion src/HHbbVV/postprocessing/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def get_res_selection_regions(
nonres_vbf_scan_cuts = ["txbb", "thww"] # TODO: add more cuts being scanned over
res_scan_cuts = ["txbb", "thww", "leadingpt", "subleadingpt"]


nonres_sig_keys_ggf = [
"HHbbVV",
"ggHH_kl_2p45_kt_1_HHbbVV",
Expand All @@ -361,7 +362,6 @@ def get_res_selection_regions(
# "top_pt": ["TT"],
}


plot_sig_keys_nonres = [
"HHbbVV",
"VBFHHbbVV",
Expand Down
14 changes: 12 additions & 2 deletions src/HHbbVV/processors/bbVVSkimmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ def process(self, events: ak.Array):
)

skimmed_events["nGoodVBFJets"] = np.array(ak.sum(vbf_jet_mask, axis=1))
# Temp
skimmed_events["gen_weights"] = gen_weights
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this not be saved from the "single_weight" for loop below?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this branch has a lot of bad "quick fixes" for saving the weight information which should not be kept otherwise. So would we just erase the pull request?

Yea, that part is redundant I think.


# VBF ak4 Jet vars (pt, eta, phi, M, nGoodJets)
# if self._vbf_search:
Expand Down Expand Up @@ -452,7 +454,7 @@ def process(self, events: ak.Array):
msds = jmsr_shifted_vars["msoftdrop"][shift]
pnetms = jmsr_shifted_vars["particleNet_mass"][shift]

if self._save_all:
if self._save_all & False:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still want this?

cut = (
(pnetms[~bb_mask] >= self.preselection["VVparticleNet_mass"][0])
+ (msds[~bb_mask] >= self.preselection["VVparticleNet_mass"][0])
Expand Down Expand Up @@ -634,6 +636,14 @@ def process(self, events: ak.Array):

# TODO: need to be careful about the sum of gen weights used for the LHE/QCDScale uncertainties
logger.debug("weights ", weights._weights.keys())

# TEMP: save each individual weight
skimmed_events["L1EcalPrefiring"] = ak.to_numpy(events.L1PreFiringWeight.Nom)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this not be saved from the "single_weight" for loop below?


for key in weights._weights.keys():
print(f"single_weight_{key}")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the print() can be removed here.

skimmed_events[f"single_weight_{key}"] = weights.partial_weight([key])

for systematic in systematics:
if systematic in weights.variations:
weight = weights.weight(modifier=systematic)
Expand Down Expand Up @@ -1014,7 +1024,7 @@ def getVBFVars(
# int list representing the number of passing vbf jets per event
vbfVars[f"nGoodVBFJets"] = n_good_vbf_jets_sorted_pt.to_numpy()

adding_bdt_vars = True
adding_bdt_vars = False
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to false - can you confirm that we don't need these in the processor since they can be added in postprocessing?

if adding_bdt_vars == True:
# Adapted from HIG-20-005 ggF_Killer 6.2.2
# https://coffeateam.github.io/coffea/api/coffea.nanoevents.methods.vector.PtEtaPhiMLorentzVector.html
Expand Down
Loading