28 from ROOT
import Belle2
29 import modularAnalysis
as ma
32 from variables
import variables
as mc_variables
38 validation_path = b2.Path()
40 ma.inputMdstList(inputFiles, path=validation_path)
43 ma.fillParticleListsFromMC([B0s],
True, path=validation_path)
45 ma.matchMCTruth(
'B0:all', path=validation_path)
47 Upsilon4S = (
'Upsilon(4S):all',
'')
48 ma.fillParticleListsFromMC([Upsilon4S],
True, path=validation_path)
50 ma.matchMCTruth(
'Upsilon(4S):all', path=validation_path)
52 labelAsymmetry =
"#frac{N^{#it{B}^{0}} - N^{#bar{#it{B}}^{0}}}{N^{#it{B}^{0}} + N^{#bar{#it{B}}^{0}}}"
55 def plotWithAsymmetry(
71 Produces a plot with an asymmetry (y_A -y_B)/(y_A + y_B) below, where y_A and y_B are the y values of curves A and B.
76 rooFitFrame.GetXaxis().SetTitle(
"")
77 rooFitFrame.GetXaxis().SetLabelSize(0)
79 rooFitFrame.GetYaxis().SetTitleSize(0.072)
80 rooFitFrame.GetYaxis().SetTitleOffset(0.98)
81 rooFitFrame.GetYaxis().SetLabelSize(0.055)
86 pointsHist = ROOT.RooHist()
92 xValDot = ROOT.Double(-1.E30)
93 yValDotA = ROOT.Double(-1.E30)
94 yValDotB = ROOT.Double(-1.E30)
96 iDotsA = ROOT.RooRealVar(
"iDotsA",
"", 0.)
97 idotsB = ROOT.RooRealVar(
"idotsB",
"", 0.)
100 iAsymmetry = ROOT.RooFormulaVar(
"yComb",
"",
"(@0 - @1)/(@0 + @1)", ROOT.RooArgList(iDotsA, idotsB))
102 while iBin < dotsA.GetN() - 1:
103 dotsA.GetPoint(iBin, xValDot, yValDotA)
104 dotsB.GetPoint(iBin, xValDot, yValDotB)
106 iDotsA.setVal(yValDotA)
107 idotsB.setVal(yValDotB)
109 errA = float(dotsA.GetErrorYlow(iBin) + dotsA.GetErrorYhigh(iBin))
110 errB = float(dotsB.GetErrorYlow(iBin) + dotsB.GetErrorYhigh(iBin))
112 if np.isnan(iAsymmetry.getVal())
is not True:
114 asymValue = iAsymmetry.getVal()
116 if (yValDotA + yValDotB) > 0:
117 asymError = float(2 * math.sqrt(yValDotA**2 * errA**2 + yValDotB**2 * errB**2) / (yValDotA + yValDotB)**2)
122 if abs(asymValue) > 3:
128 pointsHist.addBinWithXYError(xValDot, asymValue,
129 dotsA.GetErrorXlow(iBin),
130 dotsA.GetErrorXhigh(iBin),
131 asymError, asymError,)
135 pointsHist.SetMarkerStyle(dotsA.GetMarkerStyle())
138 rooFitFramAsym = rooRealVar.frame()
142 rooFitFramAsym.GetXaxis().SetTickSize(0.07)
143 rooFitFramAsym.GetYaxis().SetTickSize(0.024)
145 rooFitFramAsym.SetTitle(
"")
146 rooFitFramAsym.GetXaxis().SetTitle(rooRealVar.GetTitle() +
" " + units)
147 rooFitFramAsym.GetYaxis().SetTitle(asymmVarName +
" ")
149 if asymmVarName ==
"#it{a}(#Delta#it{t})":
150 rooFitFramAsym.GetXaxis().SetTitleSize(0.2)
151 rooFitFramAsym.GetXaxis().SetTitleOffset(0.9)
152 rooFitFramAsym.GetYaxis().SetTitleSize(0.19)
153 rooFitFramAsym.GetYaxis().SetTitleOffset(0.32)
155 rooFitFramAsym.GetXaxis().SetTitleSize(0.18)
156 rooFitFramAsym.GetXaxis().SetTitleOffset(0.95)
157 rooFitFramAsym.GetYaxis().SetTitleSize(0.13)
158 rooFitFramAsym.GetYaxis().SetTitleOffset(0.52)
160 rooFitFramAsym.GetXaxis().SetLabelSize(0.155)
161 rooFitFramAsym.GetYaxis().SetLabelSize(0.120)
163 rooFitFramAsym.SetAxisRange(-1.0, 1.0,
"Y")
164 rooFitFramAsym.GetYaxis().SetNdivisions(10)
165 rooFitFramAsym.GetYaxis().ChangeLabel(1, -1, 0.)
166 rooFitFramAsym.GetYaxis().ChangeLabel(3, -1, 0.)
167 rooFitFramAsym.GetYaxis().ChangeLabel(5, -1, 0.)
168 rooFitFramAsym.GetYaxis().ChangeLabel(6, -1, -1, -1, -1, -1,
"0.0")
169 rooFitFramAsym.GetYaxis().ChangeLabel(7, -1, 0.)
170 rooFitFramAsym.GetYaxis().ChangeLabel(9, -1, 0.)
171 rooFitFramAsym.GetYaxis().ChangeLabel(11, -1, 0.)
175 gLine0 = ROOT.TLine(rooFitFramAsym.GetXaxis().GetXmin(), 0,
176 rooFitFramAsym.GetXaxis().GetXmax(), 0)
177 gLine0.SetLineWidth(1)
178 gLine0.SetLineColor(13)
179 gLine0.SetLineStyle(3)
181 gLine1 = ROOT.TLine(rooFitFramAsym.GetXaxis().GetXmin(), 0.4,
182 rooFitFramAsym.GetXaxis().GetXmax(), 0.4)
183 gLine1.SetLineWidth(1)
184 gLine1.SetLineColor(13)
185 gLine1.SetLineStyle(3)
187 gLine2 = ROOT.TLine(rooFitFramAsym.GetXaxis().GetXmin(), -0.4,
188 rooFitFramAsym.GetXaxis().GetXmax(), -0.4)
189 gLine2.SetLineWidth(1)
190 gLine2.SetLineColor(13)
191 gLine2.SetLineStyle(3)
193 gLine3 = ROOT.TLine(rooFitFramAsym.GetXaxis().GetXmin(), 0.8,
194 rooFitFramAsym.GetXaxis().GetXmax(), 0.8)
195 gLine3.SetLineWidth(1)
196 gLine3.SetLineColor(13)
197 gLine3.SetLineStyle(3)
199 gLine4 = ROOT.TLine(rooFitFramAsym.GetXaxis().GetXmin(), -0.8,
200 rooFitFramAsym.GetXaxis().GetXmax(), -0.8)
201 gLine4.SetLineWidth(1)
202 gLine4.SetLineColor(13)
203 gLine4.SetLineStyle(3)
205 c1 = ROOT.TCanvas(
"c1",
"c1", 700, 640)
206 c1.SetBottomMargin(0)
209 Pad1 = ROOT.TPad(
"p1",
"p1", 0, 0.277, 1, 1, 0)
210 Pad2 = ROOT.TPad(
"p2",
"p2", 0, 0, 1, 0.276, 0)
214 Pad1.SetLeftMargin(0.15)
215 Pad1.SetBottomMargin(0.02)
216 Pad1.SetTopMargin(0.06)
218 Pad2.SetLeftMargin(0.15)
219 Pad2.SetBottomMargin(0.4)
220 Pad2.SetTopMargin(0.01)
223 rooFitFramAsym.Draw()
229 pointsHist.Draw(
"P SAME")
247 nameOfPlot =
"WithAsymm" + nameOfPlot +
".pdf"
248 c1.SaveAs(nameOfPlot)
254 This class makes plots to validate the generated CP asymmetry. It saves the decay time information of the simulation
255 for both B mesons by running as a basf2 module. It fills the information in RooDataSets and at the end it fits the
256 known quantum mechanical pdfs to the delta T distribution and the individual decay time distributions of
257 the signal and the tag-side B mesons to check if the S and the A parameters in the simulation are correct.
326 Here the module initializes by declaring the variables corresponding to the interesting physical parameters and
327 decay times. The RooDataSets where the information will be saved are also declared.
332 self.
DTDT = ROOT.RooRealVar(
"DT",
"#Delta#it{t}", 0., -11., 11.,
"ps")
333 self.
TsigTsig = ROOT.RooRealVar(
"Tsig",
"#it{t}_{sig}^{gen}", 0., 0., 11.,
"ps")
334 self.
TtagTtag = ROOT.RooRealVar(
"Ttag",
"#it{t}_{tag}^{gen}", 0., 0., 11.,
"ps")
335 self.
DT0DT0 = ROOT.RooRealVar(
"DT0",
"DT0", 0., -7., 7.)
336 self.
TauTau = ROOT.RooRealVar(
"Tau",
"Tau", 1.525, 0., 4.)
337 self.
AA = ROOT.RooRealVar(
"A",
"A", 0, -1, 1)
338 self.
SS = ROOT.RooRealVar(
"S",
"S", 0, -1, 1)
339 self.
DMDM = ROOT.RooRealVar(
"DM",
"DM", 0.507)
340 self.
NormNorm = ROOT.RooRealVar(
"Norm",
"Norm", 2, 1, 8)
341 self.
BetaGammaBetaGamma = ROOT.RooRealVar(
"BetaGamma",
"BetaGamma", 0.5, 0.1, 1)
343 self.
qq = ROOT.RooCategory(
"q",
"q")
344 self.
qq.defineType(
"1")
345 self.
qq.defineType(
"-1")
347 self.
qsigqsig = ROOT.RooCategory(
"qsig",
"qsig")
348 self.
qsigqsig.defineType(
"1")
349 self.
qsigqsig.defineType(
"-1")
351 self.
fitDatafitData = ROOT.RooDataSet(
"fitData",
"fitData", ROOT.RooArgSet(self.
DTDT, self.
qq))
352 self.
fitDataTagfitDataTag = ROOT.RooDataSet(
"fitDataTag",
"fitDataTag", ROOT.RooArgSet(self.
TtagTtag, self.
qq))
353 self.
fitDataTagDeltaTPosfitDataTagDeltaTPos = ROOT.RooDataSet(
"fitDataTagDeltaTPos",
"fitDataTagDeltaTPos", ROOT.RooArgSet(self.
TtagTtag, self.
qq))
354 self.
fitDataTagDeltaTNegfitDataTagDeltaTNeg = ROOT.RooDataSet(
"fitDataTagDeltaTNeg",
"fitDataTagDeltaTNeg", ROOT.RooArgSet(self.
TtagTtag, self.
qq))
355 self.
fitDataSigfitDataSig = ROOT.RooDataSet(
"fitDataSig",
"fitDataSig", ROOT.RooArgSet(self.
TsigTsig, self.
qq, self.
qsigqsig))
356 self.
fitDataSigDeltaTPosfitDataSigDeltaTPos = ROOT.RooDataSet(
"fitDataSigDeltaTPos",
"fitDataSigDeltaTPos", ROOT.RooArgSet(self.
TsigTsig, self.
qq))
357 self.
fitDataSigDeltaTNegfitDataSigDeltaTNeg = ROOT.RooDataSet(
"fitDataSigDeltaTNeg",
"fitDataSigDeltaTNeg", ROOT.RooArgSet(self.
TsigTsig, self.
qq))
369 self.
DeltaZsigUpsilonDeltaZsigUpsilon = ROOT.RooRealVar(
"DeltaZsigUpsilon",
"(#it{z}_{sig}^{dec} - #it{z}_{sig}^{prod})^{gen}", 0., 0., 0.8)
372 "(#it{z}_{tag}^{dec} - #it{z}_{tag}^{prod})^{gen}",
378 "fitDataDeltaZsigUpsilon",
379 "fitDataDeltaZsigUpsilon",
384 "fitDataDeltaZtagUpsilon",
385 "fitDataDeltaZtagUpsilon",
392 self.
TsigPosNegTsigPosNeg = ROOT.RooRealVar(
"Tsig",
"#it{t}_{sig}^{gen}", 0., 0., 7.,
"ps")
393 self.
TtagPosNegTtagPosNeg = ROOT.RooRealVar(
"Ttag",
"#it{t}_{tag}^{gen}", 0., 0., 7.,
"ps")
397 Here the information is collected event by event.
415 for index
in range(0, plistUpsilon.obj().getListSize()):
416 Upsilon4Sparticle = plistUpsilon.obj().getParticle(index)
418 if Upsilon4Sparticle.getPDGCode() == 300553:
419 zUpsilon = mc_variables.evaluate(
"mcZ", Upsilon4Sparticle)
421 for index
in range(0, plist.obj().getListSize()):
422 B0particle = plist.obj().getParticle(index)
427 if B0particle.getNDaughters() == 2:
429 for B0daughter
in B0particle.getDaughters():
430 B0daughters.append(B0daughter)
431 if (abs(B0daughters[0].getPDGCode()) == 443
and abs(B0daughters[1].getPDGCode()) == 310)
or \
432 (abs(B0daughters[1].getPDGCode()) == 443
and abs(B0daughters[0].getPDGCode()) == 310)
or \
433 (abs(B0daughters[1].getPDGCode()) == 16
and abs(B0daughters[0].getPDGCode()) == 16):
438 tSig = mc_variables.evaluate(
"mcDecayTime", B0particle)
439 zSig = mc_variables.evaluate(
"mcZ", B0particle)
440 sigPDG = B0particle.getPDGCode()
442 tTag = mc_variables.evaluate(
"mcDecayTime", B0particle)
443 zTag = mc_variables.evaluate(
"mcZ", B0particle)
444 tagPDG = B0particle.getPDGCode()
447 B0Flags.append(isB0sig)
449 rejectEventFlag =
False
451 DeltaT = 1000 * (tSig - tTag)
454 if len(B0Flags) == 2:
455 if B0Flags[0] != B0Flags[1]
and rejectEventFlag
is not True:
459 self.
DTDT.setVal(DeltaT)
460 self.
TsigTsig.setVal(float(1000 * tSig))
461 self.
TtagTtag.setVal(float(1000 * tTag))
464 self.
qq.setLabel(
"1")
467 self.
qq.setLabel(
"-1")
470 self.
qsigqsig.setLabel(
"1")
473 self.
qsigqsig.setLabel(
"-1")
475 self.
fitDatafitData.add(ROOT.RooArgSet(self.
DTDT, self.
qq))
494 Here the known quantum mechanical pdfs are defined and fitted to the generated MC distributions.
495 Afterwards, the plots are saved.
503 self.
DMDM.setConstant(ROOT.kTRUE)
504 self.
TauTau.setConstant(ROOT.kTRUE)
505 self.
DT0DT0.setConstant(ROOT.kTRUE)
506 self.
NormNorm.setConstant(ROOT.kTRUE)
515 DeltaTp = ROOT.RooGenericPdf(
518 "(exp(-1*abs(DT-DT0)/Tau)/(2*Norm*Tau))*(1+(A*cos(DM*DT)+S*sin(DM*DT)))",
527 DeltaTm = ROOT.RooGenericPdf(
530 "(exp(-1*abs(DT-DT0)/Tau)/(2*Norm*Tau))*(1-(A*cos(DM*DT)+S*sin(DM*DT)))",
539 DeltaT = ROOT.RooSimultaneous(
"DeltaT",
"DeltaT", self.
qq)
540 DeltaT.addPdf(DeltaTp,
"1")
541 DeltaT.addPdf(DeltaTm,
"-1")
544 fitRes = DeltaT.fitTo(
545 self.
fitDatafitData, ROOT.RooFit.Minos(
546 ROOT.kFALSE), ROOT.RooFit.Extended(
547 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
550 DTFrame = self.
DTDT.frame()
551 print(
"here", str(DTFrame.GetXaxis().GetXmax()))
552 self.
fitDatafitData.plotOn(DTFrame, ROOT.RooFit.Cut(
"abs(DT) < " + str(DTFrame.GetXaxis().GetXmax())))
553 self.
fitDatafitData.plotOn(DTFrame,
554 ROOT.RooFit.Cut(
"q==q::1" +
" && abs(DT) < " + str(DTFrame.GetXaxis().GetXmax())),
555 ROOT.RooFit.MarkerColor(ROOT.kRed),
556 ROOT.RooFit.Name(
"data_histB0"))
557 self.
fitDatafitData.plotOn(DTFrame, ROOT.RooFit.Cut(
"q==1" +
" && abs(DT) < " + str(DTFrame.GetXaxis().GetXmax())),
558 ROOT.RooFit.MarkerColor(ROOT.kBlue + 1), ROOT.RooFit.Name(
"data_histAB0"))
566 ROOT.RooFit.ProjWData(
570 ROOT.RooFit.LineWidth(3),
571 ROOT.RooFit.LineColor(
573 ROOT.RooFit.LineStyle(3))
576 ROOT.RooFit.ProjWData(
580 ROOT.RooFit.LineWidth(3),
581 ROOT.RooFit.LineColor(
583 ROOT.RooFit.Components(
"DeltaTp"))
584 DeltaT.plotOn(DTFrame, ROOT.RooFit.ProjWData(ROOT.RooArgSet(self.
qq), self.
fitDatafitData), ROOT.RooFit.LineWidth(
585 3), ROOT.RooFit.LineColor(ROOT.kBlue + 1), ROOT.RooFit.LineStyle(7), ROOT.RooFit.Components(
"DeltaTm"))
588 DTFrame.GetXaxis().SetTitle(
"#Delta#it{t}^{gen} [ps]")
589 DTFrame.GetXaxis().SetTitleSize(0.05)
590 DTFrame.GetXaxis().SetLabelSize(0.045)
591 DTFrame.GetYaxis().SetTitleSize(0.05)
592 DTFrame.GetYaxis().SetTitleOffset(1.5)
593 DTFrame.GetYaxis().SetLabelSize(0.045)
595 c1 = ROOT.TCanvas(
"c1",
"c1", 1400, 1100)
600 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
601 Pad.SetLeftMargin(0.15)
602 Pad.SetBottomMargin(0.15)
608 curveMC = DTFrame.getCurve(
"DeltaT_Norm[DT]")
609 curveMCB0 = DTFrame.getCurve(
"DeltaT_Norm[DT]_Comp[DeltaTp]")
610 curveMCAB0 = DTFrame.getCurve(
"DeltaT_Norm[DT]_Comp[DeltaTm]")
611 curveMC.SetFillColor(ROOT.kWhite)
612 curveMCB0.SetFillColor(ROOT.kWhite)
613 curveMCAB0.SetFillColor(ROOT.kWhite)
615 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
616 lMC.AddEntry(curveMC,
"Both")
617 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
618 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
620 lMC.SetTextSize(0.065)
623 textFitRes =
"#it{A}_{#it{CP}} = " + \
624 '{: 1.2f}'.format(self.
AA.getValV()
if abs(self.
AA.getValV()) > 0.005
else abs(self.
AA.getValV())) + \
625 ", " +
"#it{S}_{#it{CP}} = " + \
626 '{: 1.2f}'.format(self.
SS.getValV()
if abs(self.
SS.getValV()) > 0.005
else abs(self.
SS.getValV()))
628 lFitRes = ROOT.TLegend(0.215, 0.905, 0.7, 0.98)
629 lFitRes.AddEntry(
"", textFitRes,
" ")
630 lFitRes.SetBorderSize(0)
631 lFitRes.SetTextSize(0.054)
644 "#it{A}_{#it{CP}} = " +
653 "#it{A}_{#it{CP}} = " +
661 c1.SaveAs(
"./" +
'B0_JPsiKs_DeltaTFittedOnGenMC.pdf')
664 dotsMC = DTFrame.getHist(
"h_fitData")
665 dotsMCB0 = DTFrame.getHist(
"data_histB0")
666 dotsMCAB0 = DTFrame.getHist(
"data_histAB0")
678 "DeltaTFittedOnGenMC",
681 "#it{a}_{#it{CP}}(#Delta#it{t})",
692 self.
SS.setConstant(ROOT.kTRUE)
693 self.
AA.setConstant(ROOT.kTRUE)
696 DeltaZtagUpsilonp = ROOT.RooGenericPdf(
699 "(exp(-1*abs(DeltaZtagUpsilon/(0.3*BetaGamma))/Tau)/(Norm*Tau))*(1 + " +
700 "(A*(cos(DM*DeltaZtagUpsilon/(0.3*BetaGamma))+(DM*Tau)*sin(DM*DeltaZtagUpsilon/(0.3*BetaGamma))) + " +
701 " S*((DM*Tau)*cos(DM*DeltaZtagUpsilon/(0.3*BetaGamma)) - sin(DM*DeltaZtagUpsilon/(0.3*BetaGamma))))" +
702 "/(1+(Tau*DM)*(Tau*DM)))",
711 DeltaZtagUpsilonm = ROOT.RooGenericPdf(
714 "(exp(-1*abs(DeltaZtagUpsilon/(0.3*BetaGamma))/Tau)/(Norm*Tau))*(1 - " +
715 "(A*(cos(DM*DeltaZtagUpsilon/(0.3*BetaGamma))+(DM*Tau)*sin(DM*DeltaZtagUpsilon/(0.3*BetaGamma))) + " +
716 " S*((DM*Tau)*cos(DM*DeltaZtagUpsilon/(0.3*BetaGamma)) - sin(DM*DeltaZtagUpsilon/(0.3*BetaGamma))))" +
717 "/(1+(Tau*DM)*(Tau*DM)))",
726 DeltaZtagUpsilonModel = ROOT.RooSimultaneous(
"DeltaZtagUpsilonModel",
"DeltaZtagUpsilonModel", self.
qq)
727 DeltaZtagUpsilonModel.addPdf(DeltaZtagUpsilonp,
"1")
728 DeltaZtagUpsilonModel.addPdf(DeltaZtagUpsilonm,
"-1")
729 DeltaZtagUpsilonModel.Print()
731 fitResTag = DeltaZtagUpsilonModel.fitTo(
733 ROOT.kFALSE), ROOT.RooFit.Extended(
734 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
740 DeltaZtagUpsilonFrame,
741 ROOT.RooFit.Cut(
"q==q::1"),
742 ROOT.RooFit.MarkerColor(
744 ROOT.RooFit.Name(
"data_histB0tag"))
746 DeltaZtagUpsilonFrame,
747 ROOT.RooFit.Cut(
"q==1"),
748 ROOT.RooFit.MarkerColor(
750 ROOT.RooFit.Name(
"data_histAB0tag"))
752 DeltaZtagUpsilonModel.plotOn(
753 DeltaZtagUpsilonFrame,
754 ROOT.RooFit.ProjWData(
758 ROOT.RooFit.LineWidth(3),
759 ROOT.RooFit.LineColor(
761 ROOT.RooFit.LineStyle(3))
762 DeltaZtagUpsilonModel.plotOn(
763 DeltaZtagUpsilonFrame,
764 ROOT.RooFit.ProjWData(
768 ROOT.RooFit.LineWidth(3),
769 ROOT.RooFit.LineColor(
771 ROOT.RooFit.Components(
"DeltaZtagUpsilonp"))
772 DeltaZtagUpsilonModel.plotOn(
773 DeltaZtagUpsilonFrame,
774 ROOT.RooFit.ProjWData(
778 ROOT.RooFit.LineWidth(3),
779 ROOT.RooFit.LineColor(
781 ROOT.RooFit.LineStyle(7),
782 ROOT.RooFit.Components(
"DeltaZtagUpsilonm"))
783 DeltaZtagUpsilonFrame.SetTitle(
"")
784 DeltaZtagUpsilonFrame.GetXaxis().SetTitle(
"(#it{z}_{tag}^{dec} - #it{z}_{tag}^{prod}){}^{gen} [mm]")
785 DeltaZtagUpsilonFrame.GetXaxis().SetTitleSize(0.05)
786 DeltaZtagUpsilonFrame.GetXaxis().SetLabelSize(0.045)
787 DeltaZtagUpsilonFrame.GetYaxis().SetTitleSize(0.05)
788 DeltaZtagUpsilonFrame.GetYaxis().SetTitleOffset(1.5)
789 DeltaZtagUpsilonFrame.GetYaxis().SetLabelSize(0.045)
791 c2 = ROOT.TCanvas(
"c2",
"c2", 1400, 1100)
796 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
797 Pad.SetLeftMargin(0.15)
798 Pad.SetBottomMargin(0.15)
801 DeltaZtagUpsilonFrame.Draw()
803 curveMC = DeltaZtagUpsilonFrame.getCurve(
"DeltaZtagUpsilonModel_Norm[DeltaZtagUpsilon]")
804 curveMCB0 = DeltaZtagUpsilonFrame.getCurve(
"DeltaZtagUpsilonModel_Norm[DeltaZtagUpsilon]_Comp[DeltaZtagUpsilonp]")
805 curveMCAB0 = DeltaZtagUpsilonFrame.getCurve(
"DeltaZtagUpsilonModel_Norm[DeltaZtagUpsilon]_Comp[DeltaZtagUpsilonm]")
806 curveMC.SetFillColor(ROOT.kWhite)
807 curveMCB0.SetFillColor(ROOT.kWhite)
808 curveMCAB0.SetFillColor(ROOT.kWhite)
810 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
811 lMC.AddEntry(curveMC,
"Both")
812 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
813 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
815 lMC.SetTextSize(0.065)
819 c2.SaveAs(
"./" +
'B0_JPsiKs_DeltaZtagUpsilonFittedOnGenMC.pdf')
822 dotsMC = DeltaZtagUpsilonFrame.getHist(
"h_fitDataDeltaZtagUpsilon")
823 dotsMCB0 = DeltaZtagUpsilonFrame.getHist(
"data_histB0tag")
824 dotsMCAB0 = DeltaZtagUpsilonFrame.getHist(
"data_histAB0tag")
827 DeltaZtagUpsilonFrame,
836 "DeltaZtagUpsilonFittedOnGenMC",
842 self.
SS.setConstant(ROOT.kFALSE)
843 self.
AA.setConstant(ROOT.kFALSE)
857 Ttagp = ROOT.RooGenericPdf(
860 "(exp(-1*abs(Ttag)/Tau)/(Norm*Tau))*(1 + " +
861 "(A*(cos(DM*Ttag)+(DM*Tau)*sin(DM*Ttag)) + S*((DM*Tau)*cos(DM*Ttag) - sin(DM*Ttag)))/(1+(Tau*DM)*(Tau*DM)))",
869 Ttagm = ROOT.RooGenericPdf(
872 "(exp(-1*abs(Ttag)/Tau)/(Norm*Tau))*(1 - " +
873 "(A*(cos(DM*Ttag)+(DM*Tau)*sin(DM*Ttag)) + S*((DM*Tau)*cos(DM*Ttag) - sin(DM*Ttag)))/(1+(Tau*DM)*(Tau*DM)))",
881 TtagModel = ROOT.RooSimultaneous(
"TtagModel",
"TtagModel", self.
qq)
882 TtagModel.addPdf(Ttagp,
"1")
883 TtagModel.addPdf(Ttagm,
"-1")
886 fitResTag = TtagModel.fitTo(
888 ROOT.kFALSE), ROOT.RooFit.Extended(
889 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
892 TtagFrame = self.
TtagTtag.frame()
896 ROOT.RooFit.Cut(
"q==q::1"),
897 ROOT.RooFit.MarkerColor(
899 ROOT.RooFit.Name(
"data_histB0tag"))
902 ROOT.RooFit.Cut(
"q==1"),
903 ROOT.RooFit.MarkerColor(
905 ROOT.RooFit.Name(
"data_histAB0tag"))
909 ROOT.RooFit.ProjWData(
913 ROOT.RooFit.LineWidth(3),
914 ROOT.RooFit.LineColor(
916 ROOT.RooFit.LineStyle(3))
919 ROOT.RooFit.ProjWData(
923 ROOT.RooFit.LineWidth(3),
924 ROOT.RooFit.LineColor(
926 ROOT.RooFit.Components(
"Ttagp"))
929 ROOT.RooFit.ProjWData(
933 ROOT.RooFit.LineWidth(3),
934 ROOT.RooFit.LineColor(
936 ROOT.RooFit.LineStyle(7),
937 ROOT.RooFit.Components(
"Ttagm"))
938 TtagFrame.SetTitle(
"")
939 TtagFrame.GetXaxis().SetTitle(
"#it{t}_{tag}^{gen} [ps]")
940 TtagFrame.GetXaxis().SetTitleSize(0.05)
941 TtagFrame.GetXaxis().SetLabelSize(0.045)
942 TtagFrame.GetYaxis().SetTitleSize(0.05)
943 TtagFrame.GetYaxis().SetTitleOffset(1.5)
944 TtagFrame.GetYaxis().SetLabelSize(0.045)
946 c2 = ROOT.TCanvas(
"c2",
"c2", 1400, 1100)
949 self.
TtagTtag.Print()
951 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
952 Pad.SetLeftMargin(0.15)
953 Pad.SetBottomMargin(0.15)
958 curveMC = TtagFrame.getCurve(
"TtagModel_Norm[Ttag]")
959 curveMCB0 = TtagFrame.getCurve(
"TtagModel_Norm[Ttag]_Comp[Ttagp]")
960 curveMCAB0 = TtagFrame.getCurve(
"TtagModel_Norm[Ttag]_Comp[Ttagm]")
961 curveMC.SetFillColor(ROOT.kWhite)
962 curveMCB0.SetFillColor(ROOT.kWhite)
963 curveMCAB0.SetFillColor(ROOT.kWhite)
965 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
966 lMC.AddEntry(curveMC,
"Both")
967 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
968 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
970 lMC.SetTextSize(0.065)
974 c2.SaveAs(
"./" +
'B0_JPsiKs_TtagFittedOnGenMC.pdf')
977 dotsMC = TtagFrame.getHist(
"h_fitDataTag")
978 dotsMCB0 = TtagFrame.getHist(
"data_histB0tag")
979 dotsMCAB0 = TtagFrame.getHist(
"data_histAB0tag")
981 plotWithAsymmetry(TtagFrame, self.
TtagTtag, dotsMC, dotsMCB0, dotsMCAB0, curveMC, curveMCB0,
982 curveMCAB0,
"[ps]",
"TtagFittedOnGenMC", lMC,
"", labelAsymmetry,
True)
994 Ttagp = ROOT.RooGenericPdf(
997 "(exp(-2*abs(Ttag)/Tau)/(Tau))*(1 + (A + S*(DM*Tau))/(1+(Tau*DM)*(Tau*DM)))",
1005 Ttagm = ROOT.RooGenericPdf(
1008 "(exp(-2*abs(Ttag)/Tau)/(Tau))*(1 - (A + S*(DM*Tau))/(1+(Tau*DM)*(Tau*DM)))",
1016 TtagModel = ROOT.RooSimultaneous(
"TtagModel",
"TtagModel", self.
qq)
1017 TtagModel.addPdf(Ttagp,
"1")
1018 TtagModel.addPdf(Ttagm,
"-1")
1021 fitResTagPos = TtagModel.fitTo(
1023 ROOT.kFALSE), ROOT.RooFit.Extended(
1024 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
1025 fitResTagPos.Print(
"v")
1027 TtagFrame = self.
TtagPosNegTtagPosNeg.frame()
1028 self.
fitDataTagDeltaTPosfitDataTagDeltaTPos.plotOn(TtagFrame, ROOT.RooFit.Cut(
"Ttag < " + str(TtagFrame.GetXaxis().GetXmax())))
1030 ROOT.RooFit.Cut(
"q==q::1 && Ttag < " + str(TtagFrame.GetXaxis().GetXmax())),
1031 ROOT.RooFit.MarkerColor(ROOT.kRed),
1032 ROOT.RooFit.Name(
"data_histB0tag"))
1034 ROOT.RooFit.Cut(
"q==1 && Ttag < " + str(TtagFrame.GetXaxis().GetXmax())),
1035 ROOT.RooFit.MarkerColor(ROOT.kBlue + 1),
1036 ROOT.RooFit.Name(
"data_histAB0tag"))
1038 TtagModel.plotOn(TtagFrame, ROOT.RooFit.ProjWData(ROOT.RooArgSet(self.
qq), self.
fitDataTagDeltaTPosfitDataTagDeltaTPos),
1039 ROOT.RooFit.LineWidth(3), ROOT.RooFit.LineColor(ROOT.kBlack), ROOT.RooFit.LineStyle(3))
1042 ROOT.RooFit.ProjWData(
1046 ROOT.RooFit.LineWidth(3),
1047 ROOT.RooFit.LineColor(
1049 ROOT.RooFit.Components(
"Ttagp"))
1052 ROOT.RooFit.ProjWData(
1056 ROOT.RooFit.LineWidth(3),
1057 ROOT.RooFit.LineColor(
1059 ROOT.RooFit.LineStyle(7),
1060 ROOT.RooFit.Components(
"Ttagm"))
1061 TtagFrame.SetTitle(
"")
1062 TtagFrame.GetXaxis().SetTitle(
"#it{t}_{tag}^{gen} [ps]")
1063 TtagFrame.GetXaxis().SetTitleSize(0.05)
1064 TtagFrame.GetXaxis().SetLabelSize(0.045)
1065 TtagFrame.GetYaxis().SetTitleSize(0.05)
1066 TtagFrame.GetYaxis().SetTitleOffset(1.5)
1067 TtagFrame.GetYaxis().SetLabelSize(0.045)
1069 c2 = ROOT.TCanvas(
"c2",
"c2", 1400, 1100)
1072 self.
TtagTtag.Print()
1074 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
1075 Pad.SetLeftMargin(0.15)
1076 Pad.SetBottomMargin(0.15)
1081 curveMC = TtagFrame.getCurve(
"TtagModel_Norm[Ttag]")
1082 curveMCB0 = TtagFrame.getCurve(
"TtagModel_Norm[Ttag]_Comp[Ttagp]")
1083 curveMCAB0 = TtagFrame.getCurve(
"TtagModel_Norm[Ttag]_Comp[Ttagm]")
1084 curveMC.SetFillColor(ROOT.kWhite)
1085 curveMCB0.SetFillColor(ROOT.kWhite)
1086 curveMCAB0.SetFillColor(ROOT.kWhite)
1088 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
1089 lMC.AddEntry(curveMC,
"Both")
1090 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
1091 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
1093 lMC.SetTextSize(0.065)
1096 fitResTagPos.Print(
"v")
1097 c2.SaveAs(
"./" +
'B0_JPsiKs_TtagFittedOnGenMCPositiveDeltaT.pdf')
1100 dotsMC = TtagFrame.getHist(
"h_fitDataTag")
1101 dotsMCB0 = TtagFrame.getHist(
"data_histB0tag")
1102 dotsMCAB0 = TtagFrame.getHist(
"data_histAB0tag")
1114 "TtagFittedOnGenMCPositiveDeltaT",
1126 self.
AA.setConstant(ROOT.kFALSE)
1129 Ttagp = ROOT.RooGenericPdf(
1132 "(exp(-1*abs(Ttag)/Tau)*(1 + " +
1133 "(A*(cos(DM*Ttag)+(DM*Tau)*sin(DM*Ttag)) + S*((DM*Tau)*cos(DM*Ttag) - sin(DM*Ttag)))/(1+(Tau*DM)*(Tau*DM))) - " +
1134 "(exp(-2*abs(Ttag)/Tau))*(1 + (A + S*(DM*Tau))/(1+(Tau*DM)*(Tau*DM))))/(Tau)",
1141 Ttagm = ROOT.RooGenericPdf(
1144 "(exp(-1*abs(Ttag)/Tau)*(1 - " +
1145 "(A*(cos(DM*Ttag)+(DM*Tau)*sin(DM*Ttag)) + S*((DM*Tau)*cos(DM*Ttag) - sin(DM*Ttag)))/(1+(Tau*DM)*(Tau*DM))) - " +
1146 "(exp(-2*abs(Ttag)/Tau))*(1 - (A + S*(DM*Tau))/(1+(Tau*DM)*(Tau*DM))))/(Tau)",
1153 TtagModel = ROOT.RooSimultaneous(
"TtagModel",
"TtagModel", self.
qq)
1154 TtagModel.addPdf(Ttagp,
"1")
1155 TtagModel.addPdf(Ttagm,
"-1")
1158 fitResTagNeg = TtagModel.fitTo(
1160 ROOT.kFALSE), ROOT.RooFit.Extended(
1161 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
1162 fitResTagNeg.Print(
"v")
1164 TtagFrame = self.
TtagPosNegTtagPosNeg.frame()
1165 self.
fitDataTagDeltaTNegfitDataTagDeltaTNeg.plotOn(TtagFrame, ROOT.RooFit.Cut(
"Ttag < " + str(TtagFrame.GetXaxis().GetXmax())))
1167 ROOT.RooFit.Cut(
"q==q::1 && Ttag < " + str(TtagFrame.GetXaxis().GetXmax())),
1168 ROOT.RooFit.MarkerColor(ROOT.kRed),
1169 ROOT.RooFit.Name(
"data_histB0tag"))
1171 ROOT.RooFit.Cut(
"q==1 && Ttag < " + str(TtagFrame.GetXaxis().GetXmax())),
1172 ROOT.RooFit.MarkerColor(ROOT.kBlue + 1),
1173 ROOT.RooFit.Name(
"data_histAB0tag"))
1175 TtagModel.plotOn(TtagFrame, ROOT.RooFit.ProjWData(ROOT.RooArgSet(self.
qq), self.
fitDataTagDeltaTNegfitDataTagDeltaTNeg),
1176 ROOT.RooFit.LineWidth(3), ROOT.RooFit.LineColor(ROOT.kBlack), ROOT.RooFit.LineStyle(3))
1179 ROOT.RooFit.ProjWData(
1183 ROOT.RooFit.LineWidth(3),
1184 ROOT.RooFit.LineColor(
1186 ROOT.RooFit.Components(
"Ttagp"))
1189 ROOT.RooFit.ProjWData(
1193 ROOT.RooFit.LineWidth(3),
1194 ROOT.RooFit.LineColor(
1196 ROOT.RooFit.LineStyle(7),
1197 ROOT.RooFit.Components(
"Ttagm"))
1198 TtagFrame.SetTitle(
"")
1199 TtagFrame.GetXaxis().SetTitle(
"#it{t}_{tag}^{gen} [ps]")
1200 TtagFrame.GetXaxis().SetTitleSize(0.05)
1201 TtagFrame.GetXaxis().SetLabelSize(0.045)
1202 TtagFrame.GetYaxis().SetTitleSize(0.05)
1203 TtagFrame.GetYaxis().SetTitleOffset(1.5)
1204 TtagFrame.GetYaxis().SetLabelSize(0.045)
1206 c2 = ROOT.TCanvas(
"c2",
"c2", 1400, 1100)
1209 self.
TtagTtag.Print()
1211 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
1212 Pad.SetLeftMargin(0.15)
1213 Pad.SetBottomMargin(0.15)
1221 curveMC = TtagFrame.getCurve(
"TtagModel_Norm[Ttag]")
1222 curveMCB0 = TtagFrame.getCurve(
"TtagModel_Norm[Ttag]_Comp[Ttagp]")
1223 curveMCAB0 = TtagFrame.getCurve(
"TtagModel_Norm[Ttag]_Comp[Ttagm]")
1224 curveMC.SetFillColor(ROOT.kWhite)
1225 curveMCB0.SetFillColor(ROOT.kWhite)
1226 curveMCAB0.SetFillColor(ROOT.kWhite)
1228 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
1229 lMC.AddEntry(curveMC,
"Both")
1230 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
1231 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
1233 lMC.SetTextSize(0.065)
1236 fitResTagNeg.Print(
"v")
1237 c2.SaveAs(
"./" +
'B0_JPsiKs_TtagFittedOnGenMCNegativeDeltaT.pdf')
1240 dotsMC = TtagFrame.getHist(
"h_fitDataTag")
1241 dotsMCB0 = TtagFrame.getHist(
"data_histB0tag")
1242 dotsMCAB0 = TtagFrame.getHist(
"data_histAB0tag")
1254 "TtagFittedOnGenMCNegativeDeltaT",
1268 self.
SS.setConstant(ROOT.kTRUE)
1269 self.
AA.setConstant(ROOT.kTRUE)
1272 DeltaZsigUpsilonp = ROOT.RooGenericPdf(
1273 "DeltaZsigUpsilonp",
1274 "DeltaZsigUpsilonp",
1275 "(exp(-1*abs(DeltaZsigUpsilon/(0.3*BetaGamma))/Tau)/(Norm*Tau))*(1 + " +
1276 "(A*(cos(DM*DeltaZsigUpsilon/(0.3*BetaGamma))+(DM*Tau)*sin(DM*DeltaZsigUpsilon/(0.3*BetaGamma))) + " +
1277 "S*(-(DM*Tau)*cos(DM*DeltaZsigUpsilon/(0.3*BetaGamma)) + sin(DM*DeltaZsigUpsilon/(0.3*BetaGamma))))" +
1278 "/(1+(Tau*DM)*(Tau*DM)))",
1287 DeltaZsigUpsilonm = ROOT.RooGenericPdf(
1288 "DeltaZsigUpsilonm",
1289 "DeltaZsigUpsilonm",
1290 "(exp(-1*abs(DeltaZsigUpsilon/(0.3*BetaGamma))/Tau)/(Norm*Tau))*(1 - "
1291 "(A*(cos(DM*DeltaZsigUpsilon/(0.3*BetaGamma))+(DM*Tau)*sin(DM*DeltaZsigUpsilon/(0.3*BetaGamma))) + "
1292 "S*(-(DM*Tau)*cos(DM*DeltaZsigUpsilon/(0.3*BetaGamma)) + sin(DM*DeltaZsigUpsilon/(0.3*BetaGamma))))"
1293 "/(1+(Tau*DM)*(Tau*DM)))",
1302 DeltaZsigUpsilonModel = ROOT.RooSimultaneous(
"DeltaZsigUpsilonModel",
"DeltaZsigUpsilonModel", self.
qq)
1303 DeltaZsigUpsilonModel.addPdf(DeltaZsigUpsilonp,
"1")
1304 DeltaZsigUpsilonModel.addPdf(DeltaZsigUpsilonm,
"-1")
1305 DeltaZsigUpsilonModel.Print()
1307 fitResTag = DeltaZsigUpsilonModel.fitTo(
1309 ROOT.kFALSE), ROOT.RooFit.Extended(
1310 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
1311 fitResTag.Print(
"v")
1316 DeltaZsigUpsilonFrame,
1317 ROOT.RooFit.Cut(
"q==q::1"),
1318 ROOT.RooFit.MarkerColor(
1320 ROOT.RooFit.Name(
"data_histB0sig"))
1322 DeltaZsigUpsilonFrame,
1323 ROOT.RooFit.Cut(
"q==1"),
1324 ROOT.RooFit.MarkerColor(
1326 ROOT.RooFit.Name(
"data_histAB0sig"))
1328 DeltaZsigUpsilonModel.plotOn(
1329 DeltaZsigUpsilonFrame,
1330 ROOT.RooFit.ProjWData(
1334 ROOT.RooFit.LineWidth(3),
1335 ROOT.RooFit.LineColor(
1337 ROOT.RooFit.LineStyle(3))
1338 DeltaZsigUpsilonModel.plotOn(
1339 DeltaZsigUpsilonFrame,
1340 ROOT.RooFit.ProjWData(
1344 ROOT.RooFit.LineWidth(3),
1345 ROOT.RooFit.LineColor(
1347 ROOT.RooFit.Components(
"DeltaZsigUpsilonp"))
1348 DeltaZsigUpsilonModel.plotOn(
1349 DeltaZsigUpsilonFrame,
1350 ROOT.RooFit.ProjWData(
1354 ROOT.RooFit.LineWidth(3),
1355 ROOT.RooFit.LineColor(
1357 ROOT.RooFit.LineStyle(7),
1358 ROOT.RooFit.Components(
"DeltaZsigUpsilonm"))
1359 DeltaZsigUpsilonFrame.SetTitle(
"")
1360 DeltaZsigUpsilonFrame.GetXaxis().SetTitle(
"(#it{z}_{sig}^{dec} - #it{z}_{sig}^{prod}){}^{gen} [mm]")
1361 DeltaZsigUpsilonFrame.GetXaxis().SetTitleSize(0.05)
1362 DeltaZsigUpsilonFrame.GetXaxis().SetLabelSize(0.045)
1363 DeltaZsigUpsilonFrame.GetYaxis().SetTitleSize(0.05)
1364 DeltaZsigUpsilonFrame.GetYaxis().SetTitleOffset(1.5)
1365 DeltaZsigUpsilonFrame.GetYaxis().SetLabelSize(0.045)
1367 c2 = ROOT.TCanvas(
"c2",
"c2", 1400, 1100)
1372 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
1373 Pad.SetLeftMargin(0.15)
1374 Pad.SetBottomMargin(0.15)
1377 DeltaZsigUpsilonFrame.Draw()
1379 curveMC = DeltaZsigUpsilonFrame.getCurve(
"DeltaZsigUpsilonModel_Norm[DeltaZsigUpsilon]")
1380 curveMCB0 = DeltaZsigUpsilonFrame.getCurve(
"DeltaZsigUpsilonModel_Norm[DeltaZsigUpsilon]_Comp[DeltaZsigUpsilonp]")
1381 curveMCAB0 = DeltaZsigUpsilonFrame.getCurve(
"DeltaZsigUpsilonModel_Norm[DeltaZsigUpsilon]_Comp[DeltaZsigUpsilonm]")
1382 curveMC.SetFillColor(ROOT.kWhite)
1383 curveMCB0.SetFillColor(ROOT.kWhite)
1384 curveMCAB0.SetFillColor(ROOT.kWhite)
1386 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
1387 lMC.AddEntry(curveMC,
"Both")
1388 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
1389 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
1391 lMC.SetTextSize(0.065)
1394 fitResTag.Print(
"v")
1395 c2.SaveAs(
"./" +
'B0_JPsiKs_DeltaZsigUpsilonFittedOnGenMC.pdf')
1398 dotsMC = DeltaZsigUpsilonFrame.getHist(
"h_fitDataDeltaZsigUpsilon")
1399 dotsMCB0 = DeltaZsigUpsilonFrame.getHist(
"data_histB0sig")
1400 dotsMCAB0 = DeltaZsigUpsilonFrame.getHist(
"data_histAB0sig")
1403 DeltaZsigUpsilonFrame,
1412 "DeltaZsigUpsilonFittedOnGenMC",
1418 self.
SS.setConstant(ROOT.kFALSE)
1419 self.
AA.setConstant(ROOT.kFALSE)
1424 Tsigp = ROOT.RooGenericPdf(
1427 "(exp(-1*abs(Tsig)/Tau)/(Norm*Tau))*(1 + " +
1428 "(A*(cos(DM*Tsig)+(DM*Tau)*sin(DM*Tsig)) + S*(-(DM*Tau)*cos(DM*Tsig) + sin(DM*Tsig)))/(1+(Tau*DM)*(Tau*DM)))",
1436 Tsigm = ROOT.RooGenericPdf(
1439 "(exp(-1*abs(Tsig)/Tau)/(Norm*Tau))*(1 - " +
1440 "(A*(cos(DM*Tsig)+(DM*Tau)*sin(DM*Tsig)) + S*(-(DM*Tau)*cos(DM*Tsig) + sin(DM*Tsig)))/(1+(Tau*DM)*(Tau*DM)))",
1448 TsigModel = ROOT.RooSimultaneous(
"TsigModel",
"TsigModel", self.
qq)
1449 TsigModel.addPdf(Tsigp,
"1")
1450 TsigModel.addPdf(Tsigm,
"-1")
1453 fitResSig = TsigModel.fitTo(
1454 self.
fitDataSigfitDataSig, ROOT.RooFit.Minos(
1455 ROOT.kFALSE), ROOT.RooFit.Extended(
1456 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
1457 fitResSig.Print(
"v")
1459 TsigFrame = self.
TsigTsig.frame()
1463 ROOT.RooFit.Cut(
"q==q::1"),
1464 ROOT.RooFit.MarkerColor(
1466 ROOT.RooFit.Name(
"data_histB0sig"))
1469 ROOT.RooFit.Cut(
"q==1"),
1470 ROOT.RooFit.MarkerColor(
1472 ROOT.RooFit.Name(
"data_histAB0sig"))
1476 ROOT.RooFit.ProjWData(
1480 ROOT.RooFit.LineWidth(3),
1481 ROOT.RooFit.LineColor(
1483 ROOT.RooFit.LineStyle(3))
1486 ROOT.RooFit.ProjWData(
1490 ROOT.RooFit.LineWidth(3),
1491 ROOT.RooFit.LineColor(
1493 ROOT.RooFit.Components(
"Tsigp"))
1496 ROOT.RooFit.ProjWData(
1500 ROOT.RooFit.LineWidth(3),
1501 ROOT.RooFit.LineColor(
1503 ROOT.RooFit.LineStyle(7),
1504 ROOT.RooFit.Components(
"Tsigm"))
1505 TsigFrame.SetTitle(
"")
1506 TsigFrame.GetXaxis().SetTitle(
"#it{t}_{sig}^{gen} [ps]")
1507 TsigFrame.GetXaxis().SetTitleSize(0.05)
1508 TsigFrame.GetXaxis().SetLabelSize(0.045)
1509 TsigFrame.GetYaxis().SetTitleSize(0.05)
1510 TsigFrame.GetYaxis().SetTitleOffset(1.5)
1511 TsigFrame.GetYaxis().SetLabelSize(0.045)
1513 c3 = ROOT.TCanvas(
"c2",
"c2", 1400, 1100)
1516 self.
TsigTsig.Print()
1518 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
1519 Pad.SetLeftMargin(0.15)
1520 Pad.SetBottomMargin(0.15)
1525 curveMC = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]")
1526 curveMCB0 = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]_Comp[Tsigp]")
1527 curveMCAB0 = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]_Comp[Tsigm]")
1528 curveMC.SetFillColor(ROOT.kWhite)
1529 curveMCB0.SetFillColor(ROOT.kWhite)
1530 curveMCAB0.SetFillColor(ROOT.kWhite)
1532 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
1533 lMC.AddEntry(curveMC,
"Both")
1534 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
1535 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
1537 lMC.SetTextSize(0.065)
1540 fitResSig.Print(
"v")
1541 c3.SaveAs(
"./" +
'B0_JPsiKs_TsigFittedOnGenMC.pdf')
1544 dotsMC = TsigFrame.getHist(
"h_fitDataSig")
1545 dotsMCB0 = TsigFrame.getHist(
"data_histB0sig")
1546 dotsMCAB0 = TsigFrame.getHist(
"data_histAB0sig")
1548 plotWithAsymmetry(TsigFrame, self.
TsigTsig, dotsMC, dotsMCB0, dotsMCAB0, curveMC, curveMCB0,
1549 curveMCAB0,
"[ps]",
"TsigFittedOnGenMC", lMC,
"", labelAsymmetry,
True)
1562 Tsigp = ROOT.RooGenericPdf(
1565 "(exp(-1*abs(Tsig)/Tau)*(1 + " +
1566 "(A*(cos(DM*Tsig)+(DM*Tau)*sin(DM*Tsig)) + S*(-(DM*Tau)*cos(DM*Tsig) + sin(DM*Tsig)))/(1+(Tau*DM)*(Tau*DM))) - " +
1567 "(exp(-2*abs(Tsig)/Tau))*(1 + (A - S*(DM*Tau))/(1+(Tau*DM)*(Tau*DM))))/(Tau)",
1574 Tsigm = ROOT.RooGenericPdf(
1577 "(exp(-1*abs(Tsig)/Tau)*(1 - " +
1578 "(A*(cos(DM*Tsig)+(DM*Tau)*sin(DM*Tsig)) + S*(-(DM*Tau)*cos(DM*Tsig) + sin(DM*Tsig)))/(1+(Tau*DM)*(Tau*DM))) - " +
1579 "(exp(-2*abs(Tsig)/Tau))*(1 - (A - S*(DM*Tau))/(1+(Tau*DM)*(Tau*DM))))/(Tau)",
1587 TsigModel = ROOT.RooSimultaneous(
"TsigModel",
"TsigModel", self.
qq)
1588 TsigModel.addPdf(Tsigp,
"1")
1589 TsigModel.addPdf(Tsigm,
"-1")
1592 fitResSigPos = TsigModel.fitTo(
1594 ROOT.kFALSE), ROOT.RooFit.Extended(
1595 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
1596 fitResSigPos.Print(
"v")
1598 TsigFrame = self.
TsigPosNegTsigPosNeg.frame()
1599 self.
fitDataSigDeltaTPosfitDataSigDeltaTPos.plotOn(TsigFrame, ROOT.RooFit.Cut(
"Tsig < " + str(TsigFrame.GetXaxis().GetXmax())))
1601 ROOT.RooFit.Cut(
"q==q::1 && Tsig < " + str(TsigFrame.GetXaxis().GetXmax())),
1602 ROOT.RooFit.MarkerColor(ROOT.kRed),
1603 ROOT.RooFit.Name(
"data_histB0sig"))
1605 ROOT.RooFit.Cut(
"q==1 && Tsig < " + str(TsigFrame.GetXaxis().GetXmax())),
1606 ROOT.RooFit.MarkerColor(ROOT.kBlue + 1),
1607 ROOT.RooFit.Name(
"data_histAB0sig"))
1609 TsigModel.plotOn(TsigFrame, ROOT.RooFit.ProjWData(ROOT.RooArgSet(self.
qq), self.
fitDataSigDeltaTPosfitDataSigDeltaTPos),
1610 ROOT.RooFit.LineWidth(3), ROOT.RooFit.LineColor(ROOT.kBlack), ROOT.RooFit.LineStyle(3))
1613 ROOT.RooFit.ProjWData(
1617 ROOT.RooFit.LineWidth(3),
1618 ROOT.RooFit.LineColor(
1620 ROOT.RooFit.Components(
"Tsigp"))
1623 ROOT.RooFit.ProjWData(
1627 ROOT.RooFit.LineWidth(3),
1628 ROOT.RooFit.LineColor(
1630 ROOT.RooFit.LineStyle(7),
1631 ROOT.RooFit.Components(
"Tsigm"))
1632 TsigFrame.SetTitle(
"")
1633 TsigFrame.GetXaxis().SetTitle(
"#it{t}_{sig}^{gen} [ps]")
1634 TsigFrame.GetXaxis().SetTitleSize(0.05)
1635 TsigFrame.GetXaxis().SetLabelSize(0.045)
1636 TsigFrame.GetYaxis().SetTitleSize(0.05)
1637 TsigFrame.GetYaxis().SetTitleOffset(1.5)
1638 TsigFrame.GetYaxis().SetLabelSize(0.045)
1640 c2 = ROOT.TCanvas(
"c2",
"c2", 1400, 1100)
1643 self.
TsigTsig.Print()
1645 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
1646 Pad.SetLeftMargin(0.15)
1647 Pad.SetBottomMargin(0.15)
1652 curveMC = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]")
1653 curveMCB0 = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]_Comp[Tsigp]")
1654 curveMCAB0 = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]_Comp[Tsigm]")
1655 curveMC.SetFillColor(ROOT.kWhite)
1656 curveMCB0.SetFillColor(ROOT.kWhite)
1657 curveMCAB0.SetFillColor(ROOT.kWhite)
1659 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
1660 lMC.AddEntry(curveMC,
"Both")
1661 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
1662 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
1664 lMC.SetTextSize(0.065)
1667 fitResSigPos.Print(
"v")
1668 c2.SaveAs(
"./" +
'B0_JPsiKs_TsigFittedOnGenMCPositiveDeltaT.pdf')
1671 dotsMC = TsigFrame.getHist(
"h_fitDataSig")
1672 dotsMCB0 = TsigFrame.getHist(
"data_histB0sig")
1673 dotsMCAB0 = TsigFrame.getHist(
"data_histAB0sig")
1685 "TsigFittedOnGenMCPositiveDeltaT",
1697 self.
AA.setConstant(ROOT.kFALSE)
1701 Tsigp = ROOT.RooGenericPdf(
1704 "(exp(-2*abs(Tsig)/Tau)/(Tau))*(1 + (A - S*(DM*Tau))/(1+(Tau*DM)*(Tau*DM)))",
1712 Tsigm = ROOT.RooGenericPdf(
1715 "(exp(-2*abs(Tsig)/Tau)/(Tau))*(1 - (A - S*(DM*Tau))/(1+(Tau*DM)*(Tau*DM)))",
1724 TsigModel = ROOT.RooSimultaneous(
"TsigModel",
"TsigModel", self.
qq)
1725 TsigModel.addPdf(Tsigp,
"1")
1726 TsigModel.addPdf(Tsigm,
"-1")
1729 fitResSigNeg = TsigModel.fitTo(
1731 ROOT.kFALSE), ROOT.RooFit.Extended(
1732 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
1733 fitResSigNeg.Print(
"v")
1735 TsigFrame = self.
TsigPosNegTsigPosNeg.frame()
1736 self.
fitDataSigDeltaTNegfitDataSigDeltaTNeg.plotOn(TsigFrame, ROOT.RooFit.Cut(
"Tsig < " + str(TsigFrame.GetXaxis().GetXmax())))
1738 ROOT.RooFit.Cut(
"q==q::1 && Tsig < " + str(TsigFrame.GetXaxis().GetXmax())),
1739 ROOT.RooFit.MarkerColor(ROOT.kRed),
1740 ROOT.RooFit.Name(
"data_histB0sig"))
1742 ROOT.RooFit.Cut(
"q==1 && Tsig < " + str(TsigFrame.GetXaxis().GetXmax())),
1743 ROOT.RooFit.MarkerColor(ROOT.kBlue + 1),
1744 ROOT.RooFit.Name(
"data_histAB0sig"))
1746 TsigModel.plotOn(TsigFrame, ROOT.RooFit.ProjWData(ROOT.RooArgSet(self.
qq), self.
fitDataSigDeltaTNegfitDataSigDeltaTNeg),
1747 ROOT.RooFit.LineWidth(3), ROOT.RooFit.LineColor(ROOT.kBlack), ROOT.RooFit.LineStyle(3))
1750 ROOT.RooFit.ProjWData(
1754 ROOT.RooFit.LineWidth(3),
1755 ROOT.RooFit.LineColor(
1757 ROOT.RooFit.Components(
"Tsigp"))
1760 ROOT.RooFit.ProjWData(
1764 ROOT.RooFit.LineWidth(3),
1765 ROOT.RooFit.LineColor(
1767 ROOT.RooFit.LineStyle(7),
1768 ROOT.RooFit.Components(
"Tsigm"))
1769 TsigFrame.SetTitle(
"")
1770 TsigFrame.GetXaxis().SetTitle(
"#it{t}_{sig}^{gen} [ps]")
1771 TsigFrame.GetXaxis().SetTitleSize(0.05)
1772 TsigFrame.GetXaxis().SetLabelSize(0.045)
1773 TsigFrame.GetYaxis().SetTitleSize(0.05)
1774 TsigFrame.GetYaxis().SetTitleOffset(1.5)
1775 TsigFrame.GetYaxis().SetLabelSize(0.045)
1777 c2 = ROOT.TCanvas(
"c2",
"c2", 1400, 1100)
1780 self.
TsigTsig.Print()
1782 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
1783 Pad.SetLeftMargin(0.15)
1784 Pad.SetBottomMargin(0.15)
1792 curveMC = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]")
1793 curveMCB0 = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]_Comp[Tsigp]")
1794 curveMCAB0 = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]_Comp[Tsigm]")
1795 curveMC.SetFillColor(ROOT.kWhite)
1796 curveMCB0.SetFillColor(ROOT.kWhite)
1797 curveMCAB0.SetFillColor(ROOT.kWhite)
1799 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
1800 lMC.AddEntry(curveMC,
"Both")
1801 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
1802 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
1804 lMC.SetTextSize(0.065)
1807 fitResSigNeg.Print(
"v")
1808 c2.SaveAs(
"./" +
'B0_JPsiKs_TsigFittedOnGenMCNegativeDeltaT.pdf')
1811 dotsMC = TsigFrame.getHist(
"h_fitDataSig")
1812 dotsMCB0 = TsigFrame.getHist(
"data_histB0sig")
1813 dotsMCAB0 = TsigFrame.getHist(
"data_histAB0sig")
1825 "TsigFittedOnGenMCNegativeDeltaT",
1833 self.
TauTau.setConstant(ROOT.kFALSE)
1836 Tsigp = ROOT.RooGenericPdf(
"Tsigp",
"Tsigp",
"(exp(-1*abs(Tsig)/Tau)/(Norm*Tau))",
1837 ROOT.RooArgList(self.
NormNorm, self.
TsigTsig, self.
TauTau, self.
DMDM))
1838 Tsigm = ROOT.RooGenericPdf(
"Tsigm",
"Tsigm",
"(exp(-1*abs(Tsig)/Tau)/(Norm*Tau))",
1839 ROOT.RooArgList(self.
NormNorm, self.
TsigTsig, self.
TauTau, self.
DMDM))
1840 TsigModel = ROOT.RooSimultaneous(
"TsigModel",
"TsigModel", self.
qsigqsig)
1841 TsigModel.addPdf(Tsigp,
"1")
1842 TsigModel.addPdf(Tsigm,
"-1")
1845 fitResSig = TsigModel.fitTo(
1846 self.
fitDataSigfitDataSig, ROOT.RooFit.Minos(
1847 ROOT.kFALSE), ROOT.RooFit.Extended(
1848 ROOT.kFALSE), ROOT.RooFit.NumCPU(1), ROOT.RooFit.Save())
1849 fitResSig.Print(
"v")
1851 TsigFrame = self.
TsigTsig.frame()
1855 ROOT.RooFit.Cut(
"qsig==qsig::1"),
1856 ROOT.RooFit.MarkerColor(
1858 ROOT.RooFit.Name(
"data_histB0sig"))
1861 ROOT.RooFit.Cut(
"qsig==1"),
1862 ROOT.RooFit.MarkerColor(
1864 ROOT.RooFit.Name(
"data_histAB0sig"))
1868 ROOT.RooFit.ProjWData(
1872 ROOT.RooFit.LineWidth(3),
1873 ROOT.RooFit.LineColor(
1875 ROOT.RooFit.LineStyle(3))
1878 ROOT.RooFit.ProjWData(
1882 ROOT.RooFit.LineWidth(3),
1883 ROOT.RooFit.LineColor(
1885 ROOT.RooFit.Components(
"Tsigp"))
1888 ROOT.RooFit.ProjWData(
1892 ROOT.RooFit.LineWidth(3),
1893 ROOT.RooFit.LineColor(
1895 ROOT.RooFit.LineStyle(7),
1896 ROOT.RooFit.Components(
"Tsigm"))
1897 TsigFrame.SetTitle(
"")
1898 TsigFrame.GetXaxis().SetTitle(
"#it{t}_{sig}^{gen} [ps]")
1899 TsigFrame.GetXaxis().SetTitleSize(0.05)
1900 TsigFrame.GetXaxis().SetLabelSize(0.045)
1901 TsigFrame.GetYaxis().SetTitleSize(0.05)
1902 TsigFrame.GetYaxis().SetTitleOffset(1.5)
1903 TsigFrame.GetYaxis().SetLabelSize(0.045)
1905 c3 = ROOT.TCanvas(
"c2",
"c2", 1400, 1100)
1908 self.
TsigTsig.Print()
1910 Pad = ROOT.TPad(
"p1",
"p1", 0, 0, 1, 1, 0, 0, 0)
1911 Pad.SetLeftMargin(0.15)
1912 Pad.SetBottomMargin(0.15)
1917 curveMC = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]")
1918 curveMCB0 = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]_Comp[Tsigp]")
1919 curveMCAB0 = TsigFrame.getCurve(
"TsigModel_Norm[Tsig]_Comp[Tsigm]")
1920 curveMC.SetFillColor(ROOT.kWhite)
1921 curveMCB0.SetFillColor(ROOT.kWhite)
1922 curveMCAB0.SetFillColor(ROOT.kWhite)
1924 lMC = ROOT.TLegend(0.73, 0.60, 0.89, 0.89)
1925 lMC.AddEntry(curveMC,
"Both")
1926 lMC.AddEntry(curveMCAB0,
'#bar{#it{B}}^{0}')
1927 lMC.AddEntry(curveMCB0,
'#it{B}^{0}')
1929 lMC.SetTextSize(0.065)
1932 fitResSig.Print(
"v")
1933 c3.SaveAs(
"./" +
'B0_JPsiKs_TsigQsigFittedOnGenMC.pdf')
1938 Diff = B0tagbarsPercentage - B0tagPercentage
1939 print(
"B0 Tag Flavor: ")
1946 B0tagbarsPercentage,
1953 Diff = B0signalbarsPercentage - B0signalPercentage
1954 print(
"B0 Signal Flavor: ")
1961 B0signalbarsPercentage,
1966 print(
"Total amount of events = ", self.
nentriesnentries)
1970 validation_path.add_module(fitDeltaTModule)
1972 b2.process(validation_path)
1973 print(b2.statistics)
fitDataDeltaZtagUpsilon
RooDataSet containing DeltaZtagUpsilon and q.
q
Flavor of the tag-side B0 meson at the time of its decay.
fitDataSigDeltaTNeg
RooDataSet containing Tsig and q for negative DT.
fitData
RooDataSet containing DT and q for each event.
fractionB0InSignalSide
Fraction of B0s in the signal side.
fitDataTagDeltaTNeg
RooDataSet containing Ttag and q for negative DT.
DT0
Production time of the B mesons.
qsig
Flavor of the signal-side B0 meson at the time of its decay.
Norm
Normalization factor of the quantum mechanical pdfs.
A
Direct CP-violation parameter (CP violation in decay).
fitDataDeltaZsigUpsilon
RooDataSet containing DeltaZsigUpsilon and q.
fractionB0barInSignalSide
Fraction of anti-B0s in the signal side.
B0barsInTagSide
Number of tag-side anti-B0s (negative flavor).
BetaGamma
Lorentz boost of the B mesons.
fitDataTagDeltaTPos
RooDataSet containing Ttag and q for positive DT.
B0sInSignalSide
Number of B0s in the signal side (positive flavor).
DM
Mass difference between the two B0-mass eigenstates.
Ttag
Decay time of the tag-side B meson.
TsigPosNeg
Empty variable just to define the limits of the frames in the plots for Tsig.
fitDataSig
RooDataSet containing Tsig and q for each event.
fitDataTag
RooDataSet containing Ttag and q for each event.
DeltaZtagUpsilon
Difference between the production and the decay vertices of the tag-side B0 meson in z direction.
B0sInTagSide
Number of tag-side B0s (positive flavor).
S
Mixing-induced CP-violation parameter (CP violation caused by the overlap between mixing and decay ph...
Tsig
Decay time of the signal B mesons.
DeltaZsigUpsilon
Difference between the production and the decay vertices of the signal-side B0 meson in z direction.
DT
Time difference between the decays of the two generated B mesons.
fitDataSigDeltaTPos
RooDataSet containing Tsig and q for positive DT.
TtagPosNeg
Empty variable just to define the limits of the frames in the plots for Ttag.
nentries
Total number of analyzed events.
B0barsInSignalSide
Number of anti-B0s in the signal side (negative flavor).
a (simplified) python wrapper for StoreObjPtr.