27psi = ROOT.RooRealVar(
"psi",
"psi", 0, 3.14159268)
30Tpsi = ROOT.RooGenericPdf(
"Tpsi",
"1+sin(2*@0)", [psi])
33gbias = ROOT.RooRealVar(
"gbias",
"gbias", 0.2, 0.0, 1)
34greso = ROOT.RooRealVar(
"greso",
"greso", 0.3, 0.1, 1.0)
35Rpsi = ROOT.RooGaussian(
"Rpsi",
"Rpsi", psi, gbias, greso)
38cpsi = ROOT.RooRealVar(
"cpsi",
"cos(psi)", -1, 1)
39psif = ROOT.RooFormulaVar(
"psif",
"acos(cpsi)", [cpsi])
42Tcpsi = ROOT.RooGenericPdf(
"T",
"1+sin(2*@0)", [psif])
48Mpsi = ROOT.RooFFTConvPdf(
"Mf",
"Mf", psi, Tpsi, Rpsi)
52Mpsi.setBufferFraction(0)
58data_psi = Mpsi.generate({psi}, 10000)
61Mpsi.fitTo(data_psi, PrintLevel=-1)
64frame1 = psi.frame(Title=
"Cyclical convolution in angle psi")
65data_psi.plotOn(frame1)
69Tpsi.plotOn(frame1, LineColor=
"r")
78Mcpsi = ROOT.RooFFTConvPdf(
"Mf",
"Mf", psif, psi, Tpsi, Rpsi)
82Mcpsi.setBufferFraction(0)
88data_cpsi = Mcpsi.generate({cpsi}, 10000)
94Mcpsi.fitTo(data_cpsi, PrintLevel=-1)
97frame2 = cpsi.frame(Title=
"Same convolution in psi, in cos(psi)")
98data_cpsi.plotOn(frame2)
102Tcpsi.plotOn(frame2, LineColor=
"r")
105c = ROOT.TCanvas(
"rf210_angularconv",
"rf210_angularconv", 800, 400)
108ROOT.gPad.SetLeftMargin(0.15)
109frame1.GetYaxis().SetTitleOffset(1.4)
112ROOT.gPad.SetLeftMargin(0.15)
113frame2.GetYaxis().SetTitleOffset(1.4)
116c.SaveAs(
"rf210_angularconv.png")