コード例 #1
0
        tlatexCMS2.DrawLatex(0.252, 0.965, 'Phase-2 Simulation')
        tlatexCMS3.DrawLatex(0.865, 0.965, '<PU>=200')

    tfile = TFile.Open(infile)
    h_nevents = tfile.Get("nevents")
    assert h_nevents != None, "Cannot get nevents"
    nevents = h_nevents.GetBinContent(2)

    # ____________________________________________________________________________
    # emtf_ptmin20_qmin12_eta

    hname = "emtf_ptmin20_qmin12_eta"
    h1a = tfile.Get(hname)
    h1b = tfile.Get(hname2026_f(hname))

    make_rate(h1a, nevents)
    make_rate(h1b, nevents)

    h1a.SetMarkerColor(632)  # kRed
    h1a.SetLineColor(632)  # kRed
    h1a.SetLineWidth(2)

    h1b.SetMarkerColor(600)  # kBlue
    h1b.SetLineColor(600)  # kBlue
    h1b.SetFillColor(600)  # kBlue
    h1b.SetLineWidth(2)

    h1b_clone = h1b.Clone(h1b.GetName() + "_clone")
    h1b_clone.SetLineColor(1)  # kBlack

    h1a.GetXaxis().SetTitle("L1 muon #eta")
コード例 #2
0
    # emtf_ptmin20_qmin12_pu

    #hname = "highest_emtf_absEtaMin1.24_absEtaMax2.4_qmin12_pt"
    hname = "highest_emtf_absEtaMin0.8_absEtaMax1.24_qmin12_pt"

    pileup_list = [140, 200, 250, 300]
    tfile_list = [tfile140, tfile200, tfile250, tfile300]
    nevents_list = [nevents140, nevents200, nevents250, nevents300]

    rates = []

    for pileup, tfile, nevents in zip(pileup_list, tfile_list, nevents_list):
        h = tfile.Get(hname)
        h.Sumw2()
        make_ptcut(h)
        make_rate(h, nevents)
        emtf_rate = h.GetBinContent(h.FindBin(20))
        emtf_rate_err = h.GetBinError(h.FindBin(20))
        #
        h = tfile.Get(hname2026_f(hname))
        h.Sumw2()
        make_ptcut(h)
        make_rate(h, nevents)
        emtf2026_rate = h.GetBinContent(h.FindBin(20))
        emtf2026_rate_err = h.GetBinError(h.FindBin(20))
        #
        rates.append((float(pileup), emtf_rate, emtf_rate_err, emtf2026_rate,
                      emtf2026_rate_err))

    print rates