I do inbinned fit in the dimuon mass range of 12-70 GeV and would like to
get ln(L) in sidebands 12-25, 30-70 GeV and in the signal region 25-30 GeV
and ln(L) in the whole range. I expect that sum of ln in sidebands and signal region = ln(L) in the whole region. It is not happen. I do:

dimuonmass2.setRange("R1",12.0,25.0);
dimuonmass2.setRange("R2",30.0,70.0);
dimuonmass2.setRange("signalrange",25.0,30.0);
RooFitResult* r = model.fitTo(data,Range(12.,70.),Save());
std::unique_ptr<RooAbsReal> nll1270{model.createNLL(data, Range("R1,signalrange,R2"))};
std::unique_ptr<RooAbsReal> nllsideband{model.createNLL(data, Range("R1,R2"))};
std::unique_ptr<RooAbsReal> nllsignal{model.createNLL(data, Range("signalrange"))};
and the print
cout << "-log(L) = " << r->minNll() << endl;
cout << "-log(L) R1,signalrange,R2 = " << nll1270->getVal() << endl;
cout << "-log(L) in R1,R2 = " << nllsideband->getVal() << std::endl;
cout << "-log(L) in signalrange = " << nllsignal->getVal() << std::endl;
I got out:
-log(L) = -4828.44
-log(L) R1,signalrange,R2 = -4823.46
-log(L) in R1,R2 = -4021.51
-log(L) in signalrange = -801.951

first, I expected that first and second numbers should be the same - they are not. Second, I expected that sum of last two numers = first number. It is not the case.

Which ROOT version are you using? I think this was a problem a few versions ago but I fixed it in the meantime. See the release notes for ROOT 6.26. However, since you are apparently using a very old CMSSW release, you don’t benefit from the fix I know there is some effort to make combine work with ROOT 6.26, can you maybe do that?

Thanks! That’s what I expected (see more detail in my previous post).

In that case, you should move to a newer ROOT version, because until ROOT 6.26, non-extended multi-range fits didn’t do what the users expected. They didn’t take the relative normalization of events in the ranges into account, which is actually valuable information that can constrain the parameters quite a bit.

I would refrain from doing the fit like this. Your best options are to do an extended fit (or is your fit extended already?), or using ROOT 6.26 or newer. If you go for the extended fit, here is a tutorial (you should not look at the newer version of the tutorial since ROOT 6.26, since this one doesn’t explain the problem anymore because it’s gone): https://root.cern.ch/doc/v624/rf204b__extendedLikelihood__rangedFit_8C.html