Histogram classes in root

From: Alexander Zvyagin (zvyagin@gamspc7.ihep.su)
Date: Mon Feb 14 2000 - 22:11:35 MET


Dear ROOTers

I absolutly agree with Vincent Colin de Verdiere about
his remarks concerning TH* methods.
(See http://root.cern.ch/root/roottalk/roottalk00/0375.html)
TH* classes have not very good design.
Implementation of these classes breaks some OO concepts.

Just a simple example. In our real we have 1-dim,2-dim,....N-dim
histograms.
N-dim histogram is one of our abstractions for data representations.
ROOT support only 1,2,3 dimensions. Is it difficult to support N-dim histo
in current ROOT version? YES. Take a look at source code for more
information.
But is there BIG difference (from OO point of view) among all these
histograms? NO!

In my project I had to make experimental setup acceptance calculations.
The acceptance space had >3 dimensions. ROOT is good framework, TH*
classes
are strong, have many powerful methods. But I could not store in ROOT file
>3 dim histogram! This was big disadvantage. Finaly I solved the problem.
I wrote N-dim histogram class that can be stored in ROOT file.
My class has method CreateRootHistogram() so I have access to ROOT TH*
properties. If you are interested take a look at
http://gams.ihep.su/~zvyagin/Histogram/
and compile an example under *NIX:
$ g++ -o h -I $ROOTSYS/include h.c `root-config --libs`
$ ./h
(This is NOT final solution. The class may be GREATLY improved.)

I belive that ROOT histograms classes should be redesigned. For backward
compatibility it is needed to support TH* classes, but a new histograms
design must be started. There were many remarks and questions about TH*
classes in roottalk.

Any comments?
Thanks,
Alexander Zvaygin.



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:19 MET