I have found what may be a bug. It came up when fitting to extract a yield from events where each event has a weight that is determined a priori. I’ve attached a macro that demonstrates the problem.
I’m basically doing is
RooFormulaVar Nf(“Nf”, “@0/@1”, RooArgList(N, wgt));
RooExtendPdf pdfN(“pdfN”, “pdfN”, pdf, Nf);
if I fix the wgt to a number then things look good. But when wgt is a conditional observable then they turn out badly. Am I implementing this incorrectly? I’m pretty sure I could write down a likelihood on paper if really pressed so I don’t think it is fundamentally flawed.
Any ideas?
Jake
p.s. the output from my code that shows the problem is this
RooDataSet::gNData[x] = 1999 entries
RooDataSet::wgtGData[wgt,x] = 1999 entries
9995 weighted events from fit to data.
1999 raw events from fit to data.
11937 weighted events with conditional fit.
10003.6 sum of weights in data2.
2385.34 raw events from conditional fit.
1999 sum of weights/ in data2
condAndWgtFitterTest.cc.gz (685 Bytes)