I’m trying to use the instructions given in the how-to with Version 4.02/00 but I get problems:
if I check the existence of the file with rfdir it’s ok:
-rw-r–r-- 1 santocch cms 110252966 Apr 16 04:33 cmsgridse.pg.infn.it:/data04/users/santocch/analisi/2005.02.25-KtJet_full_Reco/ttH/myMiniDST_2.root
but when I try to acced from root using:
TFile *f1 = new TFile(chainFileName);
if (f1->IsZombie()) cout << "Error opening file " << chainFileName << endl;
SysError in TFile::TFile: file rfio:cmsgridse.pg.infn.it:/data04/users/santocch/analisi/2005.02.25-KtJet_full_Reco/ttH/myMiniDST_2.root can not be opened for reading (No such file or directory)
If I use as explained in the how-to:
TFile *f1 = TFile::Open(chainFileName);
it’s ok if the file is there but if the file is missing (example myMiniDST_1.root doesn’t exist and I check on it) I get when I use the IsZombie() method:
*** Break *** segmentation violation
Generating stack trace…
0x4151aef8 in from /lib/libc.so.6
0x4150a1c4 in __libc_start_main + 0x90 from /lib/libc.so.6
0x080497e1 in TFile::TFile[in-charge](char const*, char const*, char const*, int) + 0x35 from ./myDSTanal
Abort (core dumped)
Using directly the TFile constructor tries to open the file locally and it fails; using the TRFIOFile constructor should work, i.e.
TFile *f1 = new TRFIOFile(chainFileName);
This is actually what TFile::Open does.
If the file is in Zombie state TFile::Open deletes the object and returns 0, so, after TFile::Open, you should actually test if (f1 != 0) instead of f1->IsZombie(). Unfortunately this is not mentioned in the HOWTO, which needs to be updated (it is in the HTML doc for TFile::Open).