Hi Gregory,
That’s possible. At the likelihood level it is of course trivial, but the data implementation is hidden, e.g.
RooAbsReal* nll1 = pdf1->createNLL(unbinnedData,...) ;
RooAbsReal* nll2 = pdf2->createNLL(binnedData,...) ;
RooAddition nllsum("nllsum","nllsum",RooArgSet(*nll1,*nll2)) ;
RooMinuit m(nllsum) ; // etc
At the p.d.f/dataset level, it is possible by first converting the binned dataset into
an unbinned weighted dataset
// Example pdfs to generate input data
RooWorkspace w(“w”,1) ;
w.factory(“Gaussian::g(x[-10,10],0,3)”) ;
w.factory(“Uniform::u(x)”) ;
// Make binned and unbined input data
RooDataSet* d = w::g.generate(w::x,1000) ;
RooDataHist* h = w::u.generateBinned(w::x,1000) ;
// Convert both d and h into unbinned weighted datasets
// ----------------------------------------------------
w.factory(“wgt[1,0,1000000]”) ;
d->addColumn(w::wgt) ;
d->setWeightVar(“wgt”) ;
RooDataSet* hw = d->emptyClone() ;
for (Int_t i=0 ; inumEntries() ; i++) {
hw->add(*h->get(i),h->weight()) ;
}
// ---------------------------------------------------
// Make joint dataset
w.factory(“index[a,b]”) ;
RooDataSet* joint = new RooDataSet(“joint”,“joint”,RooArgSet(w::x,w::wgt),Index(w::index),Import(“a”,*d),Import(“b”,*hw),WeightVar(w::wgt)) ;
A higher level interface for such procedures is forthcoming in the next release in
in RooWorkspace
Wouter