Exemplo n.º 1
0
    print "DS:" + str(ds1)
    fitpdf['ws'].Print("v")
    fitpdf['pdf'].Print("v")
    ds1.Print("v")
    mistag = fitpdf['ws'].obj("mistag")
    aveta = etaAvgList.At(i).getValV();
    mistag.setVal(aveta);
    mistag.setError(min([0.5 / NUMCAT / sqrt(12), abs(aveta) * 0.5, abs(aveta - 0.5) * 0.5]))
    mistag.Print("v")
    print 72 * "#"

    print "\n-------PRINTING DS1--------\n"
    ds1.Print('v')
    for o in fitpdf['obs']:
        if not o.InheritsFrom('RooAbsCategory'): continue
        ds1.table(o).Print('v')
    print "\n---------------------------\n"

    """
    etaLow = ROOT.Double(0.0);
    etaHigh = ROOT.Double(0.5);
    ds1.getRange(ds1.get().find('eta'),etaLow,etaHigh);
    ds1.get().find('eta').setRange(etaLow, etaHigh)
    """
    

    #drawDsPlot(ds1,i);
    #etaAvg = ds.meanVar(ds.get().find('eta'));
    print "\n\n\nETA = ",ds.meanVar(ds.get().find('eta')).getValV(),"\n\n\n\n";
    #raw_input('Press Enter to continue');
Exemplo n.º 2
0
    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)

# plot generated dataset + generating pdf
#plotAll(ds,genpdf,qf,qt_os,time,"GenPdfAndDataOS_decRateCoeff_Bd_tut_PEDTE.eps")
#plotAll(ds,genpdf,qf,qt_ss,time,"GenPdfAndDataSS_decRateCoeff_Bd_tut_PEDTE.eps")

# use workspace for fit pdf
config['CONTEXT'] = 'FIT'

acc, accnorm = buildSplineAcceptance(ws, time, 'acceptance_FIT',