Histogramming facilities are provided through the AIDA abstract interface. AIDA is not required to build Geant4 itself, but if you wish to use it in your applications, it should be installed following the guide at:
AIDA (Abstract Interfaces for Data Analysis)
External, AIDA-compliant packages which provide the necessary functionalities for doing histogramming (and therefore should be installed if you require this functionality in your applications) are:
iAIDA (iAIDA, an implementation of AIDA in C++)
JAS (Java Analysis Studio)
Open Scientist (Interactive Analysis Environment).