Re: [ROOT] writing a subselection of a tree

From: Shuwei Ye (Shuwei.Ye@cern.ch)
Date: Fri Sep 15 2000 - 08:49:20 MEST


Hi, Matthieu,

   I think there are two simple ways to do it:

    1) TNtuple *my_newTNtuple = my_TNtuple->CopyTree("x>0");
       my_newTNtuple->SetName("my_newTNtuple");

    2) TNtuple *my_newTNtuple = my_TNtuple->CloneTree(0);
       my_newTNtuple->CopyEntries(my_TNtuple);

   The functions CopyTree, CloneTree, CopyEntries are the member functions
of class TTee from which TNtuple is derived.

   Regards  --Shuwei




On Thu, 14 Sep 2000, Matthieu Guillo wrote:

> Hi,
> 
> I have a Ntuple (TNtuple object)  and I would like to write a
> subselection of it, using a TCut, into another TNtuple object.
> Say in my TNtuple "myNtuple", I have a variable x, and I would like to
> save entries of "myNTuple" that have x > 3   into a new TNtuple
> "my_newTNtuple".
> 
> Does anybody knows how to do that?
> 
> Thanks
> 
> --
> Matthieu Guillo
> Thomas Jefferson National Laboratory
> Office 71 trailer 16
> Phone: 757-269-5551
> 
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:32 MET