Dear all,
I am using ROOT 6.07/07 and the latest version of RooFit.
I have a Roodataset (data) and a model (model).
As a simplified example of my problem, let’s say the model depends on 2 parameters, a and b.
I want to minimise the likelihood and calculate the “best” values of a and b given the data I have.
This seems to be quite simple usually:
// Construct unbinned likelihood
RooAbsReal* nll = model.createNLL(*data,NumCPU(2)) ;
// Minimize likelihood w.r.t all parameters
RooMinuit(*nll).migrad() ;
However, in this case, I have a model that contains a conditional factor.
e.g:
if c = 1 and d = 0, model = (1-ab)*gaussian
else if c = 1 and d = 1, model = (1+ab)*gaussian
Is it possible to do the likelihood minimisation using a conditional model like this? I can’t see how to do this, but I’m sure it’s possible.
Best and thanks in advance!
moneta
August 5, 2016, 10:32am
2
HI,
In theory it is possible, but what are c and d ? Two discrete parameter of your model that you are trying to fit (vary) in the likelihood minimisation ?
Lorenzo
Dear Lorenzo,
Please see the attached screenshot to better understand what I am trying to do… (perhaps I am not explaining very well )
The variable tau is the one that changes based on the value of x and y in the data (which will have their pdfs fitted)
Thanks!
S
I believe this problem can be solved by leveraging the RooSimPdfBuilder class with multiple prototype pdfs
See here:
Solved!
The problem is that you have to feed the ingredient pdfs of the RooSimultaneous to the RooSimPdfBuilder constructor e.g:
RooSimPdfBuilder mgr(DC, gauss_1, gauss_2.....) ;
Not just the RooSimultaneous itself e.g:
RooSimPdfBuilder mgr(simPdf) ;
The solution was found here:
root.cern.ch/root/html510/src/R … r.cxx.html
Thanks to those that replied!
S
S