Beispiel #1
0
    False, True)
acc = accnorm #use normalised acceptance for generation
resmodel, acc = getResolutionModel(ws, config, time, timeerr, acc)

# build generating pdf
genpdf = buildBDecayTimePdf(
    config, 'GEN-time-pdf', ws,
    time, timeerr, qt, qf, mistagobs, mistagcalib,
    Gamma, DGamma, Dm,
    C, D, Dbar, S, Sbar,
    resmodel, acc,
    terrpdf, mistagpdf,
    aprod, adet)

# generate "proto data" for mistag and time error
proto_data = WS(ws, mistagpdf_os.generate(RooArgSet(mistag_os), nevts))
mistag_ss_data = WS(ws, mistagpdf_ss.generate(RooArgSet(mistag_ss), nevts))
terr_data = WS(ws, terrpdf.generate(RooArgSet(timeerr), nevts))
proto_data.merge(mistag_ss_data, terr_data)

# generate events
obs = RooArgSet(qf, qt_os, qt_ss, time) #if use proto data, don't put mistag/time error observables here!
ds = WS(ws, genpdf.generate(obs, RooFit.ProtoData(proto_data)))
ds.Print('v')
ds.table(qf).Print('v')
ds.table(qt_os).Print('v')
ds.table(qt_ss).Print('v')

# HACK (2/2): restore correct eta range after generation
ds.get().find("mistag_os").setRange(0.0,0.5)
ds.get().find("mistag_ss").setRange(0.0,0.5)
Beispiel #2
0
acc, accnorm = buildSplineAcceptance(
    ws, time, 'acceptance_GEN', config['SplineAcceptance']['KnotPositions'],
    config['SplineAcceptance']['KnotCoefficients'][config['Context']], False,
    True)
acc = accnorm  #use normalised acceptance for generation
resmodel, acc = getResolutionModel(ws, config, time, timeerr, acc)
terrpdf = None

# build generating pdf
genpdf = buildBDecayTimePdf(config, 'GEN-time-pdf', ws, time, timeerr, qt, qf,
                            mistagobs, mistagcalib, Gamma, DGamma, Dm, C, D,
                            Dbar, S, Sbar, resmodel, acc, terrpdf, mistagpdf,
                            aprod, adet)

# generate "proto data" for mistag and time error
proto_data = WS(ws, mistagpdf_os.generate(RooArgSet(mistag_os), nevts))
mistag_ss_data = WS(ws, mistagpdf_ss.generate(RooArgSet(mistag_ss), nevts))
proto_data.merge(mistag_ss_data)

# generate events
obs = RooArgSet(
    qf, qt_os, qt_ss,
    time)  #if use proto data, don't put mistag/time error observables here!
ds = WS(ws, genpdf.generate(obs, RooFit.ProtoData(proto_data)))
ds.Print('v')
ds.table(qf).Print('v')
ds.table(qt_os).Print('v')
ds.table(qt_ss).Print('v')

# HACK (2/2): restore correct eta range after generation
ds.get().find("mistag_os").setRange(0.0, 0.5)