Problem using RooFormulaVar as weight for un-binned fit

I am attempting to use a RooFormulaVar as a weight in a fitting macro that is meant to do an un-binned fit.

With the same macro it works fine if I modify it such that an individual RooRealVar is used as the weight but not when I use the RooFormulaVar.

Is this supported or am I doing something incorrect?

Thanks,

Joshua
BKGDFit.C (2.08 KB)