Re: [ROOT] ROOT data format

From: Rene Brun (
Date: Thu Jun 07 2001 - 12:31:56 MEST

Hi Shaun,

This is certainly possible if you have some time to spend on the problem.
Recently Tony Johnson has been able to read the Root files from
his Java based application. See his recent posting at:
you can also have look at the following presentation by Tony at the recent
HEPVIS workshop:

There are two issues here:
  - find the location of a particular object in a Root file.
  - Rebuild the object in memory

The first operation is not too complex (unless the Root file has
multiple levels of sub-directories.
The second operation can be realized by using the StreamerInfo record
written at the end of the file and describing all the classes in the file.

You can get an idea of the file format by taking a small Root file and
  TFile f("file.root")
  f.Map(); //will show all the records on a file
  f.ShowStreamerInfo(); //will show all the classes in the file

The Root classes to be emulated are
  TFile, TKey, TBuffer, TStreamerInfo, TStreamerElement

Now, this may be only the top of the iceberg.
If the Root file contains only simple objects, the operation will not
be too complex. However, if the Root file contains more complex objects
like Trees, you have to understand more classes (TTree, TBranchxxx, TLeafxxx)
managing the internals of a Tree.

This procedure will be described one day. We have other priorities
for the time being.

I am curious to know in which context you will like to implement your own

Rene Brun

shaun roe wrote:
> Is there some way of reading ROOT data files into a non-ROOT program,
> without linking to ROOT at all?
> another way of asking this: whats the data file format, in terms of its
> byte structure?
> cheers
> shaun

This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:49 MET