[ROOT] ntuple selection

From: Yupeng Xu (Yupeng.Xu@cern.ch)
Date: Sat Jun 22 2002 - 12:08:26 MEST


Hello ROOTers,

I am trying to copy a fraction of the events in a ntuple file(HBOOK
format) into a new tree.

my program looks like this:

   THbookTree oldTree = new THbookFile("input.ntpl",4096);
   TTree *newTree = oldTree->CloneTree(0);
   Int_t nentries = oldTree->GetEntries();
   for (Int_t i=0;i<nentries;i++) { 
      oldTree->GetEvent(i);
      newTree->Fill();
   }

This dosn't work. If I convert the input.ntpl to input.root by h2root and
replace the first line to
   TTree oldTree = new TFile("input.root");
then it works fine.

But I don't want to convert all my ntpl file to root format. ...


Thanks in advance.
Yupeng Xu



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:57 MET