Ejemplo n.º 1
0
def select_electrons(events, photons, electrons, options, debug):
    cut_diagnostics = utils.ObjectCutDiagnostics(
        objects=electrons,
        cut_set="[lepton_selections.py : select_electrons]",
        debug=debug)

    pt_cut = electrons.pt > options["electrons"]["pt"]
    eta_cut = abs(electrons.eta) < options["electrons"]["eta"]
    ip_xy_cut = abs(electrons.dxy) < options["electrons"]["ip_xy"]
    ip_z_cut = abs(electrons.dz) < options["electrons"]["ip_z"]
    id_cut = (electrons.mvaFall17V2Iso_WP90 == True |
              ((electrons.mvaFall17V2noIso_WP90 == True) &
               (electrons.pfRelIso03_all < 0.3)))
    # TODO: make ID cut configurable
    # also: ID cut has pretty low efficiency on signal, loosen?
    dR_cut = object_selections.select_deltaR(events, electrons, photons,
                                             options["electrons"]["dR_pho"],
                                             debug)

    electron_cut = pt_cut & eta_cut & ip_xy_cut & ip_z_cut & id_cut & dR_cut

    cut_diagnostics.add_cuts(
        [pt_cut, eta_cut, ip_xy_cut, ip_z_cut, id_cut, dR_cut, electron_cut],
        ["pt", "eta", "ip_xy", "ip_z", "id", "dR", "all"])

    return electron_cut
Ejemplo n.º 2
0
def select_jets(events, photons, electrons, muons, taus, jets, options, debug):
    cut_diagnostics = utils.ObjectCutDiagnostics(objects = jets, cut_set = "[jet_selections.py : select_jets]", debug = debug)

    pt_cut = jets.pt > options["jets"]["pt"]
    eta_cut = abs(jets.eta) < options["jets"]["eta"]

    dR_pho_cut = object_selections.select_deltaR(events, jets, photons, options["jets"]["dR_pho"], debug)
    dR_ele_cut = object_selections.select_deltaR(events, jets, electrons, options["jets"]["dR_lep"], debug)
    dR_muon_cut = object_selections.select_deltaR(events, jets, muons, options["jets"]["dR_lep"], debug)

    if taus is not None:
        dR_tau_cut = object_selections.select_deltaR(events, jets, taus, options["jets"]["dR_tau"], debug)
    else:
        dR_tau_cut = object_selections.select_deltaR(events, jets, photons, 0.0, debug) # dummy cut of all True

    id_cut = jet_id(jets, options)

    jet_cut = pt_cut & eta_cut & dR_pho_cut & dR_ele_cut & dR_muon_cut & dR_tau_cut & id_cut

    cut_diagnostics.add_cuts([pt_cut, eta_cut, dR_pho_cut, dR_ele_cut, dR_muon_cut, dR_tau_cut, id_cut, jet_cut], ["pt > 25", "|eta| < 2.4", "dR_photons", "dR_electrons", "dR_muons", "dR_taus", "loose jet ID", "all"])
    
    return jet_cut
Ejemplo n.º 3
0
def select_fatjets(events, photons, fatjets, options, debug):
    cut_diagnostics = utils.ObjectCutDiagnostics(objects = fatjets, cut_set = "[jet_selections.py : select_fatjets]", debug = debug)

    pt_cut = fatjets.pt > options["fatjets"]["pt"]
    eta_cut = abs(fatjets.eta) < options["fatjets"]["eta"]
    
    dR_pho_cut = object_selections.select_deltaR(events, fatjets, photons, options["fatjets"]["dR_pho"], debug)

    jet_cut = pt_cut & eta_cut & dR_pho_cut

    cut_diagnostics.add_cuts([pt_cut, eta_cut, dR_pho_cut, jet_cut], ["pt > %.1f" % options["fatjets"]["pt"], "eta < %.2f" % options["fatjets"]["eta"], "dR_photons", "all"])

    return jet_cut
Ejemplo n.º 4
0
def select_taus(events, photons, muons, electrons, taus, options, debug):
    cut_diagnostics = utils.ObjectCutDiagnostics(
        objects=taus, cut_set="[tau_selections.py : select_taus]", debug=debug)

    pt_cut = taus.pt > options["taus"]["pt"]
    eta_cut = abs(taus.eta) < options["taus"]["eta"]
    decay_mode_cut = taus.idDecayModeNewDMs == True
    dz_cut = abs(taus.dz) < options["taus"]["dz"]

    id_electron_cut = taus.idDeepTau2017v2p1VSe >= options["taus"][
        "DeepTau_vs_e"]
    id_muon_cut = taus.idDeepTau2017v2p1VSmu >= options["taus"]["DeepTau_vs_mu"]
    id_jet_cut = taus.idDeepTau2017v2p1VSjet >= options["taus"][
        "DeepTau_vs_jet"]

    dR_pho_cut = object_selections.select_deltaR(events, taus, photons,
                                                 options["taus"]["dR_pho"],
                                                 debug)
    dR_muon_cut = object_selections.select_deltaR(events, taus, muons,
                                                  options["taus"]["dR_lep"],
                                                  debug)
    dR_ele_cut = object_selections.select_deltaR(events, taus, electrons,
                                                 options["taus"]["dR_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

    cut_diagnostics.add_cuts([
        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, tau_cut
    ], [
        "pt", "eta", "decay mode", "dz", "DeepTau vs ele", "DeepTau vs mu",
        "DeepTau vs jet", "dR tau vs. pho", "dR tau vs. muon",
        "dR tau vs. ele", "all"
    ])

    return tau_cut
Ejemplo n.º 5
0
def select_muons(events, photons, muons, options, debug):
    cut_diagnostics = utils.ObjectCutDiagnostics(
        objects=muons,
        cut_set="[lepton_selections.py : select_muons]",
        debug=debug)

    pt_cut = muons.pt > options["muons"]["pt"]
    eta_cut = abs(muons.eta) < options["muons"]["eta"]
    ip_xy_cut = abs(muons.dxy) < options["muons"]["ip_xy"]
    ip_z_cut = abs(muons.dz) < options["muons"]["ip_z"]
    id_cut = muon_id(muons, options)
    dR_cut = object_selections.select_deltaR(events, muons, photons,
                                             options["muons"]["dR_pho"], debug)

    muon_cut = pt_cut & eta_cut & ip_xy_cut & ip_z_cut & id_cut & dR_cut

    cut_diagnostics.add_cuts(
        [pt_cut, eta_cut, ip_xy_cut, ip_z_cut, id_cut, dR_cut, muon_cut],
        ["pt", "eta", "ip_xy", "ip_z", "id", "dR", "all"])

    return muon_cut
Ejemplo n.º 6
0
def select_electrons(events, photons, electrons, options, debug):
    cut_diagnostics = utils.ObjectCutDiagnostics(
        objects=electrons,
        cut_set="[lepton_selections.py : select_electrons]",
        debug=debug)

    pt_cut = electrons.pt > options["electrons"]["pt"]

    eta_cut1 = abs(electrons.eta) < options["electrons"]["eta"]
    eta_cut2 = abs(
        electrons.eta) < options["electrons"]["transition_region_eta"][0]
    eta_cut3 = abs(
        electrons.eta) > options["electrons"]["transition_region_eta"][1]
    eta_cut = eta_cut1 & (eta_cut2 | eta_cut3)

    ip_xy_cut = abs(electrons.dxy) < options["electrons"]["ip_xy"]
    ip_z_cut = abs(electrons.dz) < options["electrons"]["ip_z"]
    id_cut = electron_id(electrons, options)
    dR_cut = object_selections.select_deltaR(events, electrons, photons,
                                             options["electrons"]["dR_pho"],
                                             debug)
    mZ_cut = object_selections.select_mass(events, electrons, photons,
                                           options["electrons"]["mZ_cut"],
                                           debug)

    electron_cut = pt_cut & eta_cut & ip_xy_cut & ip_z_cut & id_cut & dR_cut & mZ_cut

    cut_diagnostics.add_cuts([
        pt_cut, eta_cut, ip_xy_cut, ip_z_cut, id_cut, dR_cut, mZ_cut,
        electron_cut
    ], [
        "pt", "eta", "ip_xy", "ip_z", "id", "dR",
        "m_egamma not in m_Z +/- 5 Gev", "all"
    ])

    return electron_cut