I am trying to do an unbinned fit of weighted events. I’ve read a lot in the forums about this that show that there are issues here, so I wanted to double check that it was doing what I expected. I am using Root 5.34.
I first create a RooDataSet with weights between 0.9-5, then I perform a fit.
[code]RooFormulaVar wFunc("w","event weight", weight,m); //weight from 0.9-5 RooDataSet data("data","data",RooArgSet(m,pt,y),Import(*fTree)); //make unbinned data set RooRealVar *w = (RooRealVar*)data.addColumn(wFunc); RooFitResult *FR(0); FR=sum.fitTo(wdata,Extended(),SumW2Error(kFALSE),PrintEvalErrors(-1),PrintLevel(-1),Verbose(kFALSE),Save()); //or
The result for both SumW2Error true and false is that the relative uncertainty [sigma_N/N] on my parameter of interest (should extract signal yield) ranges from 6%-2.5% as the weight goes from 0.9-5. I’m surprised by this, because I would hope that the event weights would not change the relative uncertainty.
Say for argument N=270 events. The relative uncertainty should be ~sqrt(N)/N~=6%. Now suppose we weight by a factor of 5, N’=5*N=1350, and then the relative uncertainty is 2.7%. That suggests to me that the code is actually using the weights when computing the uncertainty, which is precisely what I do not want it to do…
Is there something I am doing wrong in setting up the weights?