How can I get the tree information after some cuts?

Hi,Root experts
I have one question.
How can I get the tree information after applying some cuts on a variable?
I use the code as follows to get the tree information.

void readtree() 
{
  TFile *f1 = new TFile("W2MuNuMc.root");
  TTree *myTree1 =(TTree*)f1->Get("DecayTreeTuple/DecayTree");
  myTree1->Draw("muminus_PT","abs(muminus_MC_MOTHER_ID)==24");
 
  TFile *f2 = new TFile("W2MuNuMc.root");
  TTree *myTree2 =(TTree*)f2->Get("DecayTreeTuple/DecayTree");
 
  myTree2->Draw("muminus_PT","","same");
 
  Float_t muminus_PT1;
  myTree1->SetBranchAddress("muminus_PT",&muminus_PT1);
  Float_t muminus_PT2;
  myTree2->SetBranchAddress("muminus_PT",&muminus_PT2);
 
  Int_t nevent1=(Int_t)myTree1->GetEntries();
  cout<<"Entry1 before cut is "<<nevent1<<endl;
  Int_t nevent2=(Int_t)myTree2->GetEntries();
  cout<<"Entry2 after cut is "<<nevent2<<endl;
  for(Int_t i=0;i<10;i++)
    {
      cout<<myTree1->GetEntry(i)<<" "<<endl;
      cout<<myTree2->GetEntry(i)<<" "<<endl;
      cout<<"pt1 is "<<muminus_PT1<<" "<<endl;
      cout<<"pt2 is "<<muminus_PT2<<" "<<endl;
    } 
  return;  
}

For example,I would like to get the pt information after applying the cut "abs(muminus_MC_MOTHER_ID)==24"
But the information I get from muminus_PT1 is as the same as the muminus_PT2. For muminus_PT2, there is no requirement on the track.
Could sb. give me some suggestions on this question?
Thanks in advance.

Hi,

You need to use a TEntryList.

Cheers,
Philippe.