import tensorflow as tf


# // --- Generate a toyMC sample from composite PDF ---
# RooDataSet *data = sum.generate(mes,2000) ;


def sum_pdf(mes, nsig, sigmean, sigwidth, nbkg, m0, argpar, mes_low, mes_high):
    add = tf.add(nsig * gaussian_pdf(mes, sigmean, sigwidth),
                 nbkg * argus_pdf_phalf_WN(mes, m0, argpar, mes_low, mes_high),
                 name="sum_pdf")
    return tf.div(add, nsig + nbkg, name="sum_pdf_normalized")


# data in RooFit genereren en importeren
# draai dit in ROOT:
# data.write("roofit_demo_random_data_values.dat");
# om het weer in te lezen:
# RooDataSet *data;
# data->RooDataSet.read("roofit_demo_random_data_values.dat", RooArgList(mes))
