Re: [ROOT] mergind ntuples

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Aug 09 2001 - 19:11:35 MEST


Hi Luiz,

Convert all your *.hbook to *.root files
  h2root file1.hbook file1.root
  h2root file2.hbook file2.root
.. etc

then merge the ROOT files into one single file with a TChain.

TChain chain("ntname"); //ntname being the ntuple name in each file
chain.Add("file1.root");
chain.Add("file2.root");
.. etc

you can also use the form chain.Add("fil*.root")

then do
  chain.Merge("all.root");

Rene Brun

Luiz Martins Mundim Filho wrote:
> 
> Hello
> 
> I got a little problem. I  have produced more than a 100 files
> containing 2 ntuples (hbook format), all of them makes more than 1
> GBytes and I want to merge them in smaller  number of files in root
> format. Is it possible to do that in a easy way? I tried to modify the
> example "hadd.C", but whem compiling it, I got the message:
> 
> hadd.C:101: no matching function for call to `TTree::Add (TTree *&)'
> 
> (I just change the TH1 to TTree).
> 
> Thanks.
> 
> Luiz



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:56 MET