Esempio n. 1
0
dataset = RooDataSet('dataset', 'Combined dataset (DsK + DsPi)',
                     RooArgSet(time, decaycat),
                     RooFit.Import(dsetlist[0]))
dataset.append(dsetlist[1])

for dset in dsetlist:
    dset.Print()
dataset.Print()

## Basic B decay pdf with time resolution
# Resolution model
mean = RooRealVar('mean', 'Mean', 0.)
# scale = RooRealVar('scale', 'Per-event time error scale factor', 1.19)
resmodel = RooGaussModel('resmodel', 'Time resolution model', time,
                         mean, RooRealConstant.value(0.044),
                         RooRealConstant.value(1.0),
                         RooRealConstant.value(1.0))
                         # RooRealConstant::value(0), scale, dt)
                         # RooRealConstant::value(0), scale,
                         # RooRealConstant::value(0.00004))
# Decay model
Bdecay = RooBDecay('Bdecay', 'Decay function for the B_{s} (heavy + light)',
                   time, RooRealConstant.value(tau), # t, τ
                   RooRealConstant.value(dgamma),    # ΔΓ
                   RooRealConstant.value(1.0),       # f0 - cosh
                   RooRealConstant.value(0.0),       # f1 - sinh
                   RooRealConstant.value(0.0),       # f2 - cos
                   RooRealConstant.value(0.0),       # f3 - sin
                   RooRealConstant.value(0.0),       # Δm
                   resmodel, RooBDecay.SingleSided)
Esempio n. 2
0
    dsetlist[idx].addColumn(decaycat)

dataset = RooDataSet('dataset', 'Combined dataset (DsK + DsPi)',
                     RooArgSet(time, decaycat), RooFit.Import(dsetlist[0]))
dataset.append(dsetlist[1])

for dset in dsetlist:
    dset.Print()
dataset.Print()

## Basic B decay pdf with time resolution
# Resolution model
mean = RooRealVar('mean', 'Mean', 0.)
# scale = RooRealVar('scale', 'Per-event time error scale factor', 1.19)
resmodel = RooGaussModel('resmodel', 'Time resolution model', time, mean,
                         RooRealConstant.value(0.044),
                         RooRealConstant.value(1.0),
                         RooRealConstant.value(1.0))
# RooRealConstant::value(0), scale, dt)
# RooRealConstant::value(0), scale,
# RooRealConstant::value(0.00004))
# Decay model
Bdecay = RooBDecay(
    'Bdecay',
    'Decay function for the B_{s} (heavy + light)',
    time,
    RooRealConstant.value(tau),  # t, τ
    RooRealConstant.value(dgamma),  # ΔΓ
    RooRealConstant.value(1.0),  # f0 - cosh
    RooRealConstant.value(0.0),  # f1 - sinh
    RooRealConstant.value(0.0),  # f2 - cos
Esempio n. 3
0
# Pull distributions
dspi_pullhist = tfr_fitres.pullHist('hdspi_dataset', 'hdspi_model')
dsk_pullhist = tfr_fitres.pullHist('hdsk_dataset', 'hdsk_model')

# fit pulls
tblhdr = '| {0:^{width}} | {1:^{width}} |'
tblrow = '| {0:>{sign}{width}e} | {1:>{sign}{width}e} |'
print 'Power law acceptance with %s ratio:' % ratiofn
print tblhdr.format('Mean', 'RMS', width=13)
print tblrow.format(dspi_pullhist.GetMean(2), dspi_pullhist.GetRMS(2),
                    sign=' ', width=10)
print tblrow.format(dsk_pullhist.GetMean(2), dsk_pullhist.GetRMS(2),
                    sign=' ', width=10)

# Dsπ
xaxisvar = RooRealConstant.value(0.0)
tfr_pull1 = time.frame(RooFit.Range('full'), RooFit.Name('dspi_pull'))
xaxisvar.plotOn(tfr_pull1, RooFit.LineColor(ROOT.kRed), RooFit.LineWidth(2))
tfr_pull1.addPlotable(dspi_pullhist, 'P')
tfr_pull1.SetTitle(';;')
tfr_pull1.SetAxisRange(-5, 5, 'Y')

# DsK
tfr_pull2 = time.frame(RooFit.Range('full'), RooFit.Name('dsk_pull'))
xaxisvar.plotOn(tfr_pull2, RooFit.LineColor(ROOT.kRed), RooFit.LineWidth(2))
tfr_pull2.addPlotable(dsk_pullhist, 'P')
tfr_pull2.SetTitle('')
tfr_pull2.SetYTitle('')
tfr_pull2.SetAxisRange(-5, 5, 'Y')
tfr_pull2.GetXaxis().SetTitleSize(0.07)
tfr_pull2.GetXaxis().SetLabelSize(0.07)
Esempio n. 4
0
    # turnon has a different range as it is in the denominator
    turnon = RooRealVar('turnon', 'turnon', 1., 1E-4, 10.)
    offset = RooRealVar('offset', 'offset', 0., -1E-3, 1E-3)
else:
    print 'Unknown acceptance type. Aborting'
    assert(False)

# Resolution model
mean = RooRealVar('mean', 'Mean', 0.)
scale = RooRealVar('scale', 'Per-event time error scale factor', 1.)
resmodel = RooGaussModel('resmodel', 'Time resolution model', time,
                         mean, scale, dt)

# Decay model
decayH = RooDecay('decayH', 'Decay function for the B_{s,H}',
                  time, RooRealConstant.value(1.536875/1E3),
                  resmodel, RooDecay.SingleSided)
decayL = RooDecay('decayL', 'Decay function for the B_{s,L}',
                  time, RooRealConstant.value(1.407125/1E3),
                  resmodel, RooDecay.SingleSided)
decay = RooAddPdf('decay', 'Decay function for the B_{s}',
                  decayH, decayL, RooRealConstant.value(0.5))
decayargset = RooArgSet(decay)

# Get tree
rfile = get_file('data/smalltree-new-MC.root', 'read')
ftree = get_object('ftree', rfile)

# dt dataset for denom
trigger = 'HLT2Topo3BodyTOS'
triggerVar = RooRealVar(trigger, trigger, 0, 2)