Example #1
0
def asigma():
    asym_p = AsymmetryGenerator('asym_p', bins=zbins, key='z_away2')
    asym_m = AsymmetryGenerator('asym_m', bins=zbins, key='z_away2')
    
    scalars = ScalarCounts(os.environ['STAR'] + 
        '/StRoot/StSpinPool/StTamuRelLum/inputs/run6.txt')
    
    polarizations = Polarizations.Final
    
    ## generate the asymmetries
    allFiles = glob(transHistDir + '/chargedPions_*.hist.root')
    for fname in allFiles[:]:
        run = getRun(fname)
        if run in transverse_runlist:
            print fname, run
            mgr = HistogramManager(ROOT.TFile(fname), ['z_away2'])
            
            try:
                bin6 = scalars[str(run) + '-5-6']
                bin7 = scalars[str(run) + '-5-7']
                bin8 = scalars[str(run) + '-5-8']
                bin9 = scalars[str(run) + '-5-9']
            except KeyError:
                bin6 = scalars[str(run) + '-6-6']
                bin7 = scalars[str(run) + '-6-7']
                bin8 = scalars[str(run) + '-6-8']
                bin9 = scalars[str(run) + '-6-9']
            uu = bin6.uu + bin7.uu + bin8.uu + bin9.uu
            ud = bin6.ud + bin7.ud + bin8.ud + bin9.ud
            du = bin6.du + bin7.du + bin8.du + bin9.du
            dd = bin6.dd + bin7.dd + bin8.dd + bin9.dd
            
            pol = polarizations[bin7.fill]
            
            asym_p.FillFromHistogramManager(mgr, 'jetpatch', 1, uu,ud,du,dd, \
                pol.py,pol.pb)
            asym_m.FillFromHistogramManager(mgr, 'jetpatch', -1, uu,ud,du,dd, \
                pol.py,pol.pb)
    
    c = graphics.canvas2()
    c.SetLogy(0)
    ROOT.gStyle.SetErrorX(0.0)
    
    c.cd(1)
    hm = asym_m.GetAsymmetry('ll')
    hm.SetMarkerStyle(20)
    hm.SetTitle('A_{#sigma} #pi^{-}')
    hm.Fit('pol0', 'q')
    hm.Draw('e1')
    
    c.cd(2)
    hp = asym_p.GetAsymmetry('ll')
    hp.SetTitle('A_{#sigma} #pi^{+}')
    hp.SetMarkerStyle(21)
    hp.Fit('pol0', 'q')
    hp.Draw('e1')
    
    for h in (hm,hp):
        h.GetXaxis().SetTitle('p_{T}(#pi)/p_{T}(jet)')
        h.GetYaxis().SetRangeUser(-0.1, 0.1)
    
    raw_input('wait here:')
    c.Print('asigma.png')
    
    print '\nπ- A_{σ}'
    for bin in range(1, hm.GetNbinsX()+1):
        print '[%.2f-%.2f]  % .3f ± %.3f' % (hm.GetBinLowEdge(bin), 
            hm.GetBinLowEdge(bin+1), hm.GetBinContent(bin), hm.GetBinError(bin))
    
    print '\nπ+ A_{σ}'
    for bin in range(1, hp.GetNbinsX()+1):
        print '[%.2f-%.2f]  % .3f ± %.3f' % (hp.GetBinLowEdge(bin), 
            hp.GetBinLowEdge(bin+1), hp.GetBinContent(bin), hp.GetBinError(bin))
Example #2
0
def ssa():
    """
    plots single-spin asymmetries versus fill and z, saves them in PNG format
    """
    asym_zp = AsymmetryGenerator('asym_zp', bins=zbins, key='z_away2')
    asym_zm = AsymmetryGenerator('asym_zm', bins=zbins, key='z_away2')
    asym_fp = {}
    asym_fm = {}
    
    fills = [int(f) for f in fillList(runlist)]
    for fill in fills:
        asym_fp[fill] = AsymmetryGenerator('p%d' % fill, bins=[1,-0.5,0.5], 
            key='one')
        asym_fm[fill] = AsymmetryGenerator('m%d' % fill, bins=[1,-0.5,0.5], 
            key='one')
    
    scalars = ScalarCounts(os.environ['STAR'] + 
        '/StRoot/StSpinPool/StTamuRelLum/inputs/run6.txt')
    
    polarizations = Polarizations.Final
    
    allFiles = glob(histDir + '/chargedPions_*.hist.root')
    for fname in allFiles[:]:
        run = getRun(fname)
        if run in runlist:
            print fname, run
            mgr = HistogramManager(ROOT.TFile(fname), ['z_away2','one'])
            
            try:
                bin6 = scalars[str(run) + '-5-6']
                bin7 = scalars[str(run) + '-5-7']
                bin8 = scalars[str(run) + '-5-8']
                bin9 = scalars[str(run) + '-5-9']
            except KeyError:
                bin6 = scalars[str(run) + '-6-6']
                bin7 = scalars[str(run) + '-6-7']
                bin8 = scalars[str(run) + '-6-8']
                bin9 = scalars[str(run) + '-6-9']
            uu = bin6.uu + bin7.uu + bin8.uu + bin9.uu
            ud = bin6.ud + bin7.ud + bin8.ud + bin9.ud
            du = bin6.du + bin7.du + bin8.du + bin9.du
            dd = bin6.dd + bin7.dd + bin8.dd + bin9.dd
            
            pol = polarizations[bin7.fill]
            
            asym_zp.FillFromHistogramManager(mgr, 'jetpatch', 1, uu,ud,du,dd,
                pol.py,pol.pb)
            asym_zm.FillFromHistogramManager(mgr, 'jetpatch', -1, uu,ud,du,dd,
                pol.py,pol.pb)
            asym_fp[bin7.fill].FillFromHistogramManager(mgr, 'jetpatch', 1, 
                uu,ud,du,dd, pol.py,pol.pb)
            asym_fm[bin7.fill].FillFromHistogramManager(mgr, 'jetpatch', -1, 
                uu,ud,du,dd, pol.py,pol.pb)
            
    title = {
        'ly':'Yellow Beam', 
        'lb':'Blue Beam', 
        'ls':'Like-Sign', 
        'us':'Unlike-Sign'
    }
    marker_color = {
        'ly':ROOT.kYellow, 
        'lb':ROOT.kBlue, 
        'ls':ROOT.kRed, 
        'us':ROOT.kBlack
    }
    
    ROOT.gStyle.SetOptStat(0)
    ROOT.gStyle.SetErrorX(0.0)
    ROOT.gStyle.SetOptFit(111)
    
    canvases = []
    for key in ('ly','lb','ls','us'):
        final_plus = ROOT.TH1D('final_plus_%s' % key, '', len(fills), 0.5, 
            len(fills)+0.5)
        final_minus = ROOT.TH1D('final_minus_%s' % key, '', len(fills), 0.5, 
            len(fills)+0.5)
        canvases.append([final_minus, final_plus])
        for i,f in enumerate(fills):
            hplus = asym_fp[f].GetAsymmetry(key)
            final_plus.SetBinContent( i+1, hplus.GetBinContent(1) )
            final_plus.SetBinError( i+1, hplus.GetBinError(1) )
            hplus.Delete()
            
            hminus = asym_fm[f].GetAsymmetry(key)
            final_minus.SetBinContent( i+1, hminus.GetBinContent(1) )
            final_minus.SetBinError( i+1, hminus.GetBinError(1) )
            hminus.Delete()
            
        for var,p,m in [('z',asym_zp,asym_zm), ('fill',asym_fp,asym_fm)]:
            c = graphics.canvas2()
            canvases.append(c)
        
            hp = (var == 'z') and p.GetAsymmetry(key) or final_plus
            hp.SetTitle(title[key] + ' SSA for #pi^{+}')
            hp.SetMarkerStyle(21)
    
            hm = (var == 'z') and m.GetAsymmetry(key) or final_minus
            hm.SetTitle(title[key] + ' SSA for #pi^{-}')
            hm.SetMarkerStyle(20)
    
            for h in (hp,hm):
                h.SetMarkerColor(marker_color[key])
                if var == 'fill':
                    h.GetYaxis().SetRangeUser(-0.2, 0.2)
                    h.SetXTitle('fill index')
                elif var == 'z':
                    h.SetXTitle('p_{T}(#pi) / p_{T}(jet)')
                    if key in ('ly', 'lb'):
                        h.GetYaxis().SetRangeUser(-0.05, 0.05)
                    else:
                        h.GetYaxis().SetRangeUser(-0.1, 0.1)
        
            c.cd(1)
            hm.Fit('pol0')
            hm.Draw('e1')
        
            c.cd(2)
            hp.Fit('pol0')
            hp.Draw('e1')
        
            c.Print('%s_ssa_%s.png' % (key, var))
    
    raw_input('wait here:')
Example #3
0
def pt_shift_uncertainty_asymmetry():
    """
    calculate A_{LL} assuming different jet pt shifts
    """
    asym_pl = AsymmetryGenerator('asym_pl', bins=zbins, key='z_away2_low')
    asym_pm = AsymmetryGenerator('asym_pm', bins=zbins, key='z_away2')
    asym_ph = AsymmetryGenerator('asym_ph', bins=zbins, key='z_away2_high')
    asym_ml = AsymmetryGenerator('asym_ml', bins=zbins, key='z_away2_low')
    asym_mm = AsymmetryGenerator('asym_mm', bins=zbins, key='z_away2')
    asym_mh = AsymmetryGenerator('asym_mh', bins=zbins, key='z_away2_high')
    
    scalars = ScalarCounts(os.environ['STAR'] + 
        '/StRoot/StSpinPool/StTamuRelLum/inputs/run6.txt')
    
    polarizations = Polarizations.Final
    
    ## generate the asymmetries
    allFiles = glob(histDir + '/chargedPions_*.hist.root')
    for fname in allFiles[:]:
        run = getRun(fname)
        if run in runlist:
            print fname, run
            mgr = HistogramManager(ROOT.TFile(fname), ['z_away2', 
                'z_away2_low', 'z_away2_high'])
            
            try:
                bin6 = scalars[str(run) + '-5-6']
                bin7 = scalars[str(run) + '-5-7']
                bin8 = scalars[str(run) + '-5-8']
                bin9 = scalars[str(run) + '-5-9']
            except KeyError:
                bin6 = scalars[str(run) + '-6-6']
                bin7 = scalars[str(run) + '-6-7']
                bin8 = scalars[str(run) + '-6-8']
                bin9 = scalars[str(run) + '-6-9']
            uu = bin6.uu + bin7.uu + bin8.uu + bin9.uu
            ud = bin6.ud + bin7.ud + bin8.ud + bin9.ud
            du = bin6.du + bin7.du + bin8.du + bin9.du
            dd = bin6.dd + bin7.dd + bin8.dd + bin9.dd
            
            pol = polarizations[bin7.fill]
            
            asym_ml.FillFromHistogramManager(mgr, 'jetpatch', -1, uu,ud,du,dd, \
                pol.py,pol.pb)
            asym_mm.FillFromHistogramManager(mgr, 'jetpatch', -1, uu,ud,du,dd, \
                pol.py,pol.pb)
            asym_mh.FillFromHistogramManager(mgr, 'jetpatch', -1, uu,ud,du,dd, \
                pol.py,pol.pb)
            asym_pl.FillFromHistogramManager(mgr, 'jetpatch', 1, uu,ud,du,dd, \
                pol.py,pol.pb)
            asym_pm.FillFromHistogramManager(mgr, 'jetpatch', 1, uu,ud,du,dd, \
                pol.py,pol.pb)
            asym_ph.FillFromHistogramManager(mgr, 'jetpatch', 1, uu,ud,du,dd, \
                pol.py,pol.pb)
    
    
    c = graphics.canvas2()
    c.SetLogy(0)
    ROOT.gStyle.SetErrorX(0.0)
    
    c.cd(1)
    hml = asym_ml.GetAsymmetry('ll')
    hmm = asym_mm.GetAsymmetry('ll')
    hmh = asym_mh.GetAsymmetry('ll')
    hmm.SetMarkerStyle(20)
    hmm.SetTitle('p_{T} shift uncertainty on A_{LL} #pi^{-}')
    # hml.Fit('pol0', 'q')
    hmm.Draw('e1')
    gml = ROOT.TGraphErrors(hml)
    gmh = ROOT.TGraphErrors(hmh)
    for i in range(hmm.GetNbinsX()):
        gml.SetPoint(i, hml.GetBinCenter(i+1)-0.02, hml.GetBinContent(i+1))
        gmh.SetPoint(i, hmh.GetBinCenter(i+1)+0.02, hmh.GetBinContent(i+1))
    gml.Draw('p')
    gmh.Draw('p')
    
    c.cd(2)
    hpl = asym_pl.GetAsymmetry('ll')
    hpm = asym_pm.GetAsymmetry('ll')
    hph = asym_ph.GetAsymmetry('ll')
    hpm.SetTitle('p_{T} shift uncertainty on A_{LL} #pi^{+}')
    hpm.SetMarkerStyle(21)
    # hpl.Fit('pol0', 'q')
    hpm.Draw('e1')
    gpl = ROOT.TGraphErrors(hpl)
    gph = ROOT.TGraphErrors(hph)
    for i in range(hpm.GetNbinsX()):
        gpl.SetPoint(i, hpl.GetBinCenter(i+1)-0.02, hpl.GetBinContent(i+1))
        gph.SetPoint(i, hph.GetBinCenter(i+1)+0.02, hph.GetBinContent(i+1))
    gpl.Draw('p')
    gph.Draw('p')
    
    for g in (gml, gmh):
        g.SetMarkerStyle(24)
    for g in (gpl, gph):
        g.SetMarkerStyle(25)
    
    for h in (hmm,hpm):
        h.GetXaxis().SetTitle('p_{T}(#pi)/p_{T}(jet)')
        h.GetYaxis().SetRangeUser(-0.06, 0.08)
    
    raw_input('wait here:')
    c.Print('pt_shift_uncertainty_asymmetry.png')
    
    print '\nπ- shift asymmetry'
    for bin in range(1, hmm.GetNbinsX()+1):
        low = hml.GetBinContent(bin)
        mid = hmm.GetBinContent(bin)
        high = hmh.GetBinContent(bin)
        diffl = abs(mid-low)
        diffh = abs(mid-high)
        diff = (diffl+diffh)/2
        print '[%.2f-%.2f]  % .3f low, %.3f high, %.3f avg' % \
            (hmm.GetBinLowEdge(bin), hmm.GetBinLowEdge(bin+1),diffl,diffh,diff)
    
    print '\nπ+ shift asymmetry'
    for bin in range(1, hpm.GetNbinsX()+1):
        low = hpl.GetBinContent(bin)
        mid = hpm.GetBinContent(bin)
        high = hph.GetBinContent(bin)
        diffl = abs(mid-low)
        diffh = abs(mid-high)
        diff = (diffl+diffh)/2
        print '[%.2f-%.2f]  % .3f low, %.3f high, %.3f avg' % \
            (hpm.GetBinLowEdge(bin), hpm.GetBinLowEdge(bin+1),diffl,diffh,diff)
Example #4
0
def result():
    """
    result plot showing asymmetries versus z
    """    
    asym_p = AsymmetryGenerator('asym_p', bins=zbins, key='z_away2')
    asym_m = AsymmetryGenerator('asym_m', bins=zbins, key='z_away2')
    
    scalars = ScalarCounts(os.environ['STAR'] + 
        '/StRoot/StSpinPool/StTamuRelLum/inputs/run6.txt')
    
    polarizations = Polarizations.Final
    
    allFiles = glob(histDir + '/chargedPions_*.hist.root')
    for fname in allFiles[:]:
        run = getRun(fname)
        if run in runlist:
            print fname, run
            mgr = HistogramManager(ROOT.TFile(fname), ['z_away2'])
            
            try:
                bin6 = scalars[str(run) + '-5-6']
                bin7 = scalars[str(run) + '-5-7']
                bin8 = scalars[str(run) + '-5-8']
                bin9 = scalars[str(run) + '-5-9']
            except KeyError:
                bin6 = scalars[str(run) + '-6-6']
                bin7 = scalars[str(run) + '-6-7']
                bin8 = scalars[str(run) + '-6-8']
                bin9 = scalars[str(run) + '-6-9']
            uu = bin6.uu + bin7.uu + bin8.uu + bin9.uu
            ud = bin6.ud + bin7.ud + bin8.ud + bin9.ud
            du = bin6.du + bin7.du + bin8.du + bin9.du
            dd = bin6.dd + bin7.dd + bin8.dd + bin9.dd
            
            pol = polarizations[bin7.fill]
            
            asym_p.FillFromHistogramManager(mgr, 'jetpatch', 1, uu,ud,du,dd, \
                pol.py,pol.pb)
            asym_m.FillFromHistogramManager(mgr, 'jetpatch', -1, uu,ud,du,dd, \
                pol.py,pol.pb)
    
    ## fun with graphics
    ROOT.gStyle.SetErrorX(0.0)
    ROOT.gStyle.SetOptDate(0)
    
    c = graphics.canvas2()
    c.SetLogy(0)
    
    line = ROOT.TLine(zbins[0], 0.0, zbins[-1], 0.0)
    line.SetLineStyle(2)
    line.SetLineColor(10)
    
    prelim = ROOT.TText()
    prelim.SetTextColor(44)
    prelim.SetTextAlign(21)
    
    latex = ROOT.TLatex()
    latex.SetTextSize(0.25)
    # latex.SetTextAlign(21)
    
    syst = systematic_uncertainties()
    syst_m = ROOT.TGraphErrors(len(zbins))
    syst_p = ROOT.TGraphErrors(len(zbins))
    
    for g in (syst_m,syst_p):
        g.SetMarkerColor(15)
        g.SetFillColor(15)
        g.SetPoint(len(zbins), 1.0, 0)
        g.SetPointError(len(zbins), 0., 0.)
        g.GetXaxis().SetRangeUser(zbins[0], zbins[-1])
    
    hm = asym_m.GetAsymmetry('ll')
    hp = asym_p.GetAsymmetry('ll')
    
    for i in range(len(zbins)-1):
        z = (zbins[i] + zbins[i+1])/2
        syst_m.SetPoint(i, z, hm.GetBinContent(i+1))
        syst_m.SetPointError(i, 0.01, syst['minus'][i])
        syst_p.SetPoint(i, z, hp.GetBinContent(i+1))
        syst_p.SetPointError(i, 0.01, syst['plus'][i])
        
    c.cd(1)
    syst_m.Draw('a2p')
    line.Draw()
    hm.SetMarkerStyle(20)
    hm.Draw('e1 same')
    prelim.DrawText(0.5,0.065,"2006 STAR Preliminary")
    latex.DrawLatex(0.07 + zbins[0], -0.085, '#pi^{-}')
    
    c.cd(2)
    syst_p.Draw('a2p')
    line.Draw()
    hp.SetMarkerStyle(21)
    hp.Draw('e1 same')
    prelim.DrawText(0.5,0.065,"2006 STAR Preliminary")
    latex.DrawLatex(0.07 + zbins[0], -0.085, '#pi^{+}')
    
    for h in (hm,hp, syst_m, syst_p):
        h.SetTitle('')
        h.GetXaxis().SetTitle('z = p_{T}(#pi)/p_{T}(jet)')
        h.GetYaxis().SetRangeUser(-0.1, 0.1)
    
    raw_input('wait here:')
    c.Print('preliminary_result.png')
    
    print '\nπ- A_{LL}'
    for bin in range(1, hm.GetNbinsX()+1):
        print '[%.2f-%.2f]  % .3f ± %.3f' % (hm.GetBinLowEdge(bin), 
            hm.GetBinLowEdge(bin+1), hm.GetBinContent(bin), hm.GetBinError(bin))
    
    print '\nπ+ A_{LL}'
    for bin in range(1, hp.GetNbinsX()+1):
        print '[%.2f-%.2f]  % .3f ± %.3f' % (hp.GetBinLowEdge(bin), 
            hp.GetBinLowEdge(bin+1), hp.GetBinContent(bin), hp.GetBinError(bin))
    
    color = {
        'STD': ROOT.kBlack,
        'ZERO': ROOT.kBlue,
        'GS_NLOC': ROOT.kMagenta,
        'MIN': ROOT.kGreen,
        'DSSV': ROOT.kGreen + 100
    }
    title = {
        'STD': 'GRSV-STD',
        'MIN': 'GRSV-MIN',
        'ZERO': 'GRSV-ZERO',
        'GS_NLOC': 'GS Set C',
        'DSSV': 'DSSV'
    }
    mcasym_tfile = ROOT.TFile(mcasymFile)
    keys = ['STD','ZERO','GS_NLOC','DSSV']
    wkeys = [key+'w' for key in keys]
    mgr2 = HistogramManager(mcasym_tfile, keys=wkeys)
    leg = ROOT.TLegend(0.6, 0.13, 0.87, 0.37)
    leg.SetHeader('LO MC Evaluation')
    leg.SetBorderSize(1)
    for key in keys:
        m = mgr2['anyspin']['117001'].tracks_minus[key+'w']
        p = mgr2['anyspin']['117001'].tracks_plus[key+'w']
        for h in (m,p):
            h.Smooth(2)
            h.SetLineColor(color[key])
            h.SetFillColor(color[key])
            h.SetLineWidth(2)
        leg.AddEntry(m, title[key])
        c.cd(1)
        m.Draw('e3 same')
        hm.Draw('e1 same')
        c.cd(2)
        p.Draw('e3 same')
        hp.Draw('e1 same')
    c.cd(1)
    leg.Draw()
    raw_input('now wait here:')
    
    c.Print('preliminary_result_models.png')
Example #5
0
def run6_result_theory_curves():
    """
    result plot showing asymmetries versus z
    """    
    asym_p = AsymmetryGenerator('asym_p', bins=zbins, key='z_away2')
    asym_m = AsymmetryGenerator('asym_m', bins=zbins, key='z_away2')
    
    scalars = ScalarCounts(os.environ['STAR'] + 
        '/StRoot/StSpinPool/StTamuRelLum/inputs/run6.txt')
    
    polarizations = Polarizations.Final
    
    allFiles = glob(histDir + '/chargedPions_*.hist.root')
    for fname in allFiles[:]:
        run = getRun(fname)
        if run in runlist:
            print fname, run
            mgr = HistogramManager(ROOT.TFile(fname), ['z_away2'])
            
            try:
                bin6 = scalars[str(run) + '-5-6']
                bin7 = scalars[str(run) + '-5-7']
                bin8 = scalars[str(run) + '-5-8']
                bin9 = scalars[str(run) + '-5-9']
            except KeyError:
                bin6 = scalars[str(run) + '-6-6']
                bin7 = scalars[str(run) + '-6-7']
                bin8 = scalars[str(run) + '-6-8']
                bin9 = scalars[str(run) + '-6-9']
            uu = bin6.uu + bin7.uu + bin8.uu + bin9.uu
            ud = bin6.ud + bin7.ud + bin8.ud + bin9.ud
            du = bin6.du + bin7.du + bin8.du + bin9.du
            dd = bin6.dd + bin7.dd + bin8.dd + bin9.dd
            
            pol = polarizations[bin7.fill]
            
            asym_p.FillFromHistogramManager(mgr, 'jetpatch', 1, uu,ud,du,dd, \
                pol.py,pol.pb)
            asym_m.FillFromHistogramManager(mgr, 'jetpatch', -1, uu,ud,du,dd, \
                pol.py,pol.pb)
    
    ## fun with graphics
    ROOT.gStyle.SetErrorX(0.0)
    ROOT.gStyle.SetOptDate(0)
    
    c = graphics.canvas2()
    c.SetLogy(0)
    
    for i in (1, 2):
        pad = c.cd(i)
        pad.SetTopMargin(0.03)
        pad.SetBottomMargin(0.1)
        pad.SetLeftMargin(0.12)
        pad.SetRightMargin(0.02)
    
    line = ROOT.TLine(zbins[0], 0.0, zbins[-1], 0.0)
    line.SetLineStyle(2)
    
    prelim = ROOT.TText()
    prelim.SetTextColor(44)
    prelim.SetTextAlign(21)
    
    latex = ROOT.TLatex()
    latex.SetTextSize(0.25)
    
    syst = systematic_uncertainties()
    syst_m = ROOT.TGraphErrors(len(zbins))
    syst_p = ROOT.TGraphErrors(len(zbins))
    
    for g in (syst_m,syst_p):
        g.SetMarkerColor(15)
        g.SetFillColor(15)
        g.SetPoint(len(zbins), 1.0, 0)
        g.SetPointError(len(zbins), 0., 0.)
        g.GetXaxis().SetRangeUser(zbins[0], zbins[-1])
    
    hm = asym_m.GetAsymmetry('ll')
    hp = asym_p.GetAsymmetry('ll')
    for i in range(len(zbins)-1):
        z = (zbins[i] + zbins[i+1])/2
        syst_m.SetPoint(i, z, hm.GetBinContent(i+1))
        syst_m.SetPointError(i, 0.01, syst['minus'][i])
        syst_p.SetPoint(i, z, hp.GetBinContent(i+1))
        syst_p.SetPointError(i, 0.01, syst['plus'][i])
    
    [ g.GetXaxis().SetRangeUser(zbins[0], zbins[-1]) for g in (syst_m,syst_p) ]
    
    for h in (hm,hp, syst_m, syst_p):
        h.SetTitle('')
        h.GetXaxis().SetTitle('z')
        h.GetYaxis().SetRangeUser(-0.05, 0.08)
        h.GetYaxis().SetTitle('A_{LL}  ')
        h.GetYaxis().SetTitleSize(0.06)
        h.GetYaxis().SetTitleOffset(1.0)
        h.GetXaxis().SetTitle('z  ')
        h.GetXaxis().SetTitleSize(0.065)
        h.GetXaxis().SetTitleOffset(0.7)
    
    title = {
        'STD': 'GRSV-STD',
        'GSC': 'GS Set C',
        'DSSV': 'DSSV'
    }
    
    def make_graph(num, denom):
        g = ROOT.TGraphErrors(len(num))
        for i,n in enumerate(num):
            d = denom[i]
            val = n.y / d.y
            err = val*math.sqrt((n.sys/n.y)**2 + (d.sys/d.y)**2)
            g.SetPoint(i, n.x, val)
            g.SetPointError(i, 0, err)
        return g
    
    nlo_m = {
        'STD': make_graph(analysis.deflorian.minus.std, 
            analysis.deflorian.minus.mrst),
        'DSSV': make_graph(analysis.deflorian.minus.dssv, 
            analysis.deflorian.minus.mrst),
        'GSC': make_graph(analysis.deflorian.minus.gsc, 
            analysis.deflorian.minus.mrst),
    }
    nlo_p = {
        'STD': make_graph(analysis.deflorian.plus.std, 
            analysis.deflorian.plus.mrst),
        'DSSV': make_graph(analysis.deflorian.plus.dssv, 
            analysis.deflorian.plus.mrst),
        'GSC': make_graph(analysis.deflorian.plus.gsc, 
            analysis.deflorian.plus.mrst),
    }
    
    for nlo in (nlo_m, nlo_p):
        nlo['DSSV'].SetLineStyle(2)
        nlo['GSC'].SetLineColor(ROOT.kMagenta)
        nlo['DSSV'].SetLineColor(ROOT.kGreen+2)
        [gr.SetLineWidth(3) for gr in nlo.values()]
        [gr.SetFillColor(ROOT.kOrange) for gr in nlo.values()]
    
    leg = ROOT.TLegend(0.69, 0.15, 0.97, 0.36)
    leg.SetBorderSize(0)
    leg.SetNColumns(1)
    leg.AddEntry(nlo_m['STD'], 'GRSV-STD', 'l')
    leg.AddEntry(nlo_m['DSSV'], 'DSSV', 'l')
    leg.AddEntry(nlo_m['GSC'], 'GS-C', 'l')
    
    latex2 = ROOT.TLatex()
    
    c.cd(1)
    hm.SetMarkerStyle(20)
    syst_m.Draw('a2p')
    prelim.DrawText(0.42,-0.041,"STAR Preliminary")
    latex.DrawLatex(0.05 + zbins[0], 0.044, '#pi^{-}')
    latex2.DrawLatex(0.45, 0.06, '10 < jet p_{T} < 30')
    latex2.DrawLatex(0.5, 0.045, '#pi p_{T} > 2')
    [ g.Draw('3') for g in nlo_m.values() ]
    [ g.Draw('lx') for g in nlo_m.values() ]
    line.Draw()
    syst_m.Draw('2p')
    hm.Draw('e1 same')
    
    c.cd(2)
    hp.SetMarkerStyle(21)
    syst_p.Draw('a2p')
    prelim.DrawText(0.42,-0.041,"STAR Preliminary")
    latex.DrawLatex(0.05 + zbins[0], 0.044, '#pi^{+}')
    [ g.Draw('3') for g in nlo_p.values() ]
    [ g.Draw('lx') for g in nlo_p.values() ]
    line.Draw()
    leg.Draw()
    syst_p.Draw('2p')
    hp.Draw('e1 same')
    
    graphics.maybe_save(c)