RE: [ROOT]

From: Philippe Canal (pcanal@fnal.gov)
Date: Tue Aug 10 2004 - 18:22:28 MEST


Hi,

You might not have read access to those files.
Also 
  Char_t namefile_os[16];
  strcpy (namefile_os, "egamma_60_875Events_");
is incorrect (16 is too small of a number).
Instead you should write something like
  TString prefix = /home/jha/work/shaping/original_geometry/root_file/60_GeV/";
  TString filename = prefix;
  filename += "egamma_60_875Events_";
  filename += ifil_os+1;
  filename += ".root";
  chain_>Add(filename);

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Manoj Jha
Sent: Tuesday, August 10, 2004 6:08 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT]


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