From 0d2230df20f6984e976fe316c336a17caf345846 Mon Sep 17 00:00:00 2001 From: matt-komm Date: Wed, 15 Mar 2023 13:22:40 +0000 Subject: [PATCH] working ntau samples --- histo/sample.py | 5 +++-- limits/make_hists.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/histo/sample.py b/histo/sample.py index f8e13a3..f9ed0c8 100644 --- a/histo/sample.py +++ b/histo/sample.py @@ -99,7 +99,7 @@ def __init__(self, name, ntuple_path, paths, isMC=True, year="2016", cut=None, l looseMuons_weight_reco_nominal*looseMuons_weight_id_nominal*\ looseElectrons_weight_id_nominal*\ puweight_nominal*genweight*hnlJet_track_weight_nominal*lepton2_track_nominal*\ - {lumi[year]}*1000.0*{xsec}/{self.sum_weight}") + {lumi[year]}*1000.0*{xsec}/{self.sum_weight}") #NB: weight will be 1. for HNL #self.rdf = self.rdf.Define("weightNominalCorrectedUp", "weightNominal*hnlJet_track_weight_adapted_nominal") @@ -114,7 +114,8 @@ def __init__(self, name, ntuple_path, paths, isMC=True, year="2016", cut=None, l weightNormSum = 1.0 self.rdf = self.rdf.Define("weightNominalHNL_{}".format(coupling), f"{filtereff}*weightNominal*LHEWeights_coupling_{coupling}/{weightNormSum}") else: - self.rdf = self.rdf.Define("weightNominalHNL_{}".format(coupling), f"weightNominal*LHEWeights_coupling_{coupling}/{self.sum_weightHNL[coupling]}") + weightNormSum = self.yieldsHNL[name+"-"+str(year)]['LHEWeights_coupling_'+str(coupling)] + self.rdf = self.rdf.Define("weightNominalHNL_{}".format(coupling), f"weightNominal*LHEWeights_coupling_{coupling}/{weightNormSum}") else: self.rdf = self.rdf.Define("weightNominal", "1") diff --git a/limits/make_hists.py b/limits/make_hists.py index 280ad5b..889d52d 100644 --- a/limits/make_hists.py +++ b/limits/make_hists.py @@ -261,6 +261,7 @@ def make_hist(process, category_variable, thresholds, weight, cut, region, syst #parser.add_argument("--ntuple_path", default="/nfs/dust/cms/user/mkomm/HNL/ntuples/24May20") #parser.add_argument("--output_path", default="/nfs/dust/cms/user/mkomm/HNL/histo/limits/hists") +#parser.add_argument("--ntuple_path", default="/vols/cms/hsfar/nanoAOD_friends/19Jan23") parser.add_argument("--ntuple_path", default="/vols/cms/hsfar/nanoAOD_friends/09Mar23") parser.add_argument("--output_path", default="/vols/cms/mkomm/HNL/histo/limits/hists")