Re: [ROOT] Filtering events from a Tree

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Aug 22 2001 - 22:55:25 MEST


Hi Joao,

Use TTree::CopyTree. Example
   TFile *f1 = new TFile("hsimple.root");
   TTree *ntuple = (TTree*) f1->Get("ntuple");
   TFile *f2 = new TFile("small.root","recreate");
   TTree *small = ntuple->CopyTree("py>2");

Rene Brun

On Wed, 22 Aug 2001, Joao Guimaraes da Costa wrote:

> Hi,
> 
> I would like to know what is the easiest way to accomplish the following.
> 
> I have a large tree with many entries which takes a long time to 
> process. I would like to select events that pass specific cuts and
> write them into a different tree, in a different file, with EXACTLY the 
> same structure as the first.
> 
> Unfortunately, it seems that TTree does not have a "Filter" method.
> 
> Is there an easy way of doing this?
> 
> Thank,
> 	-Joao
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:58 MET