Hello,
I’m having a problem when using RooAddition to combine different likelihoods.
The final error of the variables I’m fitting seem wrong.
I define a list of likelihoods from different PDFs using:
RooAbsReal *nll_1 = model_1->createNLL(*data_1,RooFit::CloneData(kFALSE),Extended(kTRUE),Constrain(*nbkgvar));
RooAbsReal *nll_2 = …
(each PDF is used to fit a different category)
Then, I add each log likelihood to a RooArgSet
RooArgSet llSet;
llSet.add(nll_1);
llSet.add(nll_2);
…
which I use to define the following combined likelihood
RooAbsReal *combll = new RooAddition(“combll”,“combll”,llSet);
The problem is that the variables stored in the set are not being recognized as log likelihoods
by the RooAddition class
and after the minimization procedure is done the error is evaluated at 1.0 level instead of 0.5 level.
The warning message is:
INFO:Fitting – RooAddition::defaultErrorLevel(combll) WARNING: Summation contains neither RooNLLVar nor RooChi2Var server, using default level of 1.0
I have forced the error level to be 0.5 with
RooMinuit minuit(*combll);
minuit.setErrorLevel(0.5);
and I got the correct answear for the error
but I was wondering if there is another way to do it.
Also I’m not being able to retrieve the asymmetric errors for the variable I’m fitting (I get 0 for both).
Finally I have checked that a dynamic_cast of a RooNLLVar to my nll_i variables returns a null pointer
which must be the reason why the RooAddition class is not recongnizing these as likelihoods.
Thanks for your help,
Pedro