HBookFile


HBookFile - handles initializing hbook and creating HBookTuple objects.

HBookFile is a C++ wrapper which manages a collection of HBookTuples that will be written to one file.

HBOOK identifies objects by id numbers, not by title strings. This can lead to confusion, as the standard HBookTuple/ HBookHistogram classes index on the title string. HBookFile will manage this correctly so long as the HBookHistogram and HBookTuple constructors are not used directly.

The code assumes that FORTRAN is callable from C by the (mostly) standard BSD convention: all lowercase symbol names with an "_" appended.

Storage for HBOOK is initialized in the routine hbfinit.f. You will need to override this routine if you need more space.

Authors

Paul Rensing, modified by Bob Jacobsen for Histos and numbering.

See also

HepTuple, HepTupleManager, HepHistogram, HBookTuple, HBookHistogram.

Declaration

#include "CLHEP/Hist/HBookFile.h"

class HBookFile : public HepTupleManager

Public Member Functions

Constructor
HBookFile(const char *filename, int lun)
Create the tuple file with the given FORTRAN lun.
Destructor
virtual ~HBookFile()
clearAllData
virtual void clearAllData()
Call clearData() for all tuples in the list.
dumpAllData
virtual void dumpAllData()
Call dumpData() for all tuples in the list.
filename
HepString filename()
Return the filename.
histogram
virtual HepHistogram * histogram(const char *pl_title, int nBins, float low, float high)
Using pl_title as a key, find the plot with the given title. If it is not found, create a new plot with the given title, and return that.

virtual HepHistogram * histogram(const char *pl_title, int nBins, float low, float high, int id)
This routine is the same as above, except the HBook ID of the plot is specified by the user.

virtual HepHistogram *histogram(const char *pl_title, int nBinsX, float lowX, float highX, int nBinsY, float lowY, float highY)
Similar to the first routine but is used for 2D histograms.

virtual HepHistogram * histogram(const char *pl_title, int nBinsX, float lowX, float highX, int nBinsY, float lowY, float highY, int id)
Similar to the second routine but is used for 2D histograms.
lun
int lun()
Return the FORTRAN lun being used
ntuple
virtual HepTuple * ntuple(const char *nt_title)
Using nt_title as a key, find the tuple with the given title. If it is not found, create a new tuple with the given title, and return that.

virtual HepTuple * ntuple(const char *nt_title, int id)
This routine is the same as above, except the HBook ID of the ntuple is specified by the user.
write
virtual int write()
Write the managed HBookTuples to the file.


10 October 1997
EVC