コード例 #1
0
    eff_map.Write()
    eff_map_statUp.Write()
    eff_map_statDown.Write()
    worse_rel_err.Write()
    base_dir = os.path.dirname(args.num)

    m = ROOT.RooRealVar('m', 'm', 55, 55, 200)
    os_trkMass = ROOT.RooDataHist(
        'higgs_data', 'higgs_data', ROOT.RooArgList(m),
        input_view.Get(os.path.join(base_dir, 'os_trkMass')))
    mean = ROOT.RooRealVar('mean', 'mean', 90, 80, 110)
    sigmaL = ROOT.RooRealVar('sigmaL', 'sigmaL', 30, 0, 100)
    sigmaR = ROOT.RooRealVar('sigmaR', 'sigmaR', 25, 0, 100)
    alphaL = ROOT.RooRealVar('alphaL', 'alphaL', 1, 0, 30)
    alphaR = ROOT.RooRealVar('alphaR', 'alphaR', 1, 0, 30)
    os_func = ROOT.RooCruijff('os_func', 'os_func', m, mean, sigmaL, sigmaR,
                              alphaL, alphaR)

    fit_result = os_func.fitTo(
        os_trkMass,
        ROOT.RooFit.Save(True),
        ROOT.RooFit.PrintLevel(-1),
        #ROOT.RooFit.SumW2Error(True),
    )

    frame = m.frame(ROOT.RooFit.Title("OS Trk Mass distribution"))
    os_trkMass.plotOn(frame, )
    os_func.plotOn(frame, ROOT.RooFit.LineColor(ROOT.EColor.kAzure))
    frame.Draw()
    canvas.Print(args.output.replace(".root", "os_trkMass.png"))
    canvas.Print(args.output.replace(".root", "os_trkMass.pdf"))
コード例 #2
0
max_mc = mc.GetBinContent(mc.GetMaximumBin())
mc.Draw()
data.SetMarkerStyle(20)
data.SetMarkerColor(2)
data.SetLineColor(2)
data.Draw()

m          = ROOT.RooRealVar('m', 'Collinear Mass', 90,40,250)
os_data    = ROOT.RooDataHist('z_data','z_data',ROOT.RooArgList(m),data)
os_mc      = ROOT.RooDataHist('z_mc','z_mc',ROOT.RooArgList(m),mc)
mean       = ROOT.RooRealVar('mean', 'mean', 90,70,110)
sigmaL     = ROOT.RooRealVar('sigmaL' ,'sigmaL' ,10 ,0 ,100)
sigmaR     = ROOT.RooRealVar('sigmaR' ,'sigmaR' ,10 ,0 ,100)
alphaL     = ROOT.RooRealVar('alphaL' ,'alphaL' ,1  ,0 ,30 )
alphaR     = ROOT.RooRealVar('alphaR' ,'alphaR' ,1  ,0 ,30 )
command    = ROOT.RooCruijff("os_func", "os_func",m, mean, sigmaL, sigmaR, alphaL, alphaR)


frame = m.frame(ROOT.RooFit.Title("Z mass peak"))

fit_result_mc = command.fitTo(
    os_mc,
    ROOT.RooFit.Save(True))

os_mc.plotOn(
    frame,ROOT.RooFit.LineColor(ROOT.EColor.kBlue),ROOT.RooFit.MarkerColor(ROOT.EColor.kBlue)
)
mcpeak = mean.getVal()
mcpeakerr = mean.getError()

command.plotOn(frame,#ROOT.RooFit.VisualizeError(fit_result_mc,1),