15form1 = ROOT.TFormula(
"form1",
"abs(sin(x)/x)")
20sqroot = ROOT.TF1(
"sqroot",
"x*gaus(0) + [3]*form1", rangeMin, rangeMax)
28sqroot.SetParameters(gausScale, gausMean, gausVar, form1Scale)
31h1d = ROOT.TH1D(
"h1d",
"Test random numbers", 200, rangeMin, rangeMax)
34h1d.FillRandom(
"sqroot", 10000)
37with ROOT.TFile.Open(
"fillrandom_userfunc_py.root",
"RECREATE")
as myFile:
38 myFile.WriteObject(form1, form1.GetName())
39 myFile.WriteObject(sqroot, sqroot.GetName())
40 myFile.WriteObject(h1d, h1d.GetName())