diff --git a/Preselection/data/samples.json b/Preselection/data/samples.json index fb83073..868a508 100644 --- a/Preselection/data/samples.json +++ b/Preselection/data/samples.json @@ -1,5 +1,6 @@ { "HH_ggTauTau" : { + "resonant" : true, "fpo" : 1, "process_id" : -1, "2016" : { @@ -17,6 +18,7 @@ } }, "Data" : { + "resonant" : false, "fpo" : 10, "process_id" : 0, "2016" : { @@ -33,6 +35,7 @@ } }, "ZGamma" : { + "resonant" : false, "fpo" : 1, "process_id" : 2, "2016" : { @@ -49,6 +52,7 @@ } }, "DiPhoton" : { + "resonant" : false, "fpo" : 5, "process_id" : 3, "2016" : { @@ -65,6 +69,7 @@ } }, "WGamma" : { + "resonant" : false, "fpo" : 1, "process_id" : 4, "2016" : { @@ -81,6 +86,7 @@ } }, "TTbar" : { + "resonant" : false, "fpo" : 5, "process_id" : 5, "2016" : { @@ -97,6 +103,7 @@ } }, "TTGamma" : { + "resonant" : false, "fpo" : 1, "process_id" : 6, "2016" : { @@ -113,6 +120,7 @@ } }, "TTGG" : { + "resonant" : false, "fpo" : 1, "process_id" : 7, "2016" : { @@ -129,6 +137,7 @@ } }, "GJets_HT40To100" : { + "resonant" : false, "fpo" : 5, "process_id" : 8, "2016" : { @@ -145,6 +154,7 @@ } }, "GJets_HT-100To200" : { + "resonant" : false, "fpo" : 5, "process_id" : 8, "2016" : { @@ -161,6 +171,7 @@ } }, "GJets_HT-200To400" : { + "resonant" : false, "fpo" : 5, "process_id" : 8, "2016" : { @@ -177,6 +188,7 @@ } }, "GJets_HT-400To600" : { + "resonant" : false, "fpo" : 5, "process_id" : 8, "2016" : { @@ -193,6 +205,7 @@ } }, "GJets_HT-600ToInf" : { + "resonant" : false, "fpo" : 5, "process_id" : 8, "2016" : { @@ -209,6 +222,7 @@ } }, "VH" : { + "resonant" : true, "fpo" : 1, "process_id" : 9, "2016" : { diff --git a/Preselection/data/samples_and_scale1fb.json b/Preselection/data/samples_and_scale1fb.json index 9d624a3..a65e054 100644 --- a/Preselection/data/samples_and_scale1fb.json +++ b/Preselection/data/samples_and_scale1fb.json @@ -33,7 +33,8 @@ ] }, "fpo": 10, - "process_id": 0 + "process_id": 0, + "resonant": false }, "DiPhoton": { "2016": { @@ -70,7 +71,8 @@ ] }, "fpo": 5, - "process_id": 3 + "process_id": 3, + "resonant": false }, "GJets_HT-100To200": { "2016": { @@ -108,7 +110,8 @@ ] }, "fpo": 5, - "process_id": 8 + "process_id": 8, + "resonant": false }, "GJets_HT-200To400": { "2016": { @@ -146,7 +149,8 @@ ] }, "fpo": 5, - "process_id": 8 + "process_id": 8, + "resonant": false }, "GJets_HT-400To600": { "2016": { @@ -184,7 +188,8 @@ ] }, "fpo": 5, - "process_id": 8 + "process_id": 8, + "resonant": false }, "GJets_HT-600ToInf": { "2016": { @@ -222,7 +227,8 @@ ] }, "fpo": 5, - "process_id": 8 + "process_id": 8, + "resonant": false }, "GJets_HT40To100": { "2016": { @@ -260,7 +266,8 @@ ] }, "fpo": 5, - "process_id": 8 + "process_id": 8, + "resonant": false }, "HH_ggTauTau": { "2016": { @@ -298,7 +305,8 @@ ] }, "fpo": 1, - "process_id": -1 + "process_id": -1, + "resonant": true }, "TTGG": { "2016": { @@ -335,7 +343,8 @@ ] }, "fpo": 1, - "process_id": 7 + "process_id": 7, + "resonant": false }, "TTGamma": { "2016": { @@ -374,7 +383,8 @@ ] }, "fpo": 1, - "process_id": 6 + "process_id": 6, + "resonant": false }, "TTbar": { "2016": { @@ -411,7 +421,8 @@ ] }, "fpo": 5, - "process_id": 5 + "process_id": 5, + "resonant": false }, "VH": { "2016": { @@ -448,7 +459,8 @@ ] }, "fpo": 1, - "process_id": 9 + "process_id": 9, + "resonant": true }, "WGamma": { "2016": { @@ -487,7 +499,8 @@ ] }, "fpo": 1, - "process_id": 4 + "process_id": 4, + "resonant": false }, "ZGamma": { "2016": { @@ -526,6 +539,7 @@ ] }, "fpo": 1, - "process_id": 2 + "process_id": 2, + "resonant": false } } \ No newline at end of file diff --git a/Preselection/helpers/loop_helper.py b/Preselection/helpers/loop_helper.py index 1a258d4..d5c6d03 100644 --- a/Preselection/helpers/loop_helper.py +++ b/Preselection/helpers/loop_helper.py @@ -26,6 +26,9 @@ def __init__(self, **kwargs): self.options = kwargs.get("options") self.systematics = kwargs.get("systematics") self.years = kwargs.get("years").split(",") + self.select_samples = kwargs.get("select_samples") + if self.select_samples != "all": + self.select_samples = self.select_samples.split(",") self.output_tag = kwargs.get("output_tag") self.output_dir = kwargs.get("output_dir") @@ -98,6 +101,10 @@ def prepare_jobs(self): self.jobs_manager = [] for sample, info in self.samples_dict.items(): + if self.select_samples != "all": + if sample not in self.select_samples: + continue + if self.debug > 0: print("[LoopHelper] Running over sample: %s" % sample) print("[LoopHelper] details: ", info) @@ -117,7 +124,8 @@ def prepare_jobs(self): "process_id" : info["process_id"], "year" : year, "scale1fb" : 1 if sample == "Data" else year_info["metadata"]["scale1fb"], - "lumi" : lumi_map[year] + "lumi" : lumi_map[year], + "resonant" : info["resonant"] } file_splits = self.chunks(files, info["fpo"]) @@ -207,21 +215,21 @@ def write_summary(self): ### Physics: selections, etc ### ################################ - def select_events(self, events): + def select_events(self, events, metadata): # Dipho preselection - events = photon_selections.diphoton_preselection(events, self.debug) + events = photon_selections.diphoton_preselection(events, metadata["resonant"], self.debug) events.Photon = events.Photon[photon_selections.select_photons(events, self.debug)] if self.selections == "HHggTauTau_InclusivePresel": events = analysis_selections.ggTauTau_inclusive_preselection(events, self.debug) - events.Electron = events.Electron[lepton_selections.select_electrons(events, self.debug)] - events.Muon = events.Muon[lepton_selections.select_muons(events, self.debug)] - events.Tau = events.Tau[tau_selections.select_taus(events, self.debug)] + events.Electron = events.Electron[lepton_selections.select_electrons(events, events.Photon, self.debug)] + events.Muon = events.Muon[lepton_selections.select_muons(events, events.Photon, self.debug)] + events.Tau = events.Tau[tau_selections.select_taus(events, events.Photon, events.Muon, events.Electron, self.debug)] elif self.selections == "ttH_LeptonicPresel": events = analysis_selections.tth_leptonic_preselection(events, self.debug) - events.Electron = events.Electron[lepton_selections.select_electrons(events, self.debug)] - events.Muon = events.Muon[lepton_selections.select_muons(events, self.debug)] + events.Electron = events.Electron[lepton_selections.select_electrons(events, events.Photon, self.debug)] + events.Muon = events.Muon[lepton_selections.select_muons(events, events.Photon, self.debug)] return events @@ -243,6 +251,10 @@ def loop_sample(self, job): files = job["files"] output = job["output"] + selection_metadata = { + "resonant" : info["resonant"] + } + if self.debug > 0: print("[LoopHelper] Running job with parameters", job) @@ -262,7 +274,7 @@ def loop_sample(self, job): if events is None: self.outputs.pop(output) return - events = self.select_events(events) + events = self.select_events(events, selection_metadata) events["process_id"] = numpy.ones(len(events)) * process_id if data: diff --git a/Preselection/loop.py b/Preselection/loop.py index c1e9bca..ca10ae5 100644 --- a/Preselection/loop.py +++ b/Preselection/loop.py @@ -29,6 +29,12 @@ type = str, default = "2016,2017,2018" ) +parser.add_argument( + "--select_samples", + help = "csv list of samples to run over (should be a subset of samples in args.samples)", + type = str, + default = "all" +) # --options points to a json file containing options for looping # this could include things like additional scaling of bkg samples, diff --git a/Preselection/scripts/scale1fb.py b/Preselection/scripts/scale1fb.py index 80fb1ca..57a0bd8 100644 --- a/Preselection/scripts/scale1fb.py +++ b/Preselection/scripts/scale1fb.py @@ -89,6 +89,8 @@ def calculate_metadata(files, xs, debug): for sample, info in output.items(): if sample in original_output.keys(): for year, year_info in original_output[sample].items(): + if "201" not in year: + continue if "metadata" in year_info.keys(): if "scale1fb" in year_info["metadata"].keys(): output[sample][year] = original_output[sample][year] diff --git a/Preselection/selections/analysis_selections.py b/Preselection/selections/analysis_selections.py index 104a231..25b31f9 100644 --- a/Preselection/selections/analysis_selections.py +++ b/Preselection/selections/analysis_selections.py @@ -9,24 +9,37 @@ import selections.photon_selections as photon_selections def ggTauTau_inclusive_preselection(events, debug): - cut_diagnostics = utils.CutDiagnostics(n_events_initial = len(events), debug = debug, cut_set = "[analysis_selections.py : ggTauTau_inclusive_preselection]") + cut_diagnostics = utils.CutDiagnostics(events = events, debug = debug, cut_set = "[analysis_selections.py : ggTauTau_inclusive_preselection]") # Get number of electrons, muons, taus - n_electrons = awkward.num(events.Electron[lepton_selections.select_electrons(events, debug)]) - n_muons = awkward.num(events.Muon[lepton_selections.select_muons(events, debug)]) + electron_selection = lepton_selections.select_electrons(events, events.Photon, debug) + muon_selection = lepton_selections.select_muons(events, events.Photon, debug) + tau_selection = tau_selections.select_taus(events, events.Photon, events.Muon[muon_selection], events.Electron[electron_selection], debug) + + n_electrons = awkward.num(events.Electron[electron_selection]) + n_muons = awkward.num(events.Muon[muon_selection]) + n_taus = awkward.num(events.Tau[tau_selection]) + + # Require >= 1 lep/tau + n_leptons_and_taus = n_electrons + n_muons + n_taus + lep_tau_cut = n_leptons_and_taus >= 1 - n_taus = awkward.num(events.Tau[tau_selections.select_taus(events, debug)]) + # Require OS leptons/taus for events with 2 leptons/taus + sum_charge = awkward.sum(events.Electron[electron_selection].charge, axis=1) + awkward.sum(events.Muon[muon_selection].charge, axis=1) + awkward.sum(events.Tau[tau_selection].charge, axis=1) + charge_cut = sum_charge == 0 + n_lep_cut = n_leptons_and_taus == 2 + not_two_leptons = n_leptons_and_taus != 2 + os_cut = (n_lep_cut & charge_cut) | not_two_leptons # only require 2 OS leptons if there are ==2 leptons in the event - n_leptons_and_taus = n_electrons + n_muons + n_taus + all_cuts = lep_tau_cut & os_cut + cut_diagnostics.add_cuts([lep_tau_cut, os_cut, all_cuts], ["N_leptons + N_taus >= 1", "OS dileptons", "all"]) - lep_tau_cut = n_leptons_and_taus >= 1 - events = events[lep_tau_cut] - cut_diagnostics.add_cut(len(events), cut_name = "leptons and taus >= 1 cut") + events = events[all_cuts] return events def tth_leptonic_preselection(events, debug): - cut_diagnostics = utils.CutDiagnostics(n_events_initial = len(events), debug = debug, cut_set = "[analysis_selections.py : tth_leptonic_preselection]") + cut_diagnostics = utils.CutDiagnostics(events = events, debug = debug, cut_set = "[analysis_selections.py : tth_leptonic_preselection]") # Get number of electrons, muons n_electrons = awkward.num(events.Electron[lepton_selections.select_electrons(events, debug)]) diff --git a/Preselection/selections/cut_stats.py b/Preselection/selections/cut_stats.py new file mode 100644 index 0000000..32d6064 --- /dev/null +++ b/Preselection/selections/cut_stats.py @@ -0,0 +1,58 @@ +import numpy +import awkward +import json + +class CutStats(): + def __init__(self, **kwargs): + self.debug = kwargs.get("debug") + self.event_stats = {} + self.object_stats = {} + self.objects = {} + + def add_initial_events(self, sample, n_events): + if sample not in self.event_stats.keys(): + self.event_stats[sample] = { "n_events_initial" : n_events } + else: + self.event_stats[sample]["n_events_initial"] += n_events + + def add_initial_objects(self, sample, object, n_objects): + if object not in self.object_stats.keys(): + self.object_stats[object] = {} + + if sample not in self.object_stats[object].keys(): + self.object_stats[object][sample] = { "n_objects_initial" : n_objects_initial } + else: + self.object_stats[object][sample]["n_objects_initial"] += n_objects_initial + + def add_event_cuts(self, events cuts, names, sample): + if sample not in self.event_stats.keys(): + self.event_stats[sample] = { "n_events_initial" : n_events } + else: + self.event_stats[sample]["n_events_initial"] += n_events + + for cut, name in zip(cuts, names): + if name not in self.event_stats[sample].keys(): + self.event_stats[sample][name] = awkward.sum(events[cut]) + else: + self.event_stats[sample][name] += awkward.sum(events[cut]) + + def add_object_cuts(self, objects, object_name, cuts, names, sample): + if object_name not in self.object_stats.keys(): + self.object_stats[object_name] = {} + + if sample not in self.object_stats[object_name].keys(): + self.object_stats[object_name][sample] = { "n_objects_initial" : awkward.sum(awkward.num(objects)) } + else: + self.object_stats[object_name][sample]["n_objects_initial"] += awkward.sum(awkward.num(objects)) + + for cut, name in zip(cuts, names): + if name not in self.object_stats[object_name][sample].keys(): + self.object_stats[object_name][sample][name] = awkward.sum(awkward.num(objects[cut])) + else: + self.object_stats[object_name][sample][name] += awkward.sum(awkward.num(objects[cut])) + + def summarize(): + results = { "event_cuts" : self.event_stats, "object_cuts" : self.object_stats } + with open("CutStatsSummary.json", "w") as f_out: + json.dump(results, f_out, sort_keys = True, indent = 4) + diff --git a/Preselection/selections/lepton_selections.py b/Preselection/selections/lepton_selections.py index 7f6b9ae..ea8b885 100644 --- a/Preselection/selections/lepton_selections.py +++ b/Preselection/selections/lepton_selections.py @@ -7,7 +7,7 @@ DR_LEP_PHO = 0.2 -def select_electrons(events, debug): +def select_electrons(events, photons, debug): cut_diagnostics = utils.ObjectCutDiagnostics(objects = events.Electron, cut_set = "[lepton_selections.py : select_electrons]", debug = debug) pt_cut = events.Electron.pt > 10 @@ -15,7 +15,7 @@ def select_electrons(events, debug): ip_xy_cut = abs(events.Electron.dxy) < 0.045 ip_z_cut = abs(events.Electron.dz) < 0.2 id_cut = (events.Electron.mvaFall17V2Iso_WP90 == True | ((events.Electron.mvaFall17V2noIso_WP90 == True) & (events.Electron.pfRelIso03_all < 0.3))) - dR_cut = object_selections.select_deltaR(events, events.Electron, events.Photon, DR_LEP_PHO, debug) + dR_cut = object_selections.select_deltaR(events, events.Electron, photons, DR_LEP_PHO, debug) electron_cut = pt_cut & eta_cut & ip_xy_cut & ip_z_cut & id_cut & dR_cut @@ -23,7 +23,7 @@ def select_electrons(events, debug): return electron_cut -def select_muons(events, debug): +def select_muons(events, photons, debug): cut_diagnostics = utils.ObjectCutDiagnostics(objects = events.Muon, cut_set = "[lepton_selections.py : select_muons]", debug = debug) pt_cut = events.Muon.pt > 10 @@ -31,7 +31,7 @@ def select_muons(events, debug): ip_xy_cut = abs(events.Muon.dxy) < 0.045 ip_z_cut = abs(events.Muon.dz) < 0.2 iso_cut = events.Muon.pfRelIso03_all < 0.3 - dR_cut = object_selections.select_deltaR(events, events.Muon, events.Photon, DR_LEP_PHO, debug) + dR_cut = object_selections.select_deltaR(events, events.Muon, photons, DR_LEP_PHO, debug) muon_cut = pt_cut & eta_cut & ip_xy_cut & ip_z_cut & iso_cut & dR_cut diff --git a/Preselection/selections/photon_selections.py b/Preselection/selections/photon_selections.py index 7c9929e..75d3527 100644 --- a/Preselection/selections/photon_selections.py +++ b/Preselection/selections/photon_selections.py @@ -18,54 +18,57 @@ 2. Trim objects with object-level selections afterwards """ -def diphoton_preselection(events, debug): +def diphoton_preselection(events, resonant, debug): # Initialize cut diagnostics tool for debugging - cut_diagnostics = utils.CutDiagnostics(n_events_initial = len(events), debug = debug, cut_set = "[photon_selections.py : diphoton_preselection]") + cut_diagnostics = utils.CutDiagnostics(events = events, debug = debug, cut_set = "[photon_selections.py : diphoton_preselection]") + + photons = events.Photon[select_photons(events, debug)] ### mgg cut ### - mgg_mask = numpy.array(events.ggMass > 100) & numpy.array(events.ggMass < 180) - events = events[mgg_mask] - cut_diagnostics.add_cut(len(events), cut_name = "mgg cut") + if resonant: + mgg_mask = numpy.array(events.ggMass > 100) & numpy.array(events.ggMass < 180) + else: + sideband_low = numpy.array(events.ggMass > 100) & numpy.array(events.ggMass < 120) + sideband_high = numpy.array(events.ggMass > 130) & numpy.array(events.ggMass < 180) + mgg_mask = sideband_low | sideband_high ### pt/mgg cuts ### - lead_pt_mgg_requirement = (events.Photon.pt / events.ggMass) > 0.33 - sublead_pt_mgg_requirement = (events.Photon.pt / events.ggMass) > 0.25 + lead_pt_mgg_requirement = (photons.pt / events.ggMass) > 0.33 + sublead_pt_mgg_requirement = (photons.pt / events.ggMass) > 0.25 - lead_pt_mgg_cut = awkward.num(events.Photon[lead_pt_mgg_requirement]) >= 1 # at least 1 photon passing lead requirement - sublead_pt_mgg_cut = awkward.num(events.Photon[sublead_pt_mgg_requirement]) >= 2 # at least 2 photon passing sublead requirement + lead_pt_mgg_cut = awkward.num(photons[lead_pt_mgg_requirement]) >= 1 # at least 1 photon passing lead requirement + sublead_pt_mgg_cut = awkward.num(photons[sublead_pt_mgg_requirement]) >= 2 # at least 2 photon passing sublead requirement pt_mgg_cut = lead_pt_mgg_cut & sublead_pt_mgg_cut - events = events[pt_mgg_cut] - cut_diagnostics.add_cut(len(events), cut_name = "pt/mgg cut") ### pho ID MVA cuts ### - pho_idmva_requirement = events.Photon.mvaID > -0.7 - pho_idmva_cut = awkward.num(events.Photon[pho_idmva_requirement]) >= 2 # both photons must pass id mva requirement - events = events[pho_idmva_cut] - cut_diagnostics.add_cut(len(events), cut_name = "pho ID MVA cut") + pho_idmva_requirement = photons.mvaID > -0.7 + pho_idmva_cut = awkward.num(photons[pho_idmva_requirement]) >= 2 # both photons must pass id mva requirement ### electron veto cut ### - eveto_requirement = events.Photon.electronVeto == 1 - eveto_cut = awkward.num(events.Photon[eveto_requirement]) >= 2 # both photons must pass eveto requirement - events = events[eveto_cut] - cut_diagnostics.add_cut(len(events), cut_name = "eveto cut") + eveto_requirement = photons.electronVeto == 1 + eveto_cut = awkward.num(photons[eveto_requirement]) >= 2 # both photons must pass eveto requirement ### 2 good photons ### - photon_requirements = select_photons(events, debug) - photon_cut = awkward.num(photon_requirements) >= 2 - events = events[photon_cut] - cut_diagnostics.add_cut(len(events), cut_name = "2 good photons cut") - + photon_cut = awkward.num(photons) == 2 # can regain a few % of signal if we set to >= 2 (probably e's that are reconstructed as photons) + + all_cuts = mgg_mask & pt_mgg_cut & pho_idmva_cut & eveto_cut & photon_cut + cut_diagnostics.add_cuts([mgg_mask, pt_mgg_cut, pho_idmva_cut, eveto_cut, photon_cut, all_cuts], ["mgg in [100, 180]" if resonant else "mgg in [100, 120] or [130, 180]", "lead (sublead) pt/mgg > 0.33 (0.25)", "pho IDMVA > -0.7", "electron veto", "2 good photons", "all"]) + + events = events[all_cuts] + return events def select_photons(events, debug): cut_diagnostics = utils.ObjectCutDiagnostics(objects = events.Photon, cut_set = "[photon_selections.py : select_photons]", debug = debug) + pt_cut = events.Photon.pt > 25 + eta_cut = abs(events.Photon.eta) < 2.5 pt_mgg_cut = (events.Photon.pt / events.ggMass) >= 0.25 idmva_cut = events.Photon.mvaID > -0.7 eveto_cut = events.Photon.electronVeto == 1 - photon_cut = pt_mgg_cut & idmva_cut & eveto_cut + photon_cut = pt_cut & eta_cut & pt_mgg_cut & idmva_cut & eveto_cut - cut_diagnostics.add_cuts([pt_mgg_cut, idmva_cut, eveto_cut, photon_cut], ["pt/mgg", "idmva", "eveto", "all"]) + cut_diagnostics.add_cuts([pt_cut, eta_cut, pt_mgg_cut, idmva_cut, eveto_cut, photon_cut], ["pt > 25", "|eta| < 2.5", "pt/mgg", "idmva", "eveto", "all"]) return photon_cut def set_photons(events, debug): diff --git a/Preselection/selections/selection_utils.py b/Preselection/selections/selection_utils.py index e1e3f7e..4bf1d2c 100644 --- a/Preselection/selections/selection_utils.py +++ b/Preselection/selections/selection_utils.py @@ -3,20 +3,19 @@ class CutDiagnostics(): def __init__(self, **kwargs): - self.n_events_initial = kwargs.get("n_events_initial") self.debug = kwargs.get("debug") self.cut_set = kwargs.get("cut_set", "cut") - self.cuts = [float(self.n_events_initial)] + self.events = kwargs.get("events") - if self.debug: - print("%s CutDiagnostics: %d events before any cuts" % (self.cut_set, self.n_events_initial)) + self.n_events_initial = len(self.events) - def add_cut(self, n_events, cut_name = "cut"): - self.cuts.append(float(n_events)) - if self.debug: - if n_events == 0 or self.cuts[-2] == 0: - return - print("%s CutDiagnostics: After cut %s, %d events (eff_cut: %.4f, eff_total: %.4f)" % (self.cut_set, cut_name, n_events, self.cuts[-1] / self.cuts[-2], self.cuts[-1] / self.cuts[0])) + def add_cuts(self, cuts, names): + for cut, name in zip(cuts, names): + if self.debug > 0: + n_events_cut = len(self.events[cut]) + if self.n_events_initial == 0: + return + print("%s EventCutDiagnostics: Cut %s has an eff of %.4f" % (self.cut_set, name, float(n_events_cut) / float(self.n_events_initial))) class ObjectCutDiagnostics(): def __init__(self, **kwargs): diff --git a/Preselection/selections/tau_selections.py b/Preselection/selections/tau_selections.py index 6fe3272..bd6be40 100644 --- a/Preselection/selections/tau_selections.py +++ b/Preselection/selections/tau_selections.py @@ -6,9 +6,9 @@ import selections.object_selections as object_selections DR_TAU_PHO = 0.2 -DR_TAU_LEP = 0.4 +DR_TAU_LEP = 0.2 -def select_taus(events, debug): +def select_taus(events, photons, muons, electrons, debug): cut_diagnostics = utils.ObjectCutDiagnostics(objects = events.Tau, cut_set = "[tau_selections.py : select_taus]", debug = debug) pt_cut = events.Tau.pt > 20 @@ -20,9 +20,9 @@ def select_taus(events, debug): id_muon_cut = events.Tau.idDeepTau2017v2p1VSmu >= 1 id_jet_cut = events.Tau.idDeepTau2017v2p1VSjet >= 8 - dR_pho_cut = object_selections.select_deltaR(events, events.Tau, events.Photon, DR_TAU_PHO, debug) - dR_muon_cut = object_selections.select_deltaR(events, events.Tau, events.Muon, DR_TAU_LEP, debug) - dR_ele_cut = object_selections.select_deltaR(events, events.Tau, events.Electron, DR_TAU_LEP, debug) + dR_pho_cut = object_selections.select_deltaR(events, events.Tau, photons, DR_TAU_PHO, debug) + dR_muon_cut = object_selections.select_deltaR(events, events.Tau, muons, DR_TAU_LEP, debug) + dR_ele_cut = object_selections.select_deltaR(events, events.Tau, electrons, DR_TAU_LEP, debug) tau_cut = pt_cut & eta_cut & decay_mode_cut & dz_cut & id_electron_cut & id_muon_cut & id_jet_cut & dR_pho_cut & dR_muon_cut & dR_ele_cut