TProfiles in hbook files

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.

Could you post your hbook file?

Rene

You can find a copy in /afs/slac/u/ec/babarsvt/monitoring/occupancy/script/test.hbook.gz. It’s 3 MB big, so I couldn’t post it in the forum.

Regards.

                                            - Jordi.

Put your file in a public read area.
In addition I assume that the real path is “slac.stanford.edu” and not “slac”

Rene

Yes, sorry, it was slac.stanford.edu, and not slac.

Now you can find it in slac.stanford.edu/~babarsvt/test.hbook.gz

Regards,

Jordi

OK, thanks for the file. The problem is now understood and fixed in the SVN trunk.
With the old profile conversion algorithm the time was proportional to the number of entries in the profile. Now it takes about 1 second to convert your file.

Rene

OK, thank you.