RooDataSet doesn't compile TCut

Dear all,

I want to import data from a TTree, applying a simple cut on a variable:

RooDataSet *data = new RooDataSet("data","data", tree, mass, "proton_p_costheta>0");

but I get the following error

[#0] ERROR:Eval -- RooFormula::eval(proton_p_costheta>0): Formula doesn't compile: proton_p_costheta>0

The variable do exist and the syntax seems to be correct.
Instead, when a cut is applied to the imported variable itself no error is given.

Should I import every variable in which I want to make a cut?
For reference: I’m using:
ROOT 5.29/01 (trunk@38109, Feb 17 2011, 14:12:40 on linuxx8664gcc)

thanks in advance,

Francesco

Hi, I am also new to RooFit. But I think you need to import both mass and costheta into tree.

Thanks.
I know it works if you do so, but I was wandering if there was the possibility not to do so.
In fact when applying complicated cuts it is not handy to import tens of variables just to select a dataset for one of them.

cheers,

Francesco