Reading file from castor

Hi,

I am having some weird issues accessing files located on castor, to summarize: TFile is unable to access remote file while TChain is able to.

I have tried this with ROOT 5.28/00e and ROOT 5.30/00.

root [0] TFile* file1 = new TFile(“root://castoratlas//castor/cern.ch/grid/atlas/tzero/prod1/perm/data12_8TeV/express_express/00203719/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146._0001.1”);
Error in TFile::TFile: file /castor/cern.ch/grid/atlas/tzero/prod1/perm/data12_8TeV/express_express/00203719/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146._0001.1 does not exist

However when I try to access with TChain it appears to work:

root [0] TChain* ch = new TChain(“trigger”);
root [1] ch->Add(“root://castoratlas//castor/cern.ch/grid/atlas/tzero/prod1/perm/data12_8TeV/express_express/00203719/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146._0001.1”);
root [2] cout << ch->GetEntries() << endl;
Warning in TClass::TClass: no dictionary for class pair<string,string> is available
176

As well we can see the file:

nsls /castor/cern.ch/grid/atlas/tzero/prod1/perm/data12_8TeV/express_express/00203719/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146._0001.1
/castor/cern.ch/grid/atlas/tzero/prod1/perm/data12_8TeV/express_express/00203719/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146/data12_8TeV.00203719.express_express.merge.NTUP_TRIG.x203_m1146._0001.1

Once again to summarize: TFile is unable to access remote file while TChain is able to. Could I please receive some help resolving this.

Thanks,

Peter

Hi,

please open the file using:

TFile *f = TFile::Open("“root://castoratlas//castor/cern.ch/grid/atlas/tzero/prod1/perm/data12_8TeV/express_express/00203719/data12_8TeVxxxxx.root”)

the static method TFile::Open() will load and use the proper TRFIOFile plugin needed for Castor file access. Using new TFile will create a local TFile that will try to open a local file named “root://…”. TChain internally uses TFile::Open().

Cheers, Fons.