[ROOT] Merging ntuples

From: Andrea Fontana (Andrea.Fontana@pv.infn.it)
Date: Mon Oct 22 2001 - 11:31:16 MEST


Dear ROOTers,
   we have two files, each containing two ntuples (named hits and vertex).
We want to merge them into a single file that will still contain two 
ntuples (that are the sum of the original two).
We are trying with this code (following the instructions of the reference
guide):

  TChain *fChain=new TChain("fChain");

  fChain->Add("/data/ntp/AT-Run3924.ntp/hits");
  fChain->Add("/data/ntp/AT-Run3933.ntp/hits");
  fChain->Add("/data/ntp/AT-Run3924.ntp/vertex");
  fChain->Add("/data/ntp/AT-Run3933.ntp/vertex");

  fChain->Merge("temp.ntp");

but we have the following error message:

Error in <TFile::TFile>: file /data/ntp/AT-Run3924.ntp/hits does not exist
Error in <TFile::TFile>: file /data/ntp/AT-Run3933.ntp/hits does not exist
Error in <TFile::TFile>: file /data/ntp/AT-Run3924.ntp/vertex does not exist
Error in <TFile::TFile>: file /data/ntp/AT-Run3933.ntp/vertex does not exist

We are sure that both files and ntuples exist as we can browse them with 
a TBrowser. It looks like ROOT looks for a file called
/data/ntp/AT-Run3924.ntp/hits and not for an ntuple called hits within the
file. What do we do wrong?

Many thanks and regards,
Andrea Fontana & Germano Bonomi



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