本文整理汇总了Python中ROOT.RooDataSet.reset方法的典型用法代码示例。如果您正苦于以下问题:Python RooDataSet.reset方法的具体用法?Python RooDataSet.reset怎么用?Python RooDataSet.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ROOT.RooDataSet
的用法示例。
在下文中一共展示了RooDataSet.reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dict
# 需要导入模块: from ROOT import RooDataSet [as 别名]
# 或者: from ROOT.RooDataSet import reset [as 别名]
# initialize variables for calculation of covariances
covs = dict( [ ( name1, dict( [ ( name2, 0. ) for name2 in funcNames ] ) ) for name1 in funcNames ] )
covsW = dict( [ ( name1, dict( [ ( name2, 0. ) for name2 in funcNames ] ) ) for name1 in funcNames ] )
# generate data and compute moments in loop
import sys
from ROOT import RooRandom
for it in range(nIters) :
if it % 100 == 0 :
print 'iteration %d' % it
sys.stdout.flush()
# generate data with (1 + x) / 2
RooRandom.randomGenerator().SetSeed( 100000 + it )
noWeightData.reset()
weightData.reset()
for evIt in range(nEvents) :
weight = RooRandom.uniform()
obs.setVal( 2. * weight - 1. )
if RooRandom.uniform() <= weight :
noWeightData.add(obsSet)
weightData.add( obsSet, weight )
# compute moments of functions
moms.compute( noWeightData, ResetFirst = True, Verbose = False )
momsW.compute( weightData, ResetFirst = True, Verbose = False )
# update covariance sums
momCoefs = moms.coefficients()
momCoefsW = momsW.coefficients()