Table of Contents
The Histogram Template Library (HTL) is a C++ class library that provides powerful histogramming functionality. As the name suggests, it exploits the template facility of C++ and is designed to be compact, extensible, modular and performant. As such it only deals with histograms - i.e. binned data - and not unbinned or "Ntuple" data. Furthermore, although simple file-based I/O and "lineprinter" output are supported, it is decoupled from more advanced I/O and visualisation techniques. In the context of LHC++, such capabilities are provided by other components that fully interoperate with HTL.
In the High Energy Physics (HEP) community, the HBOOK package has been the de-facto standard for histogramming for many years. This manual is written assuming a basic familiarity with HBOOK (see Table Table 1.1.).
Table 1.1. HBOOK routines and their HTL equivalent
| HBOOK name | HTL equivalent |
| HBOOK1 | Histo1D |
| HBOOK2 | Histo2D |
| HFILL | fill method |
| HPRINT | print method |
HTL itself offers the histogramming features of HBOOK as well as a number of useful extensions, with an object-oriented (O-O) approach. These features include the following:
This package replaces the histOOgrams package - an earlier C++ class library for histograms. The major functional innovation over the previous package are the support for different kinds of bins, the support of both persistent and transient (i.e. in-memory) histograms at runtime and the definition of an abstract histogram interface.
As a result, it is now possible to work with transient histograms and subsequently save some or all of them in a database as persistent histograms in a very simple and natural way (thus simulating so called explicit I/O). This clearly has significant performance advantages, particularly in the area of filling operations.
It is also possible to work with transient histograms only. These may be printed or stored in files - the latter using a simple ASCII table format that can be readily used by widely available tools, including PAW or Excel.
The definition of an abstract histogram interface allows functionality that is provided by external packages, such as plotting or fitting, to be decoupled from the actual implementation of the histogram. This feature paves the way for co-existence of different histogram packages that conform to the abstract interface.