Dear Axel,
the point of making boost::histogram was to offer a standard solution so that people can stop reinventing histograms. All code has bugs, but if many people use the same code, it is going to have fewer bugs. That’s why boost::histogram was designed to be super flexible, so that if you don’t like a given part, you can switch that out and still use the rest.
Conceptually, histograms and profiles can be split into three orthogonal components (as explained here)
- Axes: converts values to bin indices
- Storage: manages memory for the histogram cells
- Accumulators: the object that sits in a cell and reacts to data that is sorted into the cell
The components are orthogonal, because they can be combined arbitrarily, they only talk through their respective interfaces to each other. To get a sparse histogram, you replace a array-based storage with a map-based storage. To go from histogram to profile, you replace an integer or floating point counter per cell with an object that keeps track of the sum of values and the number of times a value was entered in each cell. This design allows maximum code re-use.
You could replicate these ideas in ROOT, but that would go against the idea of sharing as much code as possible to have fewer bugs and ease maintenance.
It is said here that ROOT 7 will use “standard C++ types”, so why not use boost::histogram as the foundation for a custom histogram class. ROOT 7 could inherit from boost::histogram and implement a ROOT-like interface and additional capabilities on top of that foundation. boost is the best standard in the C++ world next to having something in the official C++ standard library.
I also want to be be clear that boost::histogram only addresses the focused problem of histogramming and profiling data, it does not provide functionality to fit data or to plot data. These features should come from other libraries such as ROOT.