本文整理汇总了Python中ROOT.RooRealVar.isConstant方法的典型用法代码示例。如果您正苦于以下问题:Python RooRealVar.isConstant方法的具体用法?Python RooRealVar.isConstant怎么用?Python RooRealVar.isConstant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ROOT.RooRealVar
的用法示例。
在下文中一共展示了RooRealVar.isConstant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from ROOT import RooRealVar [as 别名]
# 或者: from ROOT.RooRealVar import isConstant [as 别名]
nbins=data.numEntries()
nfree=model.getParameters(data).selectByAttrib("Constant",False).getSize()
nsigv=nsig.getValV()
nsige=nsig.getError()
if sighist.Integral()>0:
musigv=nsigv/nsigref.getValV()
musige=nsige/nsigref.getValV()
else:
musigv=9999.
musige=9999.
#if fit=="sb":
# musigv/=signalweight
# musige/=signalweight
print "N(sig)="+str(int(nsigv))+"#pm"+str(int(nsige))
if meanWZ.isConstant():
#xframe=mass.frame(RooFit.Title("m="+str(int((meanW.getValV())*1000.)/1000.)+"#pm"+str(int(meanW.getError()*1000.)/1000.)+" GeV, #mu_{#sigma}="+str(int(musigv*1000.)/1000.)+"#pm"+str(int(musige*1000.)/1000.)+", #chi^{2}/N="+str(int((chi2.getVal()/(nbins-nfree))*10.)/10.)))
xframe=mass.frame(RooFit.Title(" m="+str(int((meanW.getValV())*1000.)/1000.)+"#pm"+str(int(meanW.getError()*1000.)/1000.)+" GeV, #chi^{2}/N="+str(int((chi2.getVal()/(nbins-nfree))*10.)/10.)))
else:
#xframe=mass.frame(RooFit.Title("#Delta m="+str(int((meanWZ.getValV()-refmass)*1000.)/1000.)+"#pm"+str(int(meanWZ.getError()*1000.)/1000.)+" GeV, #mu_{#sigma}="+str(int(musigv*1000.)/1000.)+"#pm"+str(int(musige*1000.)/1000.)+", #chi^{2}/N="+str(int((chi2.getVal()/(nbins-nfree))*10.)/10.)))
xframe=mass.frame(RooFit.Title(" #Delta m="+str(int((meanWZ.getValV()-refmass)*1000.)/1000.)+"#pm"+str(int(meanWZ.getError()*1000.)/1000.)+" GeV, #chi^{2}/N="+str(int((chi2.getVal()/(nbins-nfree))*10.)/10.)))
if fit=="data":
data.plotOn(xframe,RooFit.MarkerSize(1))
else:
data.plotOn(xframe,RooFit.DataError(RooAbsData.SumW2),RooFit.MarkerSize(1))
model.plotOn(xframe,RooFit.Normalization(1.0,RooAbsReal.RelativeExpected))
model.plotOn(xframe,RooFit.Components("bkg"+name),RooFit.LineStyle(kDashed),RooFit.Normalization(1.0,RooAbsReal.RelativeExpected))
model.plotOn(xframe,RooFit.Components("sigW"),RooFit.LineStyle(kDotted),RooFit.Normalization(1.0,RooAbsReal.RelativeExpected))
model.plotOn(xframe,RooFit.Components("sigZ"),RooFit.LineStyle(kDashDotted),RooFit.Normalization(1.0,RooAbsReal.RelativeExpected))
canvas=TCanvas("c2","c2",0,0,600,600)
xframe.GetYaxis().SetTitle("Events")