Hi all,
I'm trying to get objects from an hbook file from root. That is the code I use to get a particular object in the hbook file (when I link my program I load the Hbook library, libHbook.so).
THbookFile pawFile( “fileName.hbook” );
pawFile.cd( “//lun10/SVTFASTMONCHAN” );
TProfile* occupancy = (TProfile*) pawFile.Get( 201 );
It turns out the object with number 201 is a TProfile, and it takes 11 minutes to extract it from the file. I can use paw instead with the following strategy:
* Open the hbook file and get the object I want.
* Put the elements of the histogram into a vector.
* Create a histogram with this vector, which will be a TH1F in root.
* Save this new histogram into a new paw file.
* Access this new paw file in root with similar lines of code to get the TH1F.
This works and is a lot faster, but has the disadvantage I have to use paw to make it work.
Does anyone know the way to read correctly the histogram in root and in a reasonable time? Should be 1 to 5 seconds, once the new hbook file has been created.
Regards,
- Jordi.