[ROOT] copy tree with cuts.

From: Avi Malki (malki@tauphy.tau.ac.il)
Date: Mon Sep 24 2001 - 21:11:35 MEST


 hi rooters,

 We would like to consider reducing the data and select events with some
 criteria such as 3 tracks (in event branch) and one negative particle (in
 tracks branch) for example.

 The program below create a new tree with number of tracks equal 3
 for example. The problem is that only 'event' is created the other
 Branches (they are under event branch): Neutron, Tracks and Bunch
 are filled with zeros for all variables.

 Can someone please give us advise how to overcome this problem?

     Best regards
       avi.

 {
  gROOT->Reset();

  gSystem->Load("/usr/local/root/test/libEvent.so");

  TFile f("../DATA/tf8826.root");
  TTree *T = (TTree*)f.Get("T");

  Event *event = new Event();

  T->SetBranchAddress("event",&event);

  TFile f2("New.root","recreate");
  TTree *T2 = T->CopyTree("Ntrack==3");

  T2->Write();
 }

 The problem:

 root [0]
 Processing tree_copy.c...
 Warning in <TBranchClones::Streamer>: Unknow class: Neutron. Cannot read BranchClones: fNeut
 Warning in <TBranchClones::Streamer>: Unknow class: Bunch. Cannot read BranchClones: fBn
 Warning in <TBranchClones::Streamer>: Unknow class: Neutron. Cannot read BranchClones: fNeut
 Warning in <TBranchClones::Streamer>: Unknow class: Bunch. Cannot read BranchClones: fBn
 root [1] .q



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