Esempio n. 1
0
def EMTFEta(plotter):

    ## variables for the plot
    xTitle = "Generated muon |#eta|"
    title = "%s;%s;%s" % (topTitle, xTitle, yTitle)
    toPlot = "TMath::Abs(%s)" % (geneta)

    h_bins = "(20,1.2,2.4)"
    nBins = int(h_bins[1:-1].split(',')[0])
    minBin = float(h_bins[1:-1].split(',')[1])
    maxBin = float(h_bins[1:-1].split(',')[2])

    c = newCanvas()
    gPad.SetGridx(xGrid)
    gPad.SetGridy(yGrid)

    base = TH1F("base", title, nBins, minBin, maxBin)
    base.SetMinimum(0)
    base.SetMaximum(plotter.yMax)
    base.GetXaxis().SetLabelSize(0.05)
    base.GetYaxis().SetLabelSize(0.05)
    base.GetXaxis().SetTitleSize(0.05)
    base.GetYaxis().SetTitleSize(0.05)
    base.Draw("")
    CMS_lumi.CMS_lumi(c, iPeriod, iPos)

    denom_cut = AND(ok_eta(1.2, 2.4), ok_2_csc_lcts())

    h1 = draw_geff(plotter.tree, title, h_bins, toPlot,
                   AND(denom_cut, TCut("genParticle.pt>20")), ok_emtf(20),
                   "same", kBlue)
    h2 = draw_geff(plotter.tree, title, h_bins, toPlot,
                   AND(denom_cut, TCut("genParticle.pt>15")), ok_emtf(15),
                   "same", kRed)
    h3 = draw_geff(plotter.tree, title, h_bins, toPlot,
                   AND(denom_cut, TCut("genParticle.pt>10")), ok_emtf(10),
                   "same", kGreen + 2)
    h4 = draw_geff(plotter.tree, title, h_bins, toPlot,
                   AND(denom_cut, TCut("genParticle.pt>5")), ok_emtf(5),
                   "same", kOrange + 2)
    h5 = draw_geff(plotter.tree, title, h_bins, toPlot,
                   AND(denom_cut, TCut("genParticle.pt>3")), ok_emtf(0),
                   "same", kBlack)

    leg = TLegend(0.45, 0.2, .75, 0.5, "", "brNDC")
    leg.SetBorderSize(0)
    leg.SetFillStyle(0)
    leg.SetTextSize(0.05)
    leg.SetHeader("EMTF")
    leg.AddEntry(h1, "p_{T} > 20 GeV", "l")
    leg.AddEntry(h2, "p_{T} > 15 GeV", "l")
    leg.AddEntry(h3, "p_{T} > 10 GeV", "l")
    leg.AddEntry(h4, "p_{T} > 5 GeV", "l")
    leg.AddEntry(h5, "p_{T} > 0 GeV", "l")
    leg.Draw("same")

    c.Print("%sEff_EMTF_eta_Pt20_%s" %
            (plotter.targetDir + subdirectory, plotter.ext))

    del c, base, h1, leg, h2, h3, h4, h5
Esempio n. 2
0
def CSCCLCTPos(plotter):

    for st in range(0, len(cscStations)):

        h_bins = "(100,-1,1)"
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        gPad.SetGrid(1, 1)
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(0)
        base.SetMaximum(0.08)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        toPlot1 = delta_fhs_clct(st)
        toPlot2 = delta_fqs_clct(st)
        toPlot3 = delta_fes_clct(st)

        h1 = draw_1D(plotter.tree, title, h_bins, toPlot1, "", "same", kBlue)
        h2 = draw_1D(plotter.tree, title, h_bins, toPlot2, "", "same",
                     kGreen + 2)
        h3 = draw_1D(plotter.tree, title, h_bins, toPlot3, "", "same",
                     kRed + 1)

        h1.Scale(1. / h1.GetEntries())
        h2.Scale(1. / h2.GetEntries())
        h3.Scale(1. / h3.GetEntries())
        base.SetMaximum(h3.GetBinContent(h3.GetMaximumBin()) * 1.5)
        h1.Draw("histsame")
        h2.Draw("histsame")
        h3.Draw("histsame")

        leg = TLegend(0.15, 0.6, .45, 0.9, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.05)
        leg.AddEntry(h1, "1/2 strip", "pl")
        leg.AddEntry(h2, "1/4 strip", "pl")
        leg.AddEntry(h3, "1/8 strip", "pl")
        leg.Draw("same")

        csc = drawCSCLabel(cscStations[st].label, 0.85, 0.85, 0.05)

        c.Print("%sRes_CSCCLCT_pos_%s%s" %
                (plotter.targetDir + subdirectory, cscStations[st].labelc,
                 plotter.ext))

        del base, h2, leg, csc, h1, h3, c
Esempio n. 3
0
def GEMCSCLCT(plotter):

    ## variables for the plot
    xTitle = "Generated muon |#eta|"
    title = "%s;%s;%s" % (topTitle, xTitle, yTitle)
    toPlot = "TMath::Abs(eta)"

    for st in [0, 5]:

        h_bins = "(25,%f,%f)" % (cscStations[st].eta_min,
                                 cscStations[st].eta_max)
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(plotter.yMin)
        base.SetMaximum(plotter.yMax)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        gemst = 1
        if st == 5:
            gemst = 2

        ok_alct_clct = ok_csc_clct(st) and ok_csc_alct(st) and ok_gem_pad(
            gemst)
        ok_alct_gem = ok_csc_alct(st) and ok_gem_copad(gemst)
        ok_clct_gem = ok_csc_clct(st) and ok_gem_copad(gemst)

        ok_any_combination = ok_alct_clct or ok_alct_gem or ok_clct_gem

        h2 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_csc_sh(st),
                       ok_any_combination, "same", kBlue)

        leg = TLegend(0.45, 0.2, .75, 0.5, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.05)
        leg.AddEntry(h2, "LCT", "pl")
        leg.Draw("same")

        csc = drawCSCLabel(cscStations[st].label, 0.85, 0.85, 0.05)

        c.Print("%sEff_GEMCSCLCT_%s%s" % (plotter.targetDir + subdirectory,
                                          cscStations[st].labelc, plotter.ext))

        del c, base, leg, csc, h2
Esempio n. 4
0
def L1TrackMuonPt(plotter):

    ## variables for the plot
    topTitle = ""
    xTitle = "Generated muon p_{T} [GeV]"
    title = "%s;%s;%s" % (topTitle, xTitle, yTitle)
    toPlot = genpt

    h_bins = "(20,0,100)"
    nBins = int(h_bins[1:-1].split(',')[0])
    minBin = float(h_bins[1:-1].split(',')[1])
    maxBin = float(h_bins[1:-1].split(',')[2])

    c = newCanvas()
    base = TH1F("base", title, nBins, minBin, maxBin)
    base.SetMinimum(0)
    base.SetMaximum(plotter.yMax)
    base.GetXaxis().SetLabelSize(0.05)
    base.GetYaxis().SetLabelSize(0.05)
    base.GetXaxis().SetTitleSize(0.05)
    base.GetYaxis().SetTitleSize(0.05)
    base.Draw("")
    CMS_lumi.CMS_lumi(c, iPeriod, iPos)

    denom_cut = AND(ok_eta(1.2, 2.4), ok_2_csc_lcts())

    h1 = draw_geff(plotter.tree, title, h_bins, toPlot, denom_cut,
                   ok_l1trackmuon(20), "same", kBlue)
    h2 = draw_geff(plotter.tree, title, h_bins, toPlot, denom_cut,
                   ok_l1trackmuon(15), "same", kRed)
    h3 = draw_geff(plotter.tree, title, h_bins, toPlot, denom_cut,
                   ok_l1trackmuon(10), "same", kGreen + 2)
    h4 = draw_geff(plotter.tree, title, h_bins, toPlot, denom_cut,
                   ok_l1trackmuon(5), "same", kOrange + 2)
    h5 = draw_geff(plotter.tree, title, h_bins, toPlot, denom_cut,
                   ok_l1trackmuon(0), "same", kBlack)

    leg = TLegend(0.45, 0.2, .75, 0.5, "", "brNDC")
    leg.SetBorderSize(0)
    leg.SetFillStyle(0)
    leg.SetTextSize(0.05)
    leg.SetHeader("L1TrackMuon")
    leg.AddEntry(h1, "p_{T} > 20 GeV", "l")
    leg.AddEntry(h2, "p_{T} > 15 GeV", "l")
    leg.AddEntry(h3, "p_{T} > 10 GeV", "l")
    leg.AddEntry(h4, "p_{T} > 5 GeV", "l")
    leg.AddEntry(h5, "p_{T} > 0 GeV", "l")
    leg.Draw("same")

    c.Print("%sEff_L1TrackMuon_pt_Pt20_%s" %
            (plotter.targetDir + subdirectory, plotter.ext))

    del c, base, h1, leg, h2, h3, h4, h5
Esempio n. 5
0
def CSCCLCTBend(plotter):

    xTitle = "Slope_{L1T} - Slope_{SIM} [Strips/layer]"
    yTitle = "Normalized"
    title = "%s;%s;%s" % (topTitle, xTitle, yTitle)

    for st in range(0, len(cscStations)):

        h_bins = "(50,-0.5,0.5)"
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        gPad.SetGrid(1, 1)
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(0)
        base.SetMaximum(0.08)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        toPlot1 = delta_bend_clct(st)

        h1 = draw_1D(plotter.tree, title, h_bins, toPlot1, "", "same", kBlue)

        h1.Scale(1. / h1.GetEntries())
        base.SetMaximum(h1.GetBinContent(h1.GetMaximumBin()) * 1.5)
        h1.Draw("histsame")

        leg = TLegend(0.15, 0.6, .45, 0.9, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.05)
        leg.AddEntry(h1, "CLCT", "pl")
        leg.Draw("same")

        csc = drawCSCLabel(cscStations[st].label, 0.85, 0.85, 0.05)

        c.Print("%sRes_CSCCLCT_bend_%s%s" %
                (plotter.targetDir + subdirectory, cscStations[st].labelc,
                 plotter.ext))

        del c, base, leg, csc, h1
Esempio n. 6
0
def CSCSimHitPhi(plotter):

    ## variables for the plot

    xTitle = "Generated muon #phi [rad]"
    title = "%s;%s;%s" % (topTitle, xTitle, yTitle)
    toPlot = "phi"

    for st in range(0, len(cscStations)):

        h_bins = "(50,%f,%f)" % (cscStations[st].phi_min,
                                 cscStations[st].phi_max)
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(plotter.yMin)
        base.SetMaximum(plotter.yMax)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        h1 = draw_geff(
            plotter.tree, title, h_bins, toPlot,
            ok_eta(cscStations[st].eta_min, cscStations[st].eta_max),
            ok_csc_sh(st), "same")

        leg = TLegend(0.45, 0.2, .75, 0.35, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.06)
        leg.AddEntry(h1, "SimHit", "l")
        leg.Draw("same")

        csc = drawCSCLabel(cscStations[st].label, 0.87, 0.87, 0.05)

        c.Print("%sEff_CSCSimHit_phi_%s%s" %
                (plotter.targetDir + subdirectory, cscStations[st].labelc,
                 plotter.ext))

        del c, base, h1, leg, csc
Esempio n. 7
0
def CSCStubComparison(plotter, plotter2):

    toPlot = "TMath::Abs(eta)"
    xTitle = "Generated muon |#eta|"
    title = "%s;%s;%s" % (topTitle, xTitle, yTitle)

    for st in range(0, len(cscStations)):

        h_bins = "(25,%f,%f)" % (cscStations[st].eta_min,
                                 cscStations[st].eta_max)
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(plotter.yMin)
        base.SetMaximum(plotter.yMax)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        h2 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_csc_sh(st),
                       ok_csc_clct(st), "same", kBlack)
        h3 = draw_geff(plotter2.tree, title, h_bins, toPlot, ok_csc_sh(st),
                       ok_csc_clct(st), "same", kBlue)

        leg = TLegend(0.45, 0.2, .75, 0.5, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.05)
        leg.AddEntry(h2, "Run-1/2 CLCT", "pl")
        leg.AddEntry(h3, "Run-3 CLCT", "pl")
        leg.Draw("same")

        csc = drawCSCLabel(cscStations[st].label, 0.85, 0.85, 0.05)

        c.Print("%sEff_CSCCLCT_comparison_%s%s" %
                (plotter.targetDir + subdirectory, cscStations[st].labelc,
                 plotter.ext))

        del c, base, leg, csc, h2, h3
Esempio n. 8
0
def GEMDigiEta2(plotter):

    ## variables for the plot

    xTitle = "Generated muon |#eta|"

    title = "%s;%s;%s" % (topTitle, xTitle, yTitle)
    toPlot = "TMath::Abs(eta)"

    for st in range(0, len(gemStations)):
        h_bins = "(50,%f,%f)" % (gemStations[st].eta_min,
                                 gemStations[st].eta_max)
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(plotter.yMin)
        base.SetMaximum(plotter.yMax)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        h1 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_gem_sh2(st),
                       ok_gem_dg2(st), "same")

        leg = TLegend(0.45, 0.2, .75, 0.35, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.06)
        leg.AddEntry(h1, "Two digis", "l")
        leg.Draw("same")

        label = drawCSCLabel(gemStations[st].label, 0.87, 0.87, 0.05)

        c.Print("%sEff_GEMDigi2_eta_%s%s" %
                (plotter.targetDir + subdirectory, gemStations[st].labelc,
                 plotter.ext))

        del c, base, h1, leg, label
Esempio n. 9
0
def MultipleCSCLCTL(plotter):

    ## variables for the plot
    xTitle = "Generated muon L"
    title = "%s;%s;%s" % (topTitle, xTitle, yTitle)
    toPlot = "TMath::Sqrt((vx*vx)+(vy*vy))"

    h_bins = "(34,0,170)"
    nBins = int(h_bins[1:-1].split(',')[0])
    minBin = float(h_bins[1:-1].split(',')[1])
    maxBin = float(h_bins[1:-1].split(',')[2])

    c = newCanvas()
    base = TH1F("base", title, nBins, minBin, maxBin)
    base.SetMinimum(0)
    base.SetMaximum(plotter.yMax)
    base.GetXaxis().SetLabelSize(0.05)
    base.GetYaxis().SetLabelSize(0.05)
    base.GetXaxis().SetTitleSize(0.05)
    base.GetYaxis().SetTitleSize(0.05)
    base.Draw("")
    CMS_lumi.CMS_lumi(c, iPeriod, iPos)

    h1 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_eta(1.2, 2.4),
                   ok_csc_lcts(2), "same", kBlue)
    h2 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_eta(1.2, 2.4),
                   ok_csc_lcts(3), "same", kRed)
    h3 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_eta(1.2, 2.4),
                   ok_csc_lcts(4), "same", kGreen + 2)

    leg = TLegend(0.2, 0.2, .5, 0.5, "", "brNDC")
    leg.SetBorderSize(0)
    leg.SetFillStyle(0)
    leg.SetTextSize(0.06)
    leg.AddEntry(h1, "#geq 2 LCTs", "pl")
    leg.AddEntry(h2, "#geq 3 LCTs", "pl")
    leg.AddEntry(h3, "4 LCTs", "pl")
    leg.Draw("same")

    c.Print("%sEff_MultiLCTs_L_%s" %
            (plotter.targetDir + subdirectory, plotter.ext))

    del c, base, h1, leg
Esempio n. 10
0
def CSCCompWireL(plotter):

    xTitle = "Generated muon L"
    title = "%s;%s;%s" % (topTitle, xTitle, yTitle)
    toPlot = "TMath::Sqrt((vx*vx)+(vy*vy))"

    for st in range(0, len(cscStations)):

        h_bins = "(50,%f,%f)" % (cscStations[st].l_min, cscStations[st].l_max)
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(plotter.yMin)
        base.SetMaximum(plotter.yMax)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        h2 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_csc_sh(st),
                       AND(ok_csc_wire(st), ok_csc_strip(st)), "same")

        leg = TLegend(0.45, 0.2, .75, 0.35, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.06)
        leg.AddEntry(h2, "Wires and comparators", "l")
        leg.Draw("same")

        csc = drawCSCLabel(cscStations[st].label, 0.87, 0.87, 0.05)

        c.Print("%sEff_CSCCompWire_L_%s%s" %
                (plotter.targetDir + subdirectory, cscStations[st].labelc,
                 plotter.ext))

        del c, base, leg, csc, h2
Esempio n. 11
0
def GEMCoPadL(plotter):

    ## variables for the plot
    topTitle = " " * 11 + "GEM CoPad matching" + " " * 35 + "CMS Simulation Preliminary"
    xTitle = "Generated muon L:"
    title = "%s;%s;%s"%(topTitle,xTitle,yTitle)
    toPlot = "TMath::Sqrt((vx*vx)+(vy*vy))"


    for st in range(1,len(gemStations)):

        h_bins = "(50,%f,%f)"%(gemStations[st].l_min,gemStations[st].l_max)
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        base = TH1F("base",title,nBins,minBin,maxBin)
        base.SetMinimum(plotter.yMin)
        base.SetMaximum(plotter.yMax)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        h1 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_gem_sh2(st), ok_gem_copad(st), "same")

        leg = TLegend(0.45,0.2,.75,0.35, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.06)
        leg.AddEntry(h1, "CoPad","l")
        leg.Draw("same")

        label = drawCSCLabel(gemStations[st].label, 0.87,0.87,0.05)
        c.Print("%sEff_GEMCoPad_L_%s%s"%(plotter.targetDir + subdirectory, gemStations[st].labelc,  plotter.ext))

        del c, base, h1, leg, label
Esempio n. 12
0
def GEMPadDigi(plotter):

    for st in range(0,len(gemStations)):

        h_bins = "(50,-0.0015,0.0015)"
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        base  = TH1F("base",title,nBins,minBin,maxBin)
        base.SetMinimum(0)
        base.SetMaximum(0.06)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        h1 = draw_1D(plotter.tree, title, h_bins, dphi_pad1(st), "", "same", kBlue)
        h1.Scale(1./h1.GetEntries())
        h1.Draw("histsame")

        leg = TLegend(0.15,0.6,.45,0.9, "", "brNDC");
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.05)
        leg.AddEntry(h1, "GEM pad","pl")
        leg.Draw("same");

        gem = drawCSCLabel(gemStations[st].label, 0.85,0.85,0.05)

        c.Print("%sRes_GEMPadDigi_%s%s"%(plotter.targetDir + subdirectory, gemStations[st].labelc,  plotter.ext))

        del base, leg, gem, h1, c
Esempio n. 13
0
def CSCCLCTPattern(plotter):

    toPlot = "pt"

    for st in range(0, len(cscStations)):

        topTitle = ""
        xTitle = "Generated p_{T} GeV"
        yTitle = "Efficiency"
        title = "%s;%s;%s" % (topTitle, xTitle, yTitle)

        h_bins = "(20,0,20)"
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(0.0)
        base.SetMaximum(1.1)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        def ok_csc_clct_pattern(st, p1, p2):
            return AND(ok_csc_clct(st),
                       OR(ok_pattern(st, p1), ok_pattern(st, p2)))

        h2 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_csc_sh(st),
                       ok_csc_clct_pattern(st, 2, 3), "same", kBlack)
        h3 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_csc_sh(st),
                       ok_csc_clct_pattern(st, 4, 5), "same", kRed)
        h4 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_csc_sh(st),
                       ok_csc_clct_pattern(st, 6, 7), "same", kBlue)
        h5 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_csc_sh(st),
                       ok_csc_clct_pattern(st, 8, 9), "same", kOrange)
        h6 = draw_geff(plotter.tree, title, h_bins, toPlot, ok_csc_sh(st),
                       ok_csc_clct_pattern(st, 10, 10), "same", kGreen + 2)

        leg = TLegend(0.7, 0.15, .95, 0.45, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.05)
        leg.SetHeader("PID")
        leg.AddEntry(h2, "#geq 2", "pl")
        leg.AddEntry(h3, "#geq 4", "pl")
        leg.AddEntry(h4, "#geq 6", "pl")
        leg.AddEntry(h5, "#geq 8", "pl")
        leg.AddEntry(h6, "#geq 10", "pl")
        leg.Draw("same")

        csc = drawCSCLabel(cscStations[st].label, 0.85, 0.85, 0.05)

        c.Print("%sEff_CSCCLCT_pattern_%s%s" %
                (plotter.targetDir + subdirectory, cscStations[st].labelc,
                 plotter.ext))

        del c, base, h2, leg, csc, h3, h4, h5, h6
Esempio n. 14
0
def CSCBendResolutionComparison(plotter, plotter2):

    h11total = []
    h1total = []
    h2total = []
    h3total = []

    for st in range(0, len(cscStations)):

        h_bins = "(100,-1,1)"
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(0)
        base.SetMaximum(0.08)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        toPlot1 = delta_bend_clct(st)

        h11 = draw_1D(plotter.tree, title, h_bins, toPlot1, "", "same", kBlack)
        h1 = draw_1D(plotter2.tree, title, h_bins, toPlot1, "", "same", kBlue)
        print h11.GetEntries(), h1.GetEntries()
        print h11.GetBinContent(0), h1.GetBinContent(0)
        print h11.GetBinContent(101), h1.GetBinContent(101)
        h11total.append(h11)
        h1total.append(h1)

        h11.Scale(1. / h11.GetEntries())
        h1.Scale(1. / h1.GetEntries())

        base.SetMaximum(h1.GetBinContent(h1.GetMaximumBin()) * 1.5)
        h11.Draw("histsame")
        h1.Draw("histsame")

        leg = TLegend(0.15, 0.6, .45, 0.9, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.05)
        leg.AddEntry(h11, "CLCT (Run-1/2)", "pl")
        leg.AddEntry(h1, "CLCT (Run-3)", "pl")
        leg.Draw("same")

        csc = drawCSCLabel(cscStations[st].label, 0.85, 0.85, 0.05)

        c.Print("%sRes_CSCCLCT_bendcomparison_%s%s" %
                (plotter2.targetDir + subdirectory, cscStations[st].labelc,
                 plotter2.ext))

        del base, leg, csc, h1, c, h11

    h_bins = "(100,-1,1)"
    nBins = int(h_bins[1:-1].split(',')[0])
    minBin = float(h_bins[1:-1].split(',')[1])
    maxBin = float(h_bins[1:-1].split(',')[2])

    c = newCanvas()
    base = TH1F("base", title, nBins, minBin, maxBin)
    base.SetMinimum(0)
    base.SetMaximum(0.08)
    base.GetXaxis().SetLabelSize(0.05)
    base.GetYaxis().SetLabelSize(0.05)
    base.GetXaxis().SetTitleSize(0.05)
    base.GetYaxis().SetTitleSize(0.05)
    base.Draw("")
    CMS_lumi.CMS_lumi(c, iPeriod, iPos)

    h11 = h11total[0]
    for i in range(3, 11):
        h11 += h11total[i]

    h1 = h1total[0]
    for i in range(3, 11):
        h1 += h1total[i]

    h11.Scale(1. / h11.GetEntries())
    h1.Scale(1. / h1.GetEntries())
    base.SetMaximum(h1.GetBinContent(h1.GetMaximumBin()) * 1.5)
    h11.Draw("histsame")
    h1.Draw("histsame")

    print h11.GetMean(), h11.GetMeanError()
    print h1.GetMean(), h1.GetMeanError()

    leg = TLegend(0.15, 0.6, .45, 0.9, "", "brNDC")
    leg.SetBorderSize(0)
    leg.SetFillStyle(0)
    leg.SetTextSize(0.05)
    leg.AddEntry(h11, "CLCT (Run-1/2)", "pl")
    leg.AddEntry(h1, "CLCT (Run-3)", "pl")
    leg.Draw("same")

    c.Print("%sRes_CSCCLCT_bendcomparison_%s" %
            (plotter2.targetDir + subdirectory, plotter2.ext))

    del base, leg, h1, c, h11
Esempio n. 15
0
def CSCPosResolutionComparison(plotter, plotter2):

    h11total = []
    h1total = []
    h2total = []
    h3total = []

    for st in range(0, len(cscStations)):

        h_bins = "(100,-1,1)"
        nBins = int(h_bins[1:-1].split(',')[0])
        minBin = float(h_bins[1:-1].split(',')[1])
        maxBin = float(h_bins[1:-1].split(',')[2])

        c = newCanvas()
        gPad.SetGrid(1, 1)
        base = TH1F("base", title, nBins, minBin, maxBin)
        base.SetMinimum(0)
        base.SetMaximum(0.08)
        base.GetXaxis().SetLabelSize(0.05)
        base.GetYaxis().SetLabelSize(0.05)
        base.GetXaxis().SetTitleSize(0.05)
        base.GetYaxis().SetTitleSize(0.05)
        base.Draw("")
        CMS_lumi.CMS_lumi(c, iPeriod, iPos)

        toPlot1 = delta_fhs_clct(st)
        toPlot2 = delta_fqs_clct(st)
        toPlot3 = delta_fes_clct(st)
        toPlot4 = delta_ffhs_clct(st)

        h11 = draw_1D(plotter.tree, title, h_bins, toPlot1, "", "same", kBlack)
        h1 = draw_1D(plotter2.tree, title, h_bins, toPlot1, "", "same", kBlue)
        h2 = draw_1D(plotter2.tree, title, h_bins, toPlot2, "", "same",
                     kGreen + 2)
        h3 = draw_1D(plotter2.tree, title, h_bins, toPlot3, "", "same",
                     kRed + 1)
        #        h4 = draw_1D(plotter2.tree, title, h_bins, toPlot4, "", "same", kOrange)

        h11total.append(h11)
        h1total.append(h1)
        h2total.append(h2)
        h3total.append(h3)

        h11.Scale(1. / h11.GetEntries())
        h1.Scale(1. / h1.GetEntries())
        h2.Scale(1. / h2.GetEntries())
        h3.Scale(1. / h3.GetEntries())
        #        h4.Scale(1./h4.GetEntries())
        base.SetMaximum(h3.GetBinContent(h3.GetMaximumBin()) * 1.5)
        h11.Draw("histsame")
        h1.Draw("histsame")
        h2.Draw("histsame")
        h3.Draw("histsame")
        #        h4.Draw("histsame")

        leg = TLegend(0.15, 0.6, .45, 0.9, "", "brNDC")
        leg.SetBorderSize(0)
        leg.SetFillStyle(0)
        leg.SetTextSize(0.05)
        leg.AddEntry(h11, "1/2 strip (Run-2)", "pl")
        leg.AddEntry(h1, "1/2 strip (Run-3)", "pl")
        leg.AddEntry(h2, "1/4 strip (Run-3)", "pl")
        leg.AddEntry(h3, "1/8 strip (Run-3)", "pl")
        #        leg.AddEntry(h4,  "True strip (Run-3)","pl")
        leg.Draw("same")

        csc = drawCSCLabel(cscStations[st].label, 0.85, 0.85, 0.05)

        c.Print("%sRes_CSCCLCT_poscomparison_%s%s" %
                (plotter2.targetDir + subdirectory, cscStations[st].labelc,
                 plotter2.ext))

        del base, h2, leg, csc, h1, h3, c, h11

    h_bins = "(100,-1,1)"
    nBins = int(h_bins[1:-1].split(',')[0])
    minBin = float(h_bins[1:-1].split(',')[1])
    maxBin = float(h_bins[1:-1].split(',')[2])

    c = newCanvas()
    base = TH1F("base", title, nBins, minBin, maxBin)
    base.SetMinimum(0)
    base.SetMaximum(0.08)
    base.GetXaxis().SetLabelSize(0.05)
    base.GetYaxis().SetLabelSize(0.05)
    base.GetXaxis().SetTitleSize(0.05)
    base.GetYaxis().SetTitleSize(0.05)
    base.Draw("")
    CMS_lumi.CMS_lumi(c, iPeriod, iPos)

    h11 = h11total[0]
    for i in range(3, 11):
        h11 += h11total[i]

    h1 = h1total[0]
    for i in range(3, 11):
        h1 += h1total[i]

    h2 = h2total[0]
    for i in range(3, 11):
        h2 += h2total[i]

    h3 = h3total[0]
    for i in range(3, 11):
        h3 += h3total[i]

    h11.Scale(1. / h11.GetEntries())
    h1.Scale(1. / h1.GetEntries())
    h2.Scale(1. / h2.GetEntries())
    h3.Scale(1. / h3.GetEntries())
    base.SetMaximum(h3.GetBinContent(h3.GetMaximumBin()) * 1.5)
    h11.Draw("histsame")
    h1.Draw("histsame")
    h2.Draw("histsame")
    h3.Draw("histsame")

    print(h11.GetMean(), h11.GetMeanError())
    print(h1.GetMean(), h1.GetMeanError())
    print(h2.GetMean(), h2.GetMeanError())
    print(h2.GetMean(), h3.GetMeanError())

    leg = TLegend(0.15, 0.6, .45, 0.9, "", "brNDC")
    leg.SetBorderSize(0)
    leg.SetFillStyle(0)
    leg.SetTextSize(0.05)
    leg.AddEntry(h11, "1/2 strip (Run-2)", "pl")
    leg.AddEntry(h1, "1/2 strip (Run-3)", "pl")
    leg.AddEntry(h2, "1/4 strip (Run-3)", "pl")
    leg.AddEntry(h3, "1/8 strip (Run-3)", "pl")
    leg.Draw("same")

    c.Print("%sRes_CSCCLCT_poscomparison_%s" %
            (plotter2.targetDir + subdirectory, plotter2.ext))

    del base, h2, leg, h1, h3, c, h11