6 <input>../TreeFitted_B0ToJPsiKs.root</input>
7 <output>test7_TreeFitterOutput.root</output>
8 <contact>Jo-Frederik Krohn; jo-frederik.krohn@desy.de</contact>
9 <interval>nightly</interval>
17 ROOT.gROOT.ProcessLine(
".include " + sysconfig.get_path(
"include"))
21 workingFiles = glob.glob(str(
"../TreeFitted_B0ToJPsiKs.root"))
23 chain = ROOT.TChain(str(
"B0TreeFit"))
24 for iFile
in workingFiles:
27 outputFile = ROOT.TFile(
"test7_TreeFitterOutput.root",
"RECREATE")
33 B0_E_pull_s = ROOT.TH1F(
"B0_E_pull_s",
'Pull of the B^{0} energy sig', nBins, -RangePull, RangePull)
34 B0_p_pull_s = ROOT.TH1F(
"B0_p_pull_s",
'Pull of the B^{0} momentum sig', nBins, -RangePull, RangePull)
36 B0_vertex_pullx_s = ROOT.TH1F(
"B0_vertex_pullx_s",
'Pull of The B^{0} x vertex postion sig', nBins, -RangePull, RangePull)
37 B0_vertex_pully_s = ROOT.TH1F(
"B0_vertex_pully_s",
'Pull of The B^{0} y vertex postion sig', nBins, -RangePull, RangePull)
38 B0_vertex_pullz_s = ROOT.TH1F(
"B0_vertex_pullz_s",
'Pull of The B^{0} z vertex postion sig', nBins, -RangePull, RangePull)
40 B0_vertex_resolutionx_s = ROOT.TH1F(
"B0_vertex_resolutionx_s",
41 'meas - mc of the B^{0} x vertex sig', nBins, -RangeMicrons, RangeMicrons)
42 B0_vertex_resolutiony_s = ROOT.TH1F(
"B0_vertex_resolutiony_s",
43 'meas - mc of the B^{0} y vertex sig', nBins, -RangeMicrons, RangeMicrons)
44 B0_vertex_resolutionz_s = ROOT.TH1F(
"B0_vertex_resolutionz_s",
45 'meas - mc of the B^{0} z vertex sig', nBins, -RangeMicrons, RangeMicrons)
46 pVal_s = ROOT.TH1F(
"pVal_s",
'global pValue sig', nBins, -1, 1)
47 pVal_b = ROOT.TH1F(
"pVal_b",
'global pValue bkg', nBins, -1, 1)
50 B0_E_pull_s:
"B^{0} E pull",
51 B0_p_pull_s:
"B^{0} momentum pull",
52 B0_vertex_pullx_s:
"pull of B^{0} vertex X ",
53 B0_vertex_pully_s:
"pull of B^{0} vertex Y ",
54 B0_vertex_pullz_s:
"pull of B^{0} vertex Z ",
55 B0_vertex_resolutionx_s:
"meas-mc of B^{0} vertex X [\mum]",
56 B0_vertex_resolutiony_s:
"meas-mc of B^{0} vertex Y [\mum]",
57 B0_vertex_resolutionz_s:
"meas-mc of B^{0} vertex Z [\mum]",
62 checkForGausian =
"This should be a Gausian on flat bkg and not changing."
63 metaOptions =
"pvalue-warn=0.1"
64 for hist, xlabel
in histsAndLabels.items():
65 hist.GetXaxis().SetTitle(xlabel)
66 hist.GetListOfFunctions().Add(ROOT.TNamed(
"Contact",
"jkrohn@student.unimelb.edu.au"))
67 hist.GetListOfFunctions().Add(ROOT.TNamed(
"Description", xlabel))
68 hist.GetListOfFunctions().Add(ROOT.TNamed(
"MetaOptions", metaOptions))
69 if any(string
in xlabel
for string
in [
"pull",
"meas-mc"]):
70 hist.GetListOfFunctions().Add(ROOT.TNamed(
"Check", checkForGausian))
72 signalCut = ROOT.TCut(
"(isSignal>0)")
73 bkgCut = ROOT.TCut(
"(isSignal<1)")
75 histOperationStrings = [
76 "(E - mcE) / E_uncertainty>>B0_E_pull_s",
77 "(p - mcP) / pErr>>B0_p_pull_s",
78 "(x - mcDecayVertexX) / x_uncertainty>>B0_vertex_pullx_s",
79 "(y - mcDecayVertexY) / y_uncertainty>>B0_vertex_pully_s",
80 "(z - mcDecayVertexZ) / z_uncertainty>>B0_vertex_pullz_s",
81 "(x - mcDecayVertexX)*10000>>B0_vertex_resolutionx_s",
82 "(y - mcDecayVertexY)*10000>>B0_vertex_resolutiony_s",
83 "(z - mcDecayVertexZ)*10000>>B0_vertex_resolutionz_s",
88 drawToNewHist = chain.Draw
89 for histOperation
in histOperationStrings:
90 if "_s" in histOperation:
91 drawToNewHist(histOperation, signalCut)
93 drawToNewHist(histOperation, bkgCut)