예제 #1
0
def getData(version='v1', nentries=-1):
    chains = getChains(version)
    data = {}
    for name, chain in chains.items():
        mass = RooRealVar('mass', 'mass', 60, 120)
        weight = RooRealVar('weight', 'weight', 0, 999)
        if nentries > 0:
            cuts = ['Entry$ < %d' % nentries]
        else:
            cuts = []
        data[name] = dataset.get(tree=chain, variable=mass, weight=weight,
                                 cuts=cuts)
    return data
예제 #2
0
def getData(version='v1', nentries=-1):
    chains = getChains(version)
    data = {}
    for name, chain in chains.items():
        mass = RooRealVar('mass', 'mass', 60, 120)
        weight = RooRealVar('weight', 'weight', 0, 999)
        if nentries > 0:
            cuts = ['Entry$ < %d' % nentries]
        else:
            cuts = []
        data[name] = dataset.get(tree=chain,
                                 variable=mass,
                                 weight=weight,
                                 cuts=cuts)
    return data
예제 #3
0
#getFitPlot(ws, "mass", ).Draw()

## print "# x, xerr, m0(%), m0_err(%), sigma, sigma_err(%), cut, cut_err, power, power_err"
## for i in range(len(xvalues)):
##     print "% 5.3g 0.0   " % (100*(xvalues[i]-1.),),
##     factor = 100./91.19
##     print "% 8.3g %8.2g   " % (params[i][0].getVal() * factor, params[i][0].getError() * factor),
##     factor = factor * math.sqrt(2)
##     print "% 8.3g %8.2g   " % (params[i][1].getVal() * factor, params[i][1].getError() * factor),
##     for j in range(2, 4):
##         print "% 8.3g %8.2g   " % (params[i][j].getVal(), params[i][j].getError(),),
##     print

nentries = 5000

chains = getChains('v1')
mcTree = chains['mc']
test1Tree = chains['test1']

w = RooWorkspace('w')

mass = w.factory('mass[60, 120]')
trange = (log(mass.getMin()/91.2), log(mass.getMax()/91.2))
t = w.factory('t[%f,%f]' % trange)
t.SetTitle('log(mass/91.2)')
weight = w.factory('weight[0, 999]')

cuts = ['Entry$ < %d' % nentries]

mData = dataset.get(tree=mcTree, variable=mass, weight=weight, cuts=cuts,
                    name='mData')