TTree::CopyTree problem

From: Hajo Molegraaf <hjausenet_at_hotmail.com>
Date: Mon, 03 Apr 2006 18:56:29 +0200


Hi,
Sorry to bug you again, but I get errors with the following macro:

{

    TFile* f = new TFile("test.root","RECREATE");     TTree* tree = new TTree("tree","some tree");     double line;
    tree->Branch("line",&line,"line/D");     for( int i = 0; i < 10000; ++i )
    {

        line = i;
        tree->Fill();

    }
    tree->Write(); // *
    f->Close(); // *
    f = new TFile("test.root"); // *
    tree = (TTree*)(f->FindObjectAny("tree")); // *     TTree* tr = tree->CopyTree("");
}

Several times I get the message:
Error in <TTree::Fill>: Failed filling branch:tree.line, nbytes=-1

If I fill the tree with fewer points (say 1000), there is no problem. With more points the error shows more often.
If I delete the lines marked with // *, then there is no problem for any tree size.

I'm using root Version 5.11/01 3 March 2006 CINT/ROOT C/C++ Interpreter version 5.16.10, March 30, 2006

Thanks,
Hajo Molegraaf.



Speel online games via MSN Messenger
http://www1.imagine-msn.com/Messenger/Default2.aspx Received on Mon Apr 03 2006 - 18:56:41 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET