Re: [ROOT] ntuple selection

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Jun 22 2002 - 16:07:51 MEST


Hi Yupeng,

As indicated in the THbookFile documentation, this object supports
only read mode. You cannot fill a THbookTree object.
We have no plans to support write mode in a short/medium term.
If you need to copy a THbookTree, use the h2root conversion.

Rene Brun

On Sat, 22 Jun 2002, Yupeng Xu wrote:

> 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