RE: [ROOT] copying chains

From: Philippe Canal (pcanal@fnal.gov)
Date: Mon Aug 04 2003 - 22:04:43 MEST


Hi Thomas,

TTree::CloneTree is not working properly in ROOT 3.05/07 when the object is
a TChain.
A fix will be uploaded shortly in the CVS repository.

You have 2 possible work-arounds.  You can use the TChain::Merge method or
you can call
oldtree->GetEntries() before calling TTree::CloneTree.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Thomas Hadig
Sent: Thursday, July 31, 2003 3:59 PM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] copying chains


Hi all,

I just tried to copy a tree from a chain of files into a single file.
I used the code
  TTree *newtree = oldtree->CloneTree();
in
http://root.cern.ch/root/html/examples/copytree.C.html
with ROOT Version 3.05/02 on Linux (RedHat 7.3).

Using one file or a chain with one file seems to work fine but
for a chain of more than one file, the writing never ends.

Using the method in
http://root.cern.ch/root/html/examples/copytree2.C.html
with
  TTree *newtree = oldtree->CloneTree(0);
  newtree->CopyEntries(oldtree);
seems to work for all cases.

I also noticed that the number of entries in an
  oldtree->ls()
seems to be wrong for the second (and all following) files:
inter_file_date20030728_time120505.root tree:main_scan entries=571
inter_file_date20030728_time174104.root tree:main_scan entries=1234567890
inter_file_date20030728_time192411.root tree:main_scan entries=1234567890
....

If CloneTree uses this number, I am no longer astonished that the
copying never ends ....

I did find some bug fixes mentioned in the release notes but I don't think
that any of those mentioned this problem specifically.

Ciao
Thomas

----------------------------------------------------------------------------
Thomas Hadig            MS 62, 2575 Sand Hill Road, Menlo Park CA 94025, USA
       hadig@stanford.edu                              Tel.: +1 650 926 2810
       http://www.slac.stanford.edu/~hadig/
----------------------------------------------------------------------------
    In a world without walls and fences, who needs windows and gates ?
----------------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET