14 <input>../TreeFitted_B0ToJPsiKs.root</input>
15 <output>test7_TreeFitterOutput.root</output>
16 <contact>Jo-Frederik Krohn; jo-frederik.krohn@desy.de</contact>
17 <interval>nightly</interval>
27 ROOT.gROOT.ProcessLine(
".include " + sysconfig.get_path(
"include"))
29 workingFiles = glob.glob(str(
"../TreeFitted_B0ToJPsiKs.root"))
31 chain = ROOT.TChain(str(
"B0TreeFit"))
32 for iFile
in workingFiles:
35 outputFile = ROOT.TFile(
"test7_TreeFitterOutput.root",
"RECREATE")
41 B0_E_pull_s = ROOT.TH1F(
"B0_E_pull_s",
'Pull of the B^{0} energy sig', nBins, -RangePull, RangePull)
42 B0_p_pull_s = ROOT.TH1F(
"B0_p_pull_s",
'Pull of the B^{0} momentum sig', nBins, -RangePull, RangePull)
44 B0_vertex_pullx_s = ROOT.TH1F(
"B0_vertex_pullx_s",
'Pull of The B^{0} x vertex position sig', nBins, -RangePull, RangePull)
45 B0_vertex_pully_s = ROOT.TH1F(
"B0_vertex_pully_s",
'Pull of The B^{0} y vertex position sig', nBins, -RangePull, RangePull)
46 B0_vertex_pullz_s = ROOT.TH1F(
"B0_vertex_pullz_s",
'Pull of The B^{0} z vertex position sig', nBins, -RangePull, RangePull)
48 B0_vertex_resolutionx_s = ROOT.TH1F(
"B0_vertex_resolutionx_s",
49 'meas - mc of the B^{0} x vertex sig', nBins, -RangeMicrons, RangeMicrons)
50 B0_vertex_resolutiony_s = ROOT.TH1F(
"B0_vertex_resolutiony_s",
51 'meas - mc of the B^{0} y vertex sig', nBins, -RangeMicrons, RangeMicrons)
52 B0_vertex_resolutionz_s = ROOT.TH1F(
"B0_vertex_resolutionz_s",
53 'meas - mc of the B^{0} z vertex sig', nBins, -RangeMicrons, RangeMicrons)
54 pVal_s = ROOT.TH1F(
"pVal_s",
'global pValue sig', nBins, -1, 1)
55 pVal_b = ROOT.TH1F(
"pVal_b",
'global pValue bkg', nBins, -1, 1)
58 B0_E_pull_s:
"B^{0} E pull",
59 B0_p_pull_s:
"B^{0} momentum pull",
60 B0_vertex_pullx_s:
"pull of B^{0} vertex X ",
61 B0_vertex_pully_s:
"pull of B^{0} vertex Y ",
62 B0_vertex_pullz_s:
"pull of B^{0} vertex Z ",
63 B0_vertex_resolutionx_s:
"meas-mc of B^{0} vertex X [#mum]",
64 B0_vertex_resolutiony_s:
"meas-mc of B^{0} vertex Y [#mum]",
65 B0_vertex_resolutionz_s:
"meas-mc of B^{0} vertex Z [#mum]",
70 checkForGausian =
"This should be a Gaussian on flat bkg and not changing."
71 metaOptions =
"pvalue-warn=0.1"
72 for hist, xlabel
in histsAndLabels.items():
73 hist.GetXaxis().SetTitle(xlabel)
74 hist.GetListOfFunctions().Add(ROOT.TNamed(
"Contact",
"jkrohn@student.unimelb.edu.au"))
75 hist.GetListOfFunctions().Add(ROOT.TNamed(
"Description", xlabel))
76 hist.GetListOfFunctions().Add(ROOT.TNamed(
"MetaOptions", metaOptions))
77 if any(string
in xlabel
for string
in [
"pull",
"meas-mc"]):
78 hist.GetListOfFunctions().Add(ROOT.TNamed(
"Check", checkForGausian))
80 signalCut = ROOT.TCut(
"(isSignal>0)")
81 bkgCut = ROOT.TCut(
"(isSignal<1)")
83 histOperationStrings = [
84 "(E - mcE) / E_uncertainty>>B0_E_pull_s",
85 "(p - mcP) / pErr>>B0_p_pull_s",
86 "(x - mcDecayVertexX) / x_uncertainty>>B0_vertex_pullx_s",
87 "(y - mcDecayVertexY) / y_uncertainty>>B0_vertex_pully_s",
88 "(z - mcDecayVertexZ) / z_uncertainty>>B0_vertex_pullz_s",
89 "(x - mcDecayVertexX)*10000>>B0_vertex_resolutionx_s",
90 "(y - mcDecayVertexY)*10000>>B0_vertex_resolutiony_s",
91 "(z - mcDecayVertexZ)*10000>>B0_vertex_resolutionz_s",
96 drawToNewHist = chain.Draw
97 for histOperation
in histOperationStrings:
98 if "_s" in histOperation:
99 drawToNewHist(histOperation, signalCut)
101 drawToNewHist(histOperation, bkgCut)