Exemplo n.º 1
0
def makeNumPro(method):
    c = Canvas('c')
    c.cd()
    c.SetTicks(1,1)
    c.SetLogy()
    h_16 = getHist(method,['2016'],'h_num_pro')
    h_17 = getHist(method,['2017'],'h_num_pro')
    h_18 = getHist(method,['2018'],'h_num_pro')
    h_18.SetTitle(''), h_18.GetXaxis().SetTitle('Number Of Reconstructed Protons'), h_18.GetYaxis().SetTitle('Events')
    h_18.SetMarkerStyle(20), h_17.SetMarkerStyle(20), h_16.SetMarkerStyle(20)
    h_18.SetMarkerColor(ROOT.darkLime), h_17.SetMarkerColor(ROOT.turquois), h_16.SetMarkerColor(ROOT.orangeSoda)
    h_18.SetMarkerSize(1.5), h_17.SetMarkerSize(1.5), h_16.SetMarkerSize(1.5)
    h_18.SetLineColor(ROOT.darkLime), h_17.SetLineColor(ROOT.turquois), h_16.SetLineColor(ROOT.orangeSoda)
    h_18.SetLineWidth(2), h_17.SetLineWidth(2), h_16.SetLineWidth(2)
    h_18.SetMinimum(10000.0)
    h_18.Draw('p')
    h_17.Draw('p same')
    h_16.Draw('p same')
    c.SetGrid(0,1)
    legend = TLegend(0.6,0.7,0.8,0.78)
    legend.SetTextSize(0.03)
    legend.SetLineColor( 0 )
    legend.SetFillColor( 0 )
    legend.AddEntry(h_18,"2018",'lp')
    legend.AddEntry(h_17,"2017",'lp')
    legend.AddEntry(h_16,"2016",'lp')
    legend.Draw()
    pLabel = prelimLabel('top',True,h_18.GetMaximum())
    pLabel.Draw()
    c.SaveAs('plots/combined/h_num_pro_%s.png' % (selection))
Exemplo n.º 2
0
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))
Exemplo n.º 3
0
def makeDetType():
    c = Canvas('c')
    c.cd()
    c.SetTicks(1,1)
    h_type = ROOT.TH1F('h_type', '', 2, 3, 5)
    for year in years:
        for pf in protonFiles:
            if year == pf[0]: pfile = pf[1]
        h_type.Add( pfile.Get('plots/h_detType') )
    h_type.Scale(1.0/1000.0)
    h_type.GetXaxis().SetBinLabel(1,'Si Strip'), h_type.GetXaxis().SetBinLabel(2,'Pixel')
    h_type.GetYaxis().SetTitle('Events/0.001')
    h_type.Draw('p')
    h_type.SetLineColor(ROOT.kBlack)
    h_type.SetLineWidth(2)
    h_type.SetMarkerStyle(20)
    h_type.SetMinimum(0.0), h_type.SetMaximum( h_type.GetMaximum() * 1.5 )
    h_type.SetMarkerSize(0.9)
    c.SetGrid(0,1)
    pLabel, sLabel, lLabel = prelimLabel('left',False,h_type.GetMaximum()), selectionLabel('singleRP',False,False,h_type.GetMaximum()), lumiLabel(False,years)
    pLabel.Draw(), sLabel.Draw(), lLabel.Draw()
    c.SaveAs('plots/%s/h_detType_%s_%s.png' % (s_years,selection,s_years))
Exemplo n.º 4
0
def makeProtonSide(log):
    c = Canvas('c')
    c.cd()
    c.SetLeftMargin(0.15)
    if log: c.SetLogy()
    c.SetTicks(1,1)
    h_single = ROOT.TH1F('h_single', '', 4, 0, 4)
    h_multi = ROOT.TH1F('h_multi', '', 4, 0, 4)
    for year in years:
        for pf in protonFiles:
            if year == pf[0]: pf_single, pf_multi = pf[1], pf[2]
        h_single.Add( pf_single.Get('plots/h_proton_side') )
        h_multi.Add( pf_multi.Get('plots/h_proton_side') )
    
    denom = h_single.GetEntries()
    h_multi.Scale(1.0/denom)
    h_multi.GetYaxis().SetTitle('Fraction Of Events')
    h_multi.GetXaxis().SetBinLabel(1,'No protons'), h_multi.GetXaxis().SetBinLabel(2,'sector45 only'), h_multi.GetXaxis().SetBinLabel(3,'sector56 only'), h_multi.GetXaxis().SetBinLabel(4,'Both')
    h_multi.Draw('p')
    h_single.Scale(1.0/denom)
    h_single.Draw('p same')
    h_single.SetMarkerColor(62), h_multi.SetMarkerColor(207)
    h_single.SetLineColor(62), h_multi.SetLineColor(207)
    h_single.SetLineWidth(2), h_multi.SetLineWidth(2)
    h_single.SetMarkerStyle(20), h_multi.SetMarkerStyle(20)
    h_multi.SetMinimum(0.0), h_multi.SetMaximum( h_multi.GetMaximum()*1.5 )
    h_single.SetMarkerSize(0.9), h_multi.SetMarkerSize(0.9)
    c.SetGrid(0,1)
    legend = TLegend(0.6,0.7,0.8,0.78)
    legend.SetTextSize(0.03)
    legend.SetLineColor( 0 )
    legend.SetFillColor( 0 )
    legend.AddEntry(h_single,"singleRP",'lp')
    legend.AddEntry(h_multi,"multiRP",'lp')
    legend.Draw()
    pLabel, lLabel = prelimLabel('top',log,h_single.GetMaximum()), lumiLabel(False,years)
    pLabel.SetMargin(0.49)
    pLabel.Draw(), lLabel.Draw()
    c.SaveAs('plots/%s/h_proton_side_%s_%s.pdf' % (s_years,selection,s_years))
Exemplo n.º 5
0
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))