diff --git a/Analysis/hh_bbww.py b/Analysis/hh_bbww.py index 2e42832..ad43629 100644 --- a/Analysis/hh_bbww.py +++ b/Analysis/hh_bbww.py @@ -78,13 +78,17 @@ def GetBTagWeight(global_cfg_dict, cat, applyBtag=False): return f"{btag_weight}*{btagshape_weight}" -def GetWeight(channel, cat, boosted_categories): # do you need all these args? +def GetWeight( + channel, cat, boosted_categories, apply_btag_shape_weights=False +): # do you need all these args? # weights_to_apply = ["weight_MC_Lumi_pu", "ExtraDYWeight"] weights_to_apply = ["weight_MC_Lumi_pu"] total_weight = "*".join(weights_to_apply) for lep_index in [1, 2]: total_weight = f"{total_weight} * {GetLepWeight(lep_index)}" total_weight = f"{total_weight} * {GetTriggerWeight()}" + if apply_btag_shape_weights: + total_weight = f"{total_weight} * weight_bTagShape_Central" return total_weight diff --git a/Analysis/histTupleDef.py b/Analysis/histTupleDef.py index 780a03f..fc0844a 100644 --- a/Analysis/histTupleDef.py +++ b/Analysis/histTupleDef.py @@ -87,9 +87,11 @@ def DefineWeightForHistograms( categories = global_params["categories"] boosted_categories = global_params.get("boosted_categories", []) process_group = global_params["process_group"] + # can only apply btag shape weights if they were corrected to preserve integral of distribution + apply_btag_shape_weights = global_params.get("correct_btagShape_weights", False) total_weight_expression = ( # channel, cat, boosted_categories --> these are not needed in the GetWeight function therefore I just put some placeholders - analysis.GetWeight("", "", boosted_categories) + analysis.GetWeight("", "", boosted_categories, apply_btag_shape_weights=apply_btag_shape_weights) if process_group != "data" else "1" ) # are we sure? diff --git a/DeepHME b/DeepHME index 13f95ac..8371521 160000 --- a/DeepHME +++ b/DeepHME @@ -1 +1 @@ -Subproject commit 13f95accfbeca5c177d3a74bb121c33df316c961 +Subproject commit 8371521797f68ee4a547741729ec5bffc9cb3633 diff --git a/FLAF b/FLAF index 523c23c..8b4a6f1 160000 --- a/FLAF +++ b/FLAF @@ -1 +1 @@ -Subproject commit 523c23cefb49100dc29913af7707ba3672170711 +Subproject commit 8b4a6f11d04878950098d7fef3f2064aa7d9dc0f diff --git a/config/global.yaml b/config/global.yaml index 3ff961c..725f265 100644 --- a/config/global.yaml +++ b/config/global.yaml @@ -43,6 +43,8 @@ muonID_WP_for_triggerSF: "Tight" # only medium or tight for trigger SF, both iso muIDWP: "Tight" muIsoWP: "Loose" +correct_btagShape_weights: True + treeName: "Events" nPbPerFile: 2_000 # 2fb-1 per split data file @@ -244,6 +246,91 @@ payload_producers: awkward_based: True uproot_stepsize: '50MB' dependencies: + HMEinDNNBins: + producers_module_name: Analysis.HMEinDNNBins + producer_name: HMEinDNNBins + dependencies: + - SingleLep_DeepHME + - DoubleLep_DeepHME + - DNNParametric_DL_NoHME # If these change remember to change the branch name in the python script + - DNNParametric_SL_NoHME + n_cpus: 4 + max_runtime: 2.0 + cmssw_env: False + awkward_based: False + virtual_payload: True # Add support to avoid running payload as a cache, rather just running it in RAM live (if quick enough) + masses: + - 300 + - 600 + - 800 + bins: + - [ 0p0, 0p2 ] + - [ 0p2, 0p4 ] + - [ 0p4, 0p6 ] + - [ 0p6, 0p8 ] + - [ 0p8, 1p0 ] + columns: + - HME_mass_DL_DNN_M300_0p0_0p2 + - HME_mass_DL_DNN_M300_0p2_0p4 + - HME_mass_DL_DNN_M300_0p4_0p6 + - HME_mass_DL_DNN_M300_0p6_0p8 + - HME_mass_DL_DNN_M300_0p8_1p0 + + - HME_mass_DL_DNN_M600_0p0_0p2 + - HME_mass_DL_DNN_M600_0p2_0p4 + - HME_mass_DL_DNN_M600_0p4_0p6 + - HME_mass_DL_DNN_M600_0p6_0p8 + - HME_mass_DL_DNN_M600_0p8_1p0 + + - HME_mass_DL_DNN_M800_0p0_0p2 + - HME_mass_DL_DNN_M800_0p2_0p4 + - HME_mass_DL_DNN_M800_0p4_0p6 + - HME_mass_DL_DNN_M800_0p6_0p8 + - HME_mass_DL_DNN_M800_0p8_1p0 + + + - HME_mass_SL_DNN_M300_0p0_0p2 + - HME_mass_SL_DNN_M300_0p2_0p4 + - HME_mass_SL_DNN_M300_0p4_0p6 + - HME_mass_SL_DNN_M300_0p6_0p8 + - HME_mass_SL_DNN_M300_0p8_1p0 + + - HME_mass_SL_DNN_M600_0p0_0p2 + - HME_mass_SL_DNN_M600_0p2_0p4 + - HME_mass_SL_DNN_M600_0p4_0p6 + - HME_mass_SL_DNN_M600_0p6_0p8 + - HME_mass_SL_DNN_M600_0p8_1p0 + + - HME_mass_SL_DNN_M800_0p0_0p2 + - HME_mass_SL_DNN_M800_0p2_0p4 + - HME_mass_SL_DNN_M800_0p4_0p6 + - HME_mass_SL_DNN_M800_0p6_0p8 + - HME_mass_SL_DNN_M800_0p8_1p0 + BtagShape: + producers_module_name: BtagShapeProducer + producer_name: BtagShapeProducer + save_as: json + columns : [] + lepton_categories: + - e + - mu + - eE + - eMu + - muMu + jet_multiplicities: + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + n_cpus: 4 + max_runtime: 8.0 + cmssw_env: False + awkward_based: True + uproot_stepsize: '50MB' + dependencies: region: All region_default: SR