Hello ROOTTalk
I would like to copy selected entries of some branches of TChain to another tree. So far my attempt work for single tree but not for a chain. Simplified logic looks like this:
type var1;
TBranch * b1=0;
chain->SetBranchAddress("var1", &var1, &b)
chain->SetBranchStatus("*", 0)
chain->SetBranchStatus("var1", 1);
f = TFile::Open("file.root", "UPDATE");
newTree = chain->CloneTree(0);
now have to enable all branches since they are needed for event selection
chain->SetBranchStatus("*", 0);
for(; ; )
if(selection_function())
newTree->Fill()
The trees are connected and when a new file is opened in chain things go wrong. I tried reseting the branch addresses, but it didn't work. Is there any way to get it working?
Thanks,
Margar
This archive was generated by hypermail 2.2.0 : Tue Apr 12 2011 - 17:50:01 CEST