Extended likelihood fit to BinnedLikelihood RooRealSumPdf

So I’m trying to figure out what I’m doing wrong here, in 6.22, I’m just doing a quick test with RooRealSumPdf’s BinnedLikelihood feature, which I understand should be interpreting the values of the function as an event count rather than as an unnormalized probability density. I’ll keep trying to debug it but I’d thought I’d post here in case someone knows quickly what I’ve overlooked.

I do the following:

    RooRealVar x("x","x",0,100);
    RooRealVar m("m","m",-0.2,-5,0.);
    RooExponential exp1("exp1","exp1",x,m);
    RooRealVar y("y","yield",10000,0,2e7);
    RooRealSumPdf model("model","model",exp1,y,true);
    model.setAttribute("BinnedLikelihood");
    model.setAttribute("BinnedLikelihoodActive");
    auto expected = model.generate(x,RooFit::ExpectedData(),RooFit::Extended());
    model.fitTo(*expected, RooFit::Extended());

I check the expected dataset and it appears to have the correct values (side-note: it only gives me correct values if the bin widths are 1, hence the x range I set to 0-100 here because roofit defaults to 100 bins), but the fit seems to push the “y” parameter all the way up to the maximum.

I was expecting the best fit y and m values to be exactly what value they currently are, so trying to work out why “y” gets pushed up to the maximum in this fit??

Maybe @StephanH can take a quick look

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.