CloneTree with TChain

From: Sean Kelly (kelly@charm.physics.ucla.edu)
Date: Mon Jul 12 1999 - 20:28:48 MEST


Hi Rooters,

I am having difficulty using the CloneTree method with a TChain object.

The first of the 2 frags below generates a seg violation the second
behaves as expected and copies 1 event from the tree e896mdst to the file
newtree.root.  Thanks for any help.

Sean



{ 
TChain *e896mdst = new TChain("e896mdst");
e896mdst->Add("/usr/e896disk1/e896/ana/tree/run3071a.root");

// appropriate leave var. defs. and SetBranchAddress calls

TFile *file = new TFile("newtree.root","RECREATE");
TTree * = e896mdst->CloneTree(1);	
file->Write();
file->Close();
}


{
f = new TFile("/usr/e896disk1/e896/ana/tree/run3075b.root");
TTree *e896mdst = (TTree*)gDirectory->Get("e896mdst");
 
// appropriate leave var. defs. and SetBranchAddress calls .. 

TFile *file = new TFile("newtree.root","RECREATE");
TTree * = e896mdst->CloneTree(1);
file->Write();
file->Close();
}







_____________________________________________

Sean Kelly
Dept. of Physics
University of California Los Angeles
office tel. (310)-825-6035
fax (310)-206-4397 
voice mail (310)-259-3747
_____________________________________________



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:35 MET