Skip to content
Closed

Btag #57

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
6 changes: 5 additions & 1 deletion Analysis/hh_bbww.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 3 additions & 1 deletion Analysis/histTupleDef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
87 changes: 87 additions & 0 deletions config/global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading