Monte Carlo

I would like to take a histogram and then create a new histogram from that one representing a different possible experiment. This is for ensemble testing. I know that RooFit has this MC study class but I do not want to use it right now. I know that I can just clone the histogram and then reset it and then do a FillRandom passing in the original histogram as the pdf. Problem is I am not sure that really represents what I need. I would think that I would need a bin by bin Poisson pull using the number of events in that bin as the mean of the Poisson, with the errors set correctly of course. Is there a way to do this in root. I looked at the TH1 class and did not see anything thing that did this without doing it by hand. Is there a way to have root do this for me? Thanks for any info.

Justace

You can do something like:

void poiss() { TH1F *h1 = new TH1F("h1","source",100,-3,3); h1->FillRandom("gaus",5000); TH1F *h2 = new TH1F("h2","result",100,-3,3); TRandom3 r; for (Int_t bin=1;bin<=100;bin++) { Double_t x = h1->GetXaxis()->GetBinCenter(bin); Double_t y = h1->GetBinContent(bin); h2->Fill(x,r.Poisson(y)); } h2->Draw(); }

Rene