示例#1
0
文件: histo.py 项目: HEP-KBFI/stpol
def analysis_tree_all_reweighed(graph, cuts, snodes, **kwargs):
    cutnodes = []
    for cut_name, cut in cuts:
        lepton = cut_name.split("_")[0]

        cutnode = tree.CutNode(cut, graph, cut_name, snodes, [],
            filter_funcs=[
                lambda x,lepton=lepton: tree.is_samp(x, lepton)
        ])
        cutnodes.append(
            cutnode
        )

        #an extra QCD cleaning cut on top of the previous cut, which is only done in antiiso
        for syst in ["nominal", "up", "down"]:
            cn = tree.CutNode(
                Cuts.antiiso(lepton, syst) * Cuts.deltaR_QCD(),
                graph, "antiiso_%s" % syst, [cutnode], [],
                filter_funcs=[
                    lambda p: tree.is_samp(p, "antiiso")
                ]
            )
            cutnodes.append(
                cn
            )

    from histo_descs import create_plots
    create_plots(graph, cutnodes, **kwargs)
示例#2
0
文件: tree.py 项目: HEP-KBFI/stpol
        isos[lep] = dict()
        isos[lep]['iso'] = CutNode(
            Cut("1.0"), #At present no special cuts have to be applied on the ISO region
            graph, lep + "__iso", par, [],
            filter_funcs=[lambda x: "/iso/" in x[0].name]
        )
        isol.append(isos[lep]['iso'])

        #Antiiso with variations in the isolation cut
        for aiso_syst in ["nominal", "up", "down"]:
            #dR with variations
            for dr_syst in ["nominal", "up", "down"]:
                cn = 'antiiso_' + aiso_syst + '_dR_' + dr_syst
                isos[lep][cn] = CutNode(
                    #Apply any additional anti-iso cuts (like dR) along with antiiso variations.
                    Cuts.antiiso(lep, aiso_syst) * Cuts.deltaR_QCD(dr_syst),
                    graph, lep + "__" + cn, par, [],
                    filter_funcs=[
                        lambda x: is_samp(x, "antiiso") and is_samp(x, "data")
                    ]
                )
                isol.append(isos[lep][cn])

    # [iso, antiiso] --> jet --> [jets2-3]
    jet = Node(graph, "jet", isol, [])
    jets = dict()
    for i in [2,3]:
        jets[i] = CutNode(Cuts.n_jets(i), graph, "%dj"%i, [jet], [])

    tag = Node(graph, "tag", jet.children(), [])
    tags = dict()