Hi, I would like to do a simple CLs comparison between a B-only model and S+B model. Since in the full version the S model is negative, I want to use RooRealSumPdf to add the S and B shapes:
model = RooRealSumPdf("model","model",
RooArgList(bkg, sig),
RooArgList(nBkgExp,nSig)
)
The problem is when I configure the B and S+B ModelConfigs and put these into the AsymptoticCalculator, I am unable to call GetHypoTest(). (Oddly enough, this seems to work when I use RooAddPdf instead of RooRealSumPdf.) The error message is:
[#0] PROGRESS:Eval -- AsymptoticCalculator: Building Asimov data Set
[#0] ERROR:InputArguments -- A counting model pdf must be either a RooProdPdf or a RooPoisson or a RooGaussian
[#0] ERROR:InputArguments -- AsymptoticCalculator: Error : Asimov data set could not be generated
[#0] PROGRESS:Eval -- AsymptoticCalculator: Building Asimov data Set
[#0] ERROR:InputArguments -- A counting model pdf must be either a RooProdPdf or a RooPoisson or a RooGaussian
[#0] ERROR:InputArguments -- AsymptoticCalculator: Error : Asimov data set could not be generated
[#0] ERROR:InputArguments -- AsymptoticCalculator::GetHypoTest - Error initializing Asymptotic calculator - return NULL result
I have attached a full stand-alone example of this (See line 58.errorDemoAsymptoticCalculator.py (5.1 KB)). I must be misunderstanding something about how AsymptoticCalculator works, but I’m not sure what. Is there something I’m missing? Can I use AsymptoticCalculator to set this kind of limit?
the Asymptotic calculator indeed only supports PDFs where you can count the number of events, and additionally a Gaussian distribution. You can make each PDF countable by extending it, i.e., lifting the “normalised to one” condition.
The reason that it works with the RooAddPdf is that it automatically switches to an extended mode if you have as many PDFs as coefficients, because in this case the sum of all coefficients is the expected number of events.
The RooRealSumPdf can be extended in the same way, but it requires an active decision to extend it. See: https://root.cern.ch/doc/master/classRooRealSumPdf.html
and switch the last (default) argument of the constructor to True:
model = RooRealSumPdf("model","model",
RooArgList(bkg, sig),
RooArgList(nBkgExp,nSig),
True #This is important!
)
As a follow up: the fit works for RooRealSumPdf if I remove the AsymptoticCalculator(data, h0_model, h1_model) line. So is something happening inside AsymptoticCalculator that modifies the PDF?