def makeXiAcceptance(pot,log): c = Canvas('c') c.cd() if log: c.SetLogy() c.SetTicks(1,1) c.SetGrid(1,1) h = ROOT.TH1F('h', '', 100, 0, 0.2) for year in years: for pf in protonFiles: if year == pf[0]: pfile = pf[1] h.Add( pfile.Get('plots/h_pro_xi_%s' % pot) ) h.Rebin(2) #h.Scale(1.0/100.0) for pp in proton_pot: if pot == pp[0]: v_pot = pp h.GetXaxis().SetTitle('#xi '+v_pot[1]) h.GetYaxis().SetTitle('Events') h.SetLineColor(ROOT.kBlack) h.SetMarkerStyle(24) minx, miny, maxx, maxy = 0.0001, h.GetMinimum(), 0.2, h.GetMaximum()*10 if log else h.GetMaximum()*1.2 c.DrawFrame(minx, miny, maxx, maxy) h.Draw('p e2') h.SetMaximum(maxy) pLabel, lLabel = prelimLabel('top',log,maxy), lumiLabel(log,years) lLabel.SetTextSize(0.034) pLabel.Draw(), lLabel.Draw() c.SaveAs('plots/%s/h_xi_%s_%s.pdf' % (s_years,side,s_years))
def makeXiAcceptanceSide(side,log): c = Canvas('c') c.cd() if log: c.SetLogy() c.SetTicks(1,1) c.SetGrid(1,1) h = ROOT.TH1F('h', '', 100, 0, 0.3) for year in years: for pf in protonFiles: if year == pf[0]: pfile = pf[2] h.Add( pfile.Get('plots/h_pro_xi%s' % side) ) #h.Rebin(2) h.GetXaxis().SetTitle('#xi ^{%s}' % ('+' if side == 'p' else '-')) h.GetYaxis().SetTitle('Events') h.SetLineColor(ROOT.kBlack) h.SetMarkerStyle(24) minx, miny, maxx, maxy = 0.0001, h.GetMinimum(), 0.2, h.GetMaximum()*10 if log else h.GetMaximum()*1.2 c.DrawFrame(minx, miny, maxx, maxy) h.Draw('p e2') h.SetMaximum(maxy) pLabel, lLabel = prelimLabel('top',log,maxy), lumiLabel(log,years) lLabel.SetTextSize(0.034) pLabel.Draw(), lLabel.Draw() c.SaveAs('plots/%s/h_xi%s_%s.pdf' % (s_years,side,s_years))