コード例 #1
0
ファイル: histo.py プロジェクト: HEP-KBFI/stpol
            baseline = Cuts.lepton(lep) * Cuts.hlt(lep) * Cuts.metmt(lep) * Cuts.rms_lj
            cuts += [
                #Without the MET cut
                ("%s_nomet" % cn, Cuts.lepton(lep) * Cuts.hlt(lep) * Cuts.rms_lj * cbline),

                #Baseline for fit
                ("%s_baseline" % cn, baseline * cbline),

                #Cut-based check
                ("%s_cutbased_final" % cn,
                    baseline * cbline * Cuts.top_mass_sig * Cuts.eta_lj
                ),

                #MVA-based selection
                ("%s_mva_loose" % cn,
                    baseline * cbline * Cuts.mva_wp(lep)
                ),
            ]
            #MVA scan
           # for mva in numpy.linspace(0, 0.8, 9):
           #     cuts.append(
           #         ("%s_mva_scan_%s" % (cn, str(mva).replace(".","_")),
           #             baseline * cbline * Cuts.mva_wp(lep, mva)
           #         ),
           #     )

    import cPickle as pickle
    import gzip
    class PickleSaver:
        def __init__(self, fname):
            self.of = gzip.GzipFile(fname, 'wb')
コード例 #2
0
ファイル: yields.py プロジェクト: HEP-KBFI/stpol
                if not cut:
                    cut = _cut
                else:
                    cut *= _cut
                try:
                    hi = samp.drawHistogram("eta_lj", str(cut), binning=[50, -5, 5])
                    hi.Scale(samp.lumiScaleFactor(20000))
                    print cutname
                    print hi.GetEntries(), hi.Integral()
                except:
                    print "-1 -1"

            for cutname, _cut in [
                ("HLT", Cuts.hlt(lep)),
                ("lep", Cuts.single_lepton(lep)),
                ("2J", Cuts.n_jets(2)),
                ("1T", Cuts.n_tags(1)),
                ("MVA", Cuts.mva_wp(lep))
                ]:
                if not cut:
                    cut = _cut
                else:
                    cut *= _cut
                try:
                    hi = samp.drawHistogram("eta_lj", str(cut), binning=[50, -5, 5])
                    hi.Scale(samp.lumiScaleFactor(20000))
                    print cutname
                    print hi.GetEntries(), hi.Integral()
                except:
                    print "-1 -1"