Exemple #1
0
                    Dtotal.Draw("same hist")
                    l.SetFillColor(0)
                    l.SetBorderSize(0)
                    l.Draw()

                    title = myText("Shape Systematic %s in %s" % (syst, MC), 0.17, 0.85)

                    print "Shape Systematic %s in %s" % (syst, MC)
                    print "Up:     \t%s" % Utotal.Integral()
                    print "Nominal:\t%s" % Ntotal.Integral()
                    print "Down:   \t%s" % Dtotal.Integral()

                    unten.cd()
                    ROOT.gPad.SetTicks(1, 1)

                    ratioU, errorU = getRatio(Utotal, Ntotal, xMin, xMax)
                    ratioD, errorD = getRatio(Dtotal, Ntotal, xMin, xMax)

                    ksScoreU = Ntotal.KolmogorovTest(Utotal)
                    chiScoreU = Ntotal.Chi2Test(Utotal, "WWCHI2/NDF")
                    ksScoreD = Ntotal.KolmogorovTest(Dtotal)
                    chiScoreD = Ntotal.Chi2Test(Dtotal, "WWCHI2/NDF")

                    ratioU.SetStats(0)
                    ratioU.SetMinimum(0.01)
                    ratioU.SetMaximum(2.49)
                    ratioU.GetYaxis().SetNdivisions(505)
                    # ratioU.GetYaxis().SetLabelSize(0.2)
                    # ratioU.GetYaxis().SetTitleSize(0.2)
                    # ratioU.GetYaxis().SetTitleOffset(0.2)
                    # ratioU.GetXaxis().SetLabelColor(10)
Exemple #2
0
                               0.85)

                print 'Shape Systematic %s in %s' % (syst, MC)
                print 'Up:     \t%s' % Utotal.Integral()
                print 'Nominal:\t%s' % Ntotal.Integral()
                print 'Down:   \t%s' % Dtotal.Integral()

                if not (Utotal.Integral() == 0 or Dtotal.Integral() == 0):

                    unten.cd()
                    ROOT.gPad.SetTicks(1, 1)

                    nBins = Utotal.GetNbinsX()
                    xMin = Utotal.GetXaxis().GetBinLowEdge(0)
                    xMax = Utotal.GetXaxis().GetBinUpEdge(nBins)
                    ratioU, errorU = getRatio(Utotal, Ntotal, xMin, xMax)
                    ratioD, errorD = getRatio(Dtotal, Ntotal, xMin, xMax)

                    ksScoreU = Ntotal.KolmogorovTest(Utotal)
                    chiScoreU = Ntotal.Chi2Test(Utotal, "WWCHI2/NDF")
                    ksScoreD = Ntotal.KolmogorovTest(Dtotal)
                    chiScoreD = Ntotal.Chi2Test(Dtotal, "WWCHI2/NDF")

                    ratioU.SetStats(0)
                    ratioU.GetYaxis().SetRangeUser(0.9, 1.1)
                    ratioU.GetYaxis().SetNdivisions(502, 0)
                    ratioD.SetStats(0)
                    ratioD.GetYaxis().SetRangeUser(0.9, 1.1)
                    ratioD.GetYaxis().SetNdivisions(502, 0)
                    ratioD.GetYaxis().SetLabelSize(0.05)
                    ratioD.SetLineColor(2)