Hi

I am trying to generate toys where I have to generate very few events less than 10 events. My RooFit sometime crashes when I generate events less than 6-7 events and less than 10 (for complex shapes) when I use Poisson fluctuation (using Extended(kTRUE)). If I turn off the Poisson fluctuation, there is no crash.

The reason which I am able to think is that as events are less… there is a possibility of event going to zero and at that point RooFit crash. Is there any way to prevent this???

To prevent this, at present I am doing a trick… I get the Poisson distribution for the number (I need to generate) and write the events (100 times than the events I need to generate) corresponding to this distribution in a file and than using random events from this to generate events (with Poisson fluctuation off). This way I am artificially introducing Poisson fluctuation in my generation and if I get 0 events than I simple write some strange number which will be rejected by my fitter (as it is out of the range I specified).

My only worry is that using this, there may be chance of introducing some bias. So, I would like to know if there is some standard way to prevent my RooFit crash when I generate few events (<10) using Poisson fluctuation ON???

:::: I generate using the code below, if I need to generate 4 events::::

RooDataSet *data1=dGh.generate(RooArgSet(delte,modeh),4,Extended(kTRUE));

data1->write(“file.dat”);