maybe this is a very simple question but nevertheless I can’t find what I need. I have a TBrowser open with a number of root files. Each of these files contains several folders with a number of histograms. Is it possible within the TBrowser to find out the size of
the root-file in total
one of the folders
one of the histograms
?
If not, how else can I access that information. Ok, the root file size is easy - but the rest?
In the browser, you have access to context menus by clicking with the right mouse button, and then you can select “Inspect”, “Dump”, “Scan” (depending on the object). And in the new browser, the file size is indicated in the tooltip of the corresponding list tree item.
I already tried Inspect and Dump (I don’t see Scan) but I don’t see any useful information. I get a lot of parameters of the object (e.g. axis titles, number of bins etc.) but I don’t find a size. I attach the info for file / directory / histogram I get. Maybe you see more than me.
Well, if you need more infos about the objects in the file, you can do something like this (from the command line):
root [0] TFile *f = TFile::Open("fillrandom.root")
root [1] f->GetListOfKeys()->Dump()
==> Dumping object at: 0x034d3cc0, name=form1, class=TKey
fVersion 4 Key version identifier
fNbytes 224 Number of bytes for the object on file
fObjlen 169 Length of uncompressed object in bytes
fDatime ->34d3ce8 Date/Time of insertion in file
fDatime.fDatime 20100121/171246
fKeylen 55 Number of bytes for the key itself
fCycle 1 Cycle number
fSeekKey 226 Location of object on file
fSeekPdir 100 Location of parent directory on file
fClassName ->34d3d08 Object Class name
fClassName.*fData TFormula
fLeft 0 Number of bytes left in current segment
*fBuffer ->0
*fBufferRef ->0 Pointer to the TBuffer object
fPidOffset 0 ! Offset to be added to the pid index in this key/buffer. This is actually saved in the high bits of fSeekPdir
*fMotherDir ->359d118 ! pointer to mother directory
fName ->34d3ccc object identifier
fName.*fData form1
fTitle ->34d3cd4 object title
fTitle.*fData abs(sin(x)/x)
fUniqueID 2 object unique identifier
fBits 0x03000000 bit field status word
==> Dumping object at: 0x034d3d30, name=sqroot, class=TKey
fVersion 4 Key version identifier
fNbytes 282 Number of bytes for the object on file
fObjlen 458 Length of uncompressed object in bytes
fDatime ->34d3d58 Date/Time of insertion in file
fDatime.fDatime 20100121/171246
fKeylen 57 Number of bytes for the key itself
fCycle 1 Cycle number
fSeekKey 450 Location of object on file
fSeekPdir 100 Location of parent directory on file
fClassName ->34d3d78 Object Class name
fClassName.*fData TF1
fLeft 0 Number of bytes left in current segment
*fBuffer ->0
*fBufferRef ->0 Pointer to the TBuffer object
fPidOffset 0 ! Offset to be added to the pid index in this key/buffer. This is actually saved in the high bits of fSeekPdir
*fMotherDir ->359d118 ! pointer to mother directory
fName ->34d3d3c object identifier
fName.*fData sqroot
fTitle ->34d3d44 object title
fTitle.*fData x*gaus(0)+[3]*form1
fUniqueID 3 object unique identifier
fBits 0x03000000 bit field status word
==> Dumping object at: 0x034d3da0, name=h1f, class=TKey
fVersion 4 Key version identifier
fNbytes 944 Number of bytes for the object on file
fObjlen 2043 Length of uncompressed object in bytes
fDatime ->34d3dc8 Date/Time of insertion in file
fDatime.fDatime 20100121/171246
fKeylen 55 Number of bytes for the key itself
fCycle 1 Cycle number
fSeekKey 732 Location of object on file
fSeekPdir 100 Location of parent directory on file
fClassName ->34d3de8 Object Class name
fClassName.*fData TH1F
fLeft 0 Number of bytes left in current segment
*fBuffer ->0
*fBufferRef ->0 Pointer to the TBuffer object
fPidOffset 0 ! Offset to be added to the pid index in this key/buffer. This is actually saved in the high bits of fSeekPdir
*fMotherDir ->359d118 ! pointer to mother directory
fName ->34d3dac object identifier
fName.*fData h1f
fTitle ->34d3db4 object title
fTitle.*fData Test random numbers
fUniqueID 4 object unique identifier
fBits 0x03000000 bit field status word
What do you want to see exactly?
-the size of the compressed objects on disk
-the size of a complete folder including its contents (on disk)
-or the same but for expanded objects in memory.
Currently you can only get the size of the file. However, it would be straithforward to
provide the info for the objects on disk.
I want to see the first two points. I have a root file that is about 55 MB in size on disk. This contains folders of histograms. I want to know how much of the 55 MB are contained in a certain folder to find out the “big players”. Is there an easy way to do that?