Re: [ROOT] feature-wish enhanced set(get)minimum()-AI :-)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Feb 16 2004 - 10:28:53 MET


Hi Michael,

In the CVS version, I have added an optional argument to TH1::getMinimum and
TH1::GetMaximum.
Double_t TH1::GetMinimum(Double_t minval=-FLT_MAX)
The function returns the minimum value of the histograms for bins
with a content greater than minval. For example, h->GetMinimum(0) returns
the minimum of all bins with non zero contents.
Symmetric behaviour for TH1::GetMaximum.

Rene Brun

"K.-Michael Aye" wrote:
> 
> hi!
> 
> The default minimum is zero for all positively filled histograms, so when a
> histogram is filled with very high values, it is very much zoomed out.
> 
> Q1: Is there a reason not to put the displayed minimum by default to
> GetMinimum()/1.1 or something similar?
> 
> But now, whereas this normally can be solved easily by doing
> h->SetMinimum(h->GetMinimum()/1.1)
> this is not possible, when some of the bins have never been filled and
> therefore the 'official' histogram's Minimum is still zero.
> 
> So I always have to include some dummies to keep track of the actual minimum
> of measured values to adjust the histogram later.
> 
> Question 2 is, if this is a situation met by many people, could maybe a flag
> be introduced for ignoring empty bins for the getminimum()-function or maybe
> only for the setminimum()-case. I wouldn't know, how this could be solved
> most efficiently, just feel like this could be the case for many people.
> 
> What do people think?
> 
> Cheers, and happy weekends everybody!
> Michael
> 
> --
> K.-Michael Aye, University of Durham, Dept. of Physics
> Phone@Work: +44-191-33.43665
> "If a nation expects to be ignorant and free, in a state of civilization, it
> expects what never was and never will be." - Thomas Jefferson



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:05 MET