How to get same number entries from two trees

Dear ROOT Developers,
I have a simple question, for example I have two trees, T1 and T2, two cuts CUT1 and CUT2, two TH1F h1 and h2, Number Of entries Number1 and Number2.

T1->Draw(VAR1>>h1,CUT1)
Number1=h1->GetEntries();
T2->Draw(VAR2>>h2,CUT2)
Number2=h2->GetEntries();

How can I make sure Number1==Number2? Right now I have to loop over T1 and T2 to fill h1 and h2.

Thanks a lot.

simply lok at the result of TTree::Draw. No need to fill a histogram

Rene

[quote=“brun”]simply lok at the result of TTree::Draw. No need to fill a histogram

Rene[/quote]

The result is Number1!=Number2
But I want to Number1==Number2.

We cannot answer a very vague question like yours without a simple RUNNING script showing your point. You must make a mistake somewhere.

Rene