Since ROOT 6.20.00 (IIRC), when constructing a RooDataSet from TTree with cuts like this:
RooDataSet dataset ("dataset", "dataset", tree, argset, cuts);
when not all variables from argset are mentioned in cuts, a warning "The formula ... claims to use the variables (...) but only (...) seem to be in use" is emitted.
I'm very pro-explicit warnings, however, in this case, the formula is used "behind the scenes" and the user has no control over which variables are given to the formula. I suggest you look into preventing this warning so it doesn't pollute logs and hide real problems.