In [1]:
import sys
sys.path.append('../../FourVector')
sys.path.append('../project')
from FourVector import FourVector
from ThreeVector import ThreeVector
from FutureColliderTools import SmearVertex, GetCorrectedMass, GetMissingMass2, GetQ2
from FutureColliderDataLoader import LoadData_KMuNu, LoadData_DsMuNu
from FutureColliderVariables import *
from FutureColliderFitter import FutureFitter
import numpy as np
import ROOT
ROOT.enableJSVis()
ROOT.gStyle.SetOptStat(0)
In [2]:
File_Fits = ROOT.TFile.Open("../output/FitterOutput.root", "READ")
Canv_Fits = {}
Canv_Fits["Ds"] = ROOT.TCanvas("c_Ds", "", 900, 900)
Canv_Fits["K"] = ROOT.TCanvas("c_K", "", 900, 900)
Canv_Fits["Ds"].Divide(3,3)
Canv_Fits["K"] .Divide(3,3)
Legends = {}
Texts = []
for Mode in ["K", "Ds"]:
it = 1
for resolution in np.linspace(0.3, 1.0, 8):
canvas = File_Fits.Get("c_Fit_{mode}_{resolution}".format(mode = Mode, resolution = resolution))
Canv_Fits[Mode].cd(it)
for prim in canvas.GetListOfPrimitives():
if prim.GetName() == "TPave":
Legends[Mode] = prim.Clone()
canvas.GetListOfPrimitives().Remove(prim)
break
Text = ROOT.TPaveText(0.02, 0.8, 0.3, 0.98, "NDC")
Text.AddText("{0} #sigma LHCb".format(resolution))
Text.SetBorderSize(0)
Text.SetFillColor(0)
canvas.DrawClonePad()
Text.Draw()
Texts += [Text]
it+=1
Canv_Fits[Mode].cd(9)
Legends[Mode].SetX1(0)
Legends[Mode].SetX2(1)
Legends[Mode].SetY1(0)
Legends[Mode].SetY2(1)
Legends[Mode].Draw()
In [3]:
Canv_Fits["Ds"].Draw()
Canv_Fits["Ds"].Print("AllFits_Ds.pdf")
Canv_Fits["Ds"].Print("AllFits_Ds.png")
In [4]:
Canv_Fits["K"].Draw()
Canv_Fits["K"].Print("AllFits_K.pdf")
In [5]:
import pickle
Results = pickle.load( open("../output/FitResults.p") )
print "Results for K Mu Nu Fit:"
print Results["K"]
print "\nResults for Ds Mu Nu Fit:"
print Results["Ds"]
In [6]:
Graph_K = File_Fits.Get("Error_Budget_K")
Graph_Ds = File_Fits.Get("Error_Budget_Ds")
Graph_K.SetLineStyle(2)
Graph_K.SetMarkerStyle(4)
Graph_Ds.SetLineStyle(2)
Graph_Ds.SetMarkerStyle(4)
In [7]:
canv_Budget = ROOT.TCanvas("c_graph", "", 900, 900)
Graph_K.Draw()
canv_Budget.Draw()
canv_Budget.Print("Error_Budget_K.pdf")
In [8]:
canv_Budget.Clear()
Graph_Ds.Draw()
canv_Budget.Draw()
canv_Budget.Print("Error_Budget_Ds.pdf")
In [ ]: