本文整理汇总了Python中ROOT.RooRealVar.errorVar方法的典型用法代码示例。如果您正苦于以下问题:Python RooRealVar.errorVar方法的具体用法?Python RooRealVar.errorVar怎么用?Python RooRealVar.errorVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ROOT.RooRealVar
的用法示例。
在下文中一共展示了RooRealVar.errorVar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: saveLandauHistoSignalToNoise
# 需要导入模块: from ROOT import RooRealVar [as 别名]
# 或者: from ROOT.RooRealVar import errorVar [as 别名]
def saveLandauHistoSignalToNoise(histo,outfile,canvas,XaxisTitle="",YaxisTitle="",plotTitle="",stats=0):
ex = "Null Fit"
signal_to_noise = RooRealVar("signal_to_noise", "Signal to Noise", 0, 50)
landau_data = RooDataHist("landau_data", "landau_data", RooArgList(signal_to_noise), histo)
ml = RooRealVar("ml","mean landau",25, 20, 26)
sl = RooRealVar("sl","sigma landau", 5, 2, 10)
landau = RooLandau("lx","lx",signal_to_noise,ml,sl)
mg = RooRealVar("mg","mg",0) ;
sg = RooRealVar("sg","sg", 2, 1, 8)
gauss = RooGaussian("gauss","gauss",signal_to_noise,mg,sg)
lxg = RooNumConvPdf("lxg", "lxg", signal_to_noise, landau, gauss)
result = lxg.fitTo(landau_data)
frame = signal_to_noise.frame()
landau_data.plotOn(frame)
lxg.plotOn(frame)
frame.Draw("")
frame.SetTitle(plotTitle)
frame.GetXaxis().SetTitle(XaxisTitle)
frame.GetYaxis().SetTitle(YaxisTitle)
frame.SetStats(stats)
frame.Write(plotTitle)
canvas.Print(outfile+".pdf")
peak = []
try:
mean = RooRealVar(result.floatParsFinal().find("landau_mean"))
err = RooRealVar(mean.errorVar())
peak.append(mean.GetVal())
peak.append(err.GetVal())
except Exception as ex:
print(ex)
peak.append(0)
peak.append(0)
return peak