Hi
I just noticed, that when I generate data from a RooPoisson with small mean (eg 0.5) and have set the range of the RooRealVar, whose Value I generate, to [0,100], 0 will not be generated.
To obtain 0 for the result I have to set the lower boundary to -1.
On the other hand, I can set the value of this variable to 0 with no Problem.
Is my impression correct and is this a desired feature?
I find it very confusing.
Below you’ll find the code, I used to check that.
Kind regards Markus
{
#ifndef CINT
#include “RooGlobalFunc.h”
#endif
using namespace RooFit ;
using namespace RooStats ;
RooRealVar n_obs(“n_obs”,“n_obs”,0,100);
n_obs.setVal(0);
cout<<n_obs.getVal()<<endl;
RooRealVar signal(“signal”,“signal”,0.5,0,100);
RooPoisson
counting_model(“counting_model”,“counting_model”,n_obs,signal);
RooDataSet* data = new RooDataSet(“Data”, “Data”,
RooArgSet(n_obs));
for(int i=0;i<100;i++){
data.add(*counting_model.generate(n_obs,1)->get());
}
data->write(“test”);
}