RooFit normalization

I have an issue with the normalization of the fitted function with RooFit. I know that the PDF of the is automatically adjusted to the number of events. So far so good.

The problem is when I fit twice** the same data with the same PDF, it looks like the normalization gets a factor 2 x the number of events (see attachment). Is there a way to get rid of that factor 2 ?

Thanks,
Salva

** Why do I want to fit twice? Well, in the first pass some parameters are fixed, then released for the second pass


HI,

Can you post a minimal macro reproducing this problem.
Thank you

Lorenzo

I’ve just come across this problem as well. I’ve put together a mimimal example here:
https://gist.github.com/chrisburr/35bd39ea32c4d43e7c61a146c1a8f3c0

Cheers,

Chris

Hi,

Thank you for your nice notebook showing this bug. I will investigate it

Cheers

Lorenzo

Hi,

The problem is in the deduction of the normalisation range. If you add also the plotting option
RooFit::NormRange(“full”), it will work in your case

 w.pdf('model').plotOn(frame, RooFit.NormRange("full"),RooFit.Range("full"))

Lorenzo

Hi Lorenzo,

Thank you for getting back to me, my real fit now works as well.

Cheers,

Chris