Re: TH1::SetBin(...)

Rene Brun (Rene.Brun@cern.ch)
Wed, 19 Aug 1998 09:52:43 +0200


Wouter Hulsbergen wrote:
>
> Dear developers,
>
> In TH1 there exist a SetBin(...) functions with which one can nicely
> change the number of bins in an existing histogram. However, as no attempt
> is made to extend the array which carries the bincontents, this
> obviously leads to segmentation violations if the new number of bins is
> greater than the old number. I think the SetBin function must be overruled
> in TH1F (and TH1S and ...)
>

Wouter,
The TH1::SetBins function has the user interface to change
the number of bins and the histogram limits.
This function is currently used in TTree::Draw, for example,
to redefine the histogram limits.
Changing the number of bins is not implemented. I agree that this
should be protected and can only be implemented in redefining the
function in the derived classes TH1F,etc.

Rene Brun