RE: TChain -> Merge()

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Mon, 21 Feb 2005 12:50:59 -0600


Hi,

Using your file and ROOT 4.02/00, from
/afs/cern.ch/sw/root/v4.02.00/rh73_slc3
a d I can reproduce that  

   m_The_Chain->Merge("Merge_Test_All.root");

Generate a file much large. This is due to the fact that in this case, the file is recreate by merge with the default compression level (1) which does not work nearly as well on your files as the one use you used (9).

So you would be using:

   m_The_Chain->Merge(FileToWriteFinal,1001,"C"); which works perfectly for me.

To understand the reason of the crah you are seeing, you might want to run in the debugger and see what the stack trace is.

Cheers,
Philippe.

-----Original Message-----
From: Giovanni Franzoni [mailto:franzoni_at_mail.cern.ch] Sent: Friday, February 18, 2005 5:34 PM
To: Philippe Canal
Cc: 'roottalk'
Subject: RE: [ROOT] TChain -> Merge()

On Fri, 18 Feb 2005, Philippe Canal wrote:

> Hi,
>
> Can you provide me with a way to reproduce this problem?
>
> Philippe.
>

Hi Philippe, thanks for your reply.
Sure I can.

Here:
/afs/cern.ch/user/f/franzoni/public/Root_Merge you find:

Merge_test_1.root
Merge_test_2.root
Merge_test_3.root which 

which are used as sample files to be merged into Merge_Test_All.root.

/afs/cern.ch/user/f/franzoni/public/Root_Merge/try_Merge.C (which I report here after)
is the little macro that should merge the three trees. v4.02.00/rh73_gcc296/

                Thanks and good evening, Giovanni

/afs/cern.ch/user/f/franzoni/public/Root_Merge/try_Merge.C: {

TFile * FileToWriteFinal = new TFile("Merge_Test_All.root","RECREATE");

TChain* m_The_Chain = new TChain("T1"); m_The_Chain -> Add("Merge_test_*.root"); m_The_Chain->Print();

FileToWriteFinal         -> cd();
FileToWriteFinal         -> SetCompressionLevel(9);

//m_The_Chain->Merge(FileToWriteFinal,1001,"C"); m_The_Chain->Merge("Merge_Test_All.root");

}

> -----Original Message-----
> From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch]
> On Behalf Of Giovanni Franzoni
> Sent: Friday, February 18, 2005 10:40 AM
> To: roottalk
> Subject: [ROOT] TChain -> Merge()
>
> Hi Rooters,
>
> I am trying to merge trees of the same kind which sit in different
> (smaller) files into one.
>
> Sorry, I know this issue has already been proposed in the past but I was
> not able to find the reply to noeding (<merging root files>, Fri May 28,
> 2004 14:04).
>
> I use a TChain and:
>
> m_The_Chain->Merge(FileToWriteFinal,100000,"C");
>
> crashes, while
>
> m_The_Chain->Merge("AllTheTrees.root");
>
> gives me a final file whose size is roughly one hundred times bigger than
> the sum of the initial smaller files.
> I have tried both with uncompressed and compressed (level 9 files).
> I tried with several releases, for instance v4.02.00/rh73_gcc296/.
>
> What am I doing wrong?
>
> Thanks, regards, Giovanni
>
>

-- 
Received on Mon Feb 21 2005 - 19:53:14 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET