Roofit: generation of events from histogram shape?

Hi all,

I have a question about Roofit.
Can I generate events from Histogram, that is,
in the next example, I want to generate toyMC based on the shape of “hdata”.

TFile f1 = new TFile(“t.root”);
TH1D * h1 = new TH1D(
((TH1D*) gDirectory->Get(“Mass_higgscand”)));
RooDataHist hdata(“hdata”,“binned data”,x,h1);

Actually, I can find examples to generate toyMC from pdf
but cannot find it from a binned histogram.


Post questions abour Roofit at “Stats and Math tools”, you increase your chances to get an answer from Wouter ::slight_smile: