You cannot do branch->Draw, only tree->Draw. In your case, the problem is simple
and the solution is
Long64_t npass = tree->Draw("number_of_jets","electron_pt>20 & muon_pt>30");
npass will contain the number of events passing your cuts.
the “htemp” histogram will contain the number of jets for all events passing the cuts
for more information, see the documentation of TTree::Draw
You have several possibilities for your Tree analysis:
1- make your own event loop. see example in $ROOTSYS/tutorials/tree/tree4.C
Look at the function tree4r of this example and its event loop.
You call branch->GetEntry for the branch(es) with which you can take quick decisions.
You read all branches for the events passing all conditions.
2- create a selector. see $ROOTSYS/tutorials/tree/h1analysis.C.
This is our recommended procedure because you can run a large analysis
with the parallel system PROOF later on.
Have a look at the member function Process to see a similar selection
mechanism as in 1.
3- create a TEntryList with all events passing your cuts, then in subsequent sessions
loop on the entry list. see examples in