Re: [ROOT] Problem in merging root files

From: Rene Brun (brun@pcbrun.cern.ch)
Date: Tue Aug 10 2004 - 14:30:22 MEST


You arrays namefile_os, endfile_os, etc are not correctly dimensionned.
Check that the string passed to TChain::add is correct.

Rene Brun

On 
Tue, 10 Aug 2004, Manoj Jha wrote:

> Dear Rooters,
>   I am trying to merge different numbers of root files using the "Tchain->Add" method. I am using the following script
> 
> -------------------------------------------------------------------------
> TChain * chain = new TChain("EGAMMA");
> for (Int_t ifil_os = 1; ifil_os < 20; ifil_os++) {
> 
>   Char_t namefile_os[16];
>   strcpy (namefile_os, "egamma_60_875Events_");
>   Char_t numfile_os[4];
>   sprintf (numfile_os,"%d",ifil_os+1);
>   Char_t endfile_os[6];
>   strcpy (endfile_os, ".root");
>   // strncat (namefile, numfile, endfile);
>   TString mystring_os = "/home/jha/work/shaping/original_geometry/root
> _file/60_GeV/";
>   chain->Add(mystring_os+namefile_os+numfile_os+endfile_os);
> }
> -----------------------------------------------------------------------
> 
> When I run the script, I faced with the following error
> 
> "Error in <TFile::TFile>: file /home/jha/work/shaping/original_geometry/root_file/60_GeV/egamma_60_875Events_2.root does not exist
> Error in <TFile::TFile>: file /home/jha/work/shaping/original_geometry/root_file/60_GeV/egamma_60_875Events_2.root does not exist
> Error in <TFile::TFile>: file /home/jha/work/shaping/original_geometry/root_file/60_GeV/egamma_60_875Events_2.root does not exist
>                                ..
>                                ..
> "
>  and the program is still running with the above message.
> 
> However, the above file exists in the mentioned folder. I am able to browse the contents of the above root file using TBrowser. Please let me know where I am committing the mistakes.
> 
> Thanks for help.
> 
> With regards,
> manoj jha
> 
> 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET