Table of Contents
Interfaces are a powerful OO concept which allows designers to decouple what an object does from its actual implementation. This reduces the impact on "external" software using such object(s) and makes software reuse more realistic.
In the C++ world, interfaces are usually implemented by abstract classes with virtual methods. In this context the only drawback of interfaces might be a performance penalty due to the extra indirection required by virtual functions, but we should not neglect the usefulness of interfaces just because of that.
HTL defines and implements abstract interfaces for most of its functionalities. The only method which is not available on purpose at the interface level is the fill() method, which must be implemented as an non-virtual inline method to provide the highest performance (see Appendix Appendix C. for details).
HTL interfaces are used by other packages such as fitting (HEPFitting) and visualisation (HEPInventor) that are thus independent from the actual HTL implementation of histograms. Interfaces are what allows external packages to deal with transient and persistent HTL histograms at the same time. Using such interfaces we might even implement an HTL-like package based on other technologies, for instance an HTL interface to HBOOK, although this is not envisaged at present.
I_Histo is the high-level interface to histograms. The following is a list of supported methods.
Title attached to current histogram.
In-range bin associated with location a_location.
Extra bin associated with extra location a_location.
Number of in-range bins.
Number of extra bins.
Dimension of the histo, i.e., of the problem space.
Partition interface associated with this histo. For the first partition one has a_dim_index = 0.
Any bin (in-range or extra) with index "i" (note that this is a linear access).
The I_Histo interface can retrieve the number of bins that are in-range or out-range, for instance, overflow or underflow, as well as the number of partitions (i.e. the dimensionality of the histogram). It also allows you to access other interfaces such as I_Partition and I_Bin.
On the other hand, the I_Histo interface does not try to provide all information in a single interface: details about binning and bin content are delegated, respectively, to the I_Partition and I_Bin interfaces, as explained later.
The I_partition interface deals with binning details, such as, which interval of the problem space a bin is mapped to, that is where does it start and end, and what are the limits of the range spanned by the partition. The following is a list of supported methods.
End point convention for all bins; can be either RIGHT_OPEN or LEFT_OPEN.
Width of in-range bin "i".
Leftmost point of the partition.
Leftmost point of bin indexed by "i".
Rightmost point of the partition.
R`ightmost point of bin indexed by "i".
The I_Bin interface allows you to set or get the content of a bin, its count information, and its error. The available methods are listed below.
Value associated with this bin.
Error associated with this bin.
Count associated with this bin. = Number of entries.
Set the value associated with this bin to "other".
Change/set the error of the bin to "other".
Change/set the count of the bin to "other".
Absolute or relative center of this bin on axis "i".
Relative or absolute position for the center of the bin.