Draw a variable of one tree with condition on another tree?

i have a ROOT file which contains two TTrees tA and tB (these TTrees are filled from the same events). I want to plot some variables of the tA with conditions on tB branchs
For instance,
TTree tA = (TTree)f->Get(“tA”);
TTree tB = (TTree)f->Get(“tB”);
and then draw a variable of tA (let’s say tA->pt), with a condition on a variable of tB, like e.g. the number of particles tB->n_Particles),
is there some simple way to do this by using the method Draw, i.e. do something like
tA->Draw(“pt”,“tb->n_Particles == 0”);
many thanks.

Declare tB as a friend of tA. See documentation