Example of script showing how to navigate in a ROOT file with sub-directories and read the objects in each sub-directory.
This example uses the file produced by the tutorial importCode.C
while ((key = (
TKey*)next())) {
continue;
}
}
}
printf(
"File code.root does not exist. Run tutorial importCode.C first\n");
return;
}
printf(
"Reading file ==> code.root\n");
printf(
"File size in bytes = %lld\n",
f->GetEND());
printf(
"File compression factor = %g\n",
f->GetCompressionFactor());
printf(
"Number of cxx,c,cc files = %d\n",nc);
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Describe directory structure in memory.
virtual Bool_t cd()
Change current directory to "this" directory.
virtual TList * GetListOfKeys() const
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Bool_t IsFolder() const override
Check if object referenced by the key is a folder.
virtual TObject * ReadObj()
To read a TObject* from the file.
Class supporting a collection of lines with C++ code.
const char * GetName() const override
Returns name of object.
- Author
- Rene Brun
Definition in file readCode.C.