13 <input>../TreeFitted_B0ToJPsiKs.root</input>
14 <contact>Yo Sato; yosato@post.kek.jp</contact>
15 <interval>nightly</interval>
25 ROOT.gROOT.ProcessLine(
".include " + sysconfig.get_path(
"include"))
27 workingFiles = glob.glob(
"../TreeFitted_B0ToJPsiKs.root")
29 chain = ROOT.TChain(
"B0TreeFit")
30 for iFile
in workingFiles:
33 outputFile = ROOT.TFile(
"test7_TreeFitterOutput.root",
"RECREATE")
39 B0_E_pull_s = ROOT.TH1F(
"B0_E_pull_s",
'Pull of the B^{0} energy sig', nBins, -RangePull, RangePull)
40 B0_p_pull_s = ROOT.TH1F(
"B0_p_pull_s",
'Pull of the B^{0} momentum sig', nBins, -RangePull, RangePull)
42 B0_vertex_pullx_s = ROOT.TH1F(
"B0_vertex_pullx_s",
'Pull of The B^{0} x vertex position sig', nBins, -RangePull, RangePull)
43 B0_vertex_pully_s = ROOT.TH1F(
"B0_vertex_pully_s",
'Pull of The B^{0} y vertex position sig', nBins, -RangePull, RangePull)
44 B0_vertex_pullz_s = ROOT.TH1F(
"B0_vertex_pullz_s",
'Pull of The B^{0} z vertex position sig', nBins, -RangePull, RangePull)
46 B0_vertex_resolutionx_s = ROOT.TH1F(
"B0_vertex_resolutionx_s",
47 'meas - mc of the B^{0} x vertex sig', nBins, -RangeMicrons, RangeMicrons)
48 B0_vertex_resolutiony_s = ROOT.TH1F(
"B0_vertex_resolutiony_s",
49 'meas - mc of the B^{0} y vertex sig', nBins, -RangeMicrons, RangeMicrons)
50 B0_vertex_resolutionz_s = ROOT.TH1F(
"B0_vertex_resolutionz_s",
51 'meas - mc of the B^{0} z vertex sig', nBins, -RangeMicrons, RangeMicrons)
52 pVal_s = ROOT.TH1F(
"pVal_s",
'global pValue sig', nBins, -1, 1)
53 pVal_b = ROOT.TH1F(
"pVal_b",
'global pValue bkg', nBins, -1, 1)
55 signalCut = ROOT.TCut(
"(isSignal>0)")
56 bkgCut = ROOT.TCut(
"(isSignal<1)")
58 histOperationStrings = [
59 "(E - mcE) / E_uncertainty>>B0_E_pull_s",
60 "(p - mcP) / pErr>>B0_p_pull_s",
61 "(x - mcDecayVertexX) / x_uncertainty>>B0_vertex_pullx_s",
62 "(y - mcDecayVertexY) / y_uncertainty>>B0_vertex_pully_s",
63 "(z - mcDecayVertexZ) / z_uncertainty>>B0_vertex_pullz_s",
64 "(x - mcDecayVertexX)*10000>>B0_vertex_resolutionx_s",
65 "(y - mcDecayVertexY)*10000>>B0_vertex_resolutiony_s",
66 "(z - mcDecayVertexZ)*10000>>B0_vertex_resolutionz_s",
71 drawToNewHist = chain.Draw
72 for histOperation
in histOperationStrings:
73 if "_s" in histOperation:
74 drawToNewHist(histOperation, signalCut)
76 drawToNewHist(histOperation, bkgCut)
79 B0_E_pull_s:
"B^{0} E pull",
80 B0_p_pull_s:
"B^{0} momentum pull",
81 B0_vertex_pullx_s:
"pull of B^{0} vertex X ",
82 B0_vertex_pully_s:
"pull of B^{0} vertex Y ",
83 B0_vertex_pullz_s:
"pull of B^{0} vertex Z ",
84 B0_vertex_resolutionx_s:
"meas-mc of B^{0} vertex X [#mum]",
85 B0_vertex_resolutiony_s:
"meas-mc of B^{0} vertex Y [#mum]",
86 B0_vertex_resolutionz_s:
"meas-mc of B^{0} vertex Z [#mum]",
91 checkForGausian =
"This should be a Gaussian on flat bkg and not changing."
92 metaOptions =
"pvalue-warn=0.1"
93 for hist, xlabel
in histsAndLabels.items():
94 hist.GetXaxis().SetTitle(xlabel)
95 hist.GetListOfFunctions().Add(ROOT.TNamed(
"Contact",
"yosato@post.kek.jp"))
96 hist.GetListOfFunctions().Add(ROOT.TNamed(
"Description", xlabel))
97 hist.GetListOfFunctions().Add(ROOT.TNamed(
"MetaOptions", metaOptions))
98 if any(string
in xlabel
for string
in [
"pull",
"meas-mc"]):
99 hist.GetListOfFunctions().Add(ROOT.TNamed(
"Check", checkForGausian))