How to use the pyroofit.composites.AddPdf function in pyroofit

To help you get started, we’ve selected a few pyroofit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github simonUU / PyrooFit / tests / test_composites.py View on Github external
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)
github simonUU / PyrooFit / tests / test_composites.py View on Github external
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)
github simonUU / PyrooFit / examples / histogram_template_fit.py View on Github external
# First we build the template of some data
template_data = np.random.normal(0, 1, 1000)

pdf = HistPDF(
    ('x', -3, 3),
    template_data,
    nbins=10,
)
pdf.fix()
pdf.get()

# And now we can fit that template to some new data to measure the yield
fit_data = np.random.normal(0, 1, 5000)

pdf2 = AddPdf([pdf])
pdf2.fit(fit_data)
# pdf2.plot('example_hist.pdf')  # Bug causes this to error atm
pdf2.get()
pdf2.plot('histogram_template_fit.pdf')

pyroofit

Python wrapper for RooFit to create fits easily with pandas DataFrames.

MIT
Latest version published 4 years ago

Package Health Score

39 / 100
Full package analysis

Similar packages