fiveIntegralBkg = fiveIntegralBkg * nBkg.getValV() / totIntegralBkg tenIntegralBkg = tenIntegralBkg * nBkg.getValV() / totIntegralBkg fiveIntegralTot = fiveIntegralTot * (nBkg.getValV()+nSig.getValV()) / totIntegralTot tenIntegralTot = tenIntegralTot * (nBkg.getValV()+nSig.getValV()) / totIntegralTot c.SaveAs('phimassSPlot_'+ outname + '.png') c.SaveAs('phimassSPlot_' + outname + '.root') c.Clear() cD=TCanvas("cD","cD",750,600) cD.cd() splot = RooStats.SPlot ("sPlot","sPlot",splotData, tot, RooArgList(nSig,nBkg)) dstree = splotData.store().tree() #S plot hist for signal shistSig = TH1F('shistSig','shistSig', 50, 4.0, 6.0) shistSig.Sumw2() shistSig.SetLineColor(2) shistSig.SetMarkerColor(2); shistSig.SetMinimum(0.) dstree.Project('shistSig','dimuonditrk_m_rf_c','nSig_sw'); shistSig.Draw('e0'); cD.SaveAs('SigSPlotPhi_' + outname + '_' + outname + '.gif') cD.SaveAs('SigSPlotPhi_' + outname + '.root') sweightSig = TH1F('sweightSig','sweightSig', 50, 4.0, 6.0)
b0SideSub.SetLineColor(kBlack) b0SideSub.Draw("E0") linezero = TLine(b0SideSub.GetBinCenter(1), 0.0, b0SideSub.GetBinCenter(b0SideSub.GetNbinsX()), 0.0) linezero.SetLineColor(kRed) linezero.SetLineWidth(2) linezero.SetLineStyle(kDotted) linezero.Draw() kcanvas.SaveAs(region + "/b0s_subtracted_" + region + ".png") kcanvas.SaveAs(region + "/b0s_subtracted_" + region + ".root") splot = RooStats.SPlot("sPlot", "sPlot", theData, kkTot, RooArgList(nSigKK, nBkgKK)) dstree = theData.store().tree() dstree.GetEntryNumber(88) sPlot_B0_hist = TH1F("sPlot_B0_hist", "#mu#muKK sPlot - " + region + "; m(#mu#muKK) [GeV]", 2000, 4.00, 6.0) sPlot_B0_hist.Sumw2() sPlot_B0_hist.SetLineColor(2) sPlot_B0_hist.SetMarkerColor(2) sPlot_B0_hist.SetMinimum(0.) dstree.Project("sPlot_B0_hist", "xM", "nSig_sw") sPlot_B0_hist.Draw("e0") kcanvas.SaveAs(region + "/b0_Splot_Phi" + region + ".png") kcanvas.SaveAs(region + "/b0_Splot_Phi" + region + ".root")
massKKFrame = masskk.frame(Range(phimin,phimax)) alldata.plotOn(massKKFrame,RooLinkedList()) tot.plotOn(massKKFrame,Normalization(alldata.numEntries())) massKKFrame.Draw() c.SaveAs("plots/testmassFit.png") cD=TCanvas("cD","cD",1000,1200) cD.cd() splot = RooStats.SPlot ( "sPlot","sPlot", alldata, tot, RooArgList(nSig,nBkg)) # In[ ]: dstree = alldata.store().tree() dstree.GetEntryNumber(88) # In[ ]: sPlot_B0_hist = TH1F('sPlot_B0_hist','sPlot_B0_hist', 100, 5.00, 1.05) # In[ ]: sPlot_B0_hist.Sumw2() sPlot_B0_hist.SetLineColor(2) sPlot_B0_hist.SetMarkerColor(2); sPlot_B0_hist.SetMinimum(0.)