Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_fit():
import ROOT
x = ROOT.RooRealVar('mbc', '', 0, 0, 1)
pdf = Gauss(x)
df = get_test_df(100)
pdf.fit(df)
assert isinstance(pdf.roo_pdf, ROOT.RooAbsPdf)
def test_fit_bins():
import ROOT
x = ROOT.RooRealVar('mbc', '', 0, 0, 1)
pdf = Gauss(x)
df = get_test_df(100)
pdf.fit(df, nbins=5)
assert isinstance(pdf.roo_pdf, ROOT.RooAbsPdf)
def test_AddPdf():
import ROOT
df = get_test_df()
assert isinstance(df, pd.DataFrame)
bkg = Chebychev(('mbc', 0, 1))
sig = Gauss(('mbc', 0, 1))
pdf = sig+bkg
#pdf.fit(df)
#pdf.plot('test2.pdf')
assert isinstance(pdf, AddPdf)
assert isinstance(pdf.roo_pdf, ROOT.RooAbsPdf)
def test_AddPdf_fit():
import ROOT
df = get_test_df()
assert isinstance(df, pd.DataFrame)
bkg = Chebychev(('mbc', 0, 1))
sig = Gauss(('mbc', 0, 1))
pdf = sig+bkg
pdf.fit(df)
#pdf.plot('test2.pdf')
assert isinstance(pdf, AddPdf)
assert isinstance(pdf.roo_pdf, ROOT.RooAbsPdf)
def test_AddPdf_fit():
import ROOT
df = get_test_df()
assert isinstance(df, pd.DataFrame)
bkg = Chebychev(('mbc', 0, 1))
sig = Gauss(('mbc', 0, 1))
pdf = sig+bkg
pdf.fit(df)
#pdf.plot('test2.pdf')
assert isinstance(pdf, AddPdf)
assert isinstance(pdf.roo_pdf, ROOT.RooAbsPdf)
def test_Chebychev():
import ROOT
df = get_test_df()
assert isinstance(df, pd.DataFrame)
pdf = Chebychev(('mbc', 0, 1))
pdf.fix(True)
#pdf.fit(df)
#pdf.plot('test.pdf')
pdf.observables.mbc # test that mbc is available by attribute lookup
assert isinstance(pdf.roo_pdf, ROOT.RooChebychev)
def test_AddPdf():
import ROOT
df = get_test_df()
assert isinstance(df, pd.DataFrame)
bkg = Chebychev(('mbc', 0, 1))
sig = Gauss(('mbc', 0, 1))
pdf = sig+bkg
#pdf.fit(df)
#pdf.plot('test2.pdf')
assert isinstance(pdf, AddPdf)
assert isinstance(pdf.roo_pdf, ROOT.RooAbsPdf)
def test_AddPdf():
import ROOT
df = get_test_df()
assert isinstance(df, pd.DataFrame)
bkg = Chebychev(('mbc', 0, 1))
sig = Gauss(('mbc', 0, 1))
pdf = sig+bkg
#pdf.fit(df)
#pdf.plot('test2.pdf')
assert isinstance(pdf, AddPdf)
assert isinstance(pdf.roo_pdf, ROOT.RooAbsPdf)
def test_AddPdf_fit():
import ROOT
df = get_test_df()
assert isinstance(df, pd.DataFrame)
bkg = Chebychev(('mbc', 0, 1))
sig = Gauss(('mbc', 0, 1))
pdf = sig+bkg
pdf.fit(df)
#pdf.plot('test2.pdf')
assert isinstance(pdf, AddPdf)
assert isinstance(pdf.roo_pdf, ROOT.RooAbsPdf)
def test_Convolution():
import ROOT
df = get_test_df()
assert isinstance(df, pd.DataFrame)
bkg = Chebychev(('mbc', 0, 1))
sig = Gauss(('mbc', 0, 1))
pdf = Convolution(bkg, sig)
assert isinstance(pdf, Convolution)
assert isinstance(pdf.roo_pdf, ROOT.RooAbsPdf)