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?


BKGDFit.C (2.08 KB)