How to open a non-root file

Dear experts,

I got the information from the link root.cern.ch/root/html/TFile.html#Open that TFile::Open could also open non-root format file, see:

" TFile and its remote access plugins can also be used to open any
file, i.e. also non ROOT files, using:
file.tar?filetype=raw
This is convenient because the many remote file access plugins allow
easy access to/from the many different mass storage systems. "

Then I tried:

root [4] TFile * f = TFile::Open("dcap://lcg-lrz-dcache.grid.lrz-muenchen.de:22125/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasscratchdisk/user.schieck/user.schieck.Iter00_Accumulate_outDS_Customed_Part00_20101028174920.101028175429_sub011558368/user.schieck.003227.EXT2._00001.vector.bin")
Error in <TDCacheFile::Init>: dcap://lcg-lrz-dcache.grid.lrz-muenchen.de:22125/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasscratchdisk/user.schieck/user.schieck.Iter00_Accumulate_outDS_Customed_Part00_20101028174920.101028175429_sub011558368/user.schieck.003227.EXT2._00001.vector.bin not a ROOT file

and:

root [5] TFile * f = TFile::Open("dcap://lcg-lrz-dcache.grid.lrz-muenchen.de:22125/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasscratchdisk/user.schieck/user.schieck.Iter00_Accumulate_outDS_Customed_Part00_20101028174920.101028175429_sub011558368/user.schieck.003227.EXT2._00001.vector.bin","file.tar?filetype=bin")
Error in <TDCacheFile::Init>: dcap://lcg-lrz-dcache.grid.lrz-muenchen.de:22125/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasscratchdisk/user.schieck/user.schieck.Iter00_Accumulate_outDS_Customed_Part00_20101028174920.101028175429_sub011558368/user.schieck.003227.EXT2._00001.vector.bin not a ROOT file

If TFile::Open method can really open non-root file, how to correctly use it ?

Thanks!
Jike

Hi,

use:

"dcap://lcg-lrz-dcache.grid.lrz-muenchen.de:22125/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasscratchdisk/user.schieck/user.schieck.Iter00_Accumulate_outDS_Customed_Part00_20101028174920.101028175429_sub011558368/user.schieck.003227.EXT2._00001.vector.bin?filetype=raw"

as file name.

Cheers, Fons.

[quote=“rdm”]Hi,

use:

"dcap://lcg-lrz-dcache.grid.lrz-muenchen.de:22125/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasscratchdisk/user.schieck/user.schieck.Iter00_Accumulate_outDS_Customed_Part00_20101028174920.101028175429_sub011558368/user.schieck.003227.EXT2._00001.vector.bin?filetype=raw"

as file name.

Cheers, Fons.[/quote]

Dear Fons,
Thanks, it is opened ! I can correctly get the handler of this file. But now the problem is how to retrieve the informations in this file ? Actually there are some double numbers stored in this binary file. Normally, I use std::ifstream to open a binary file and use the std::ifstream::read() function to read out the data.
I don’t know how to retrieve the information through a TFile pointer which points to a binary file.
Cheers,
Jike

Use TFile::ReadBuffer() and TFile::Seek() calls to read the raw data and then interpret them the way you like.

Cheers, Fons.

[quote=“rdm”]Use TFile::ReadBuffer() and TFile::Seek() calls to read the raw data and then interpret them the way you like.

Cheers, Fons.[/quote]

Hi Fons,

Trying and then let you know. Thanks!
Jike