You can create in RooFiit a new function z= x -y using for example RooFormulaVar (your second case), but the mapping to the Three will be always to x and y. z cannot be a RooRealVar and your RooFiit DataSet will contain x and y. Otherwise it is easy to loop on the tree and create a new RooDataSet containing z.
I can send you an example for this if you want
Ah okay. Yes, an example might speed along my scripting, thanks.
I should say I also tried importing a RooDataSet with x and y from the TTree, using the RooFormulaVarDm for my model, but ran into problem in C++; program state has been reset when I tried to fit it.