211 if(strchr(
option,
't')) optionTime = 1;
else optionTime = 0;
217 if (al == ah) ah = al+1;
219 if (nold == -1 && BinWidth > 0 )
goto L90;
221 if (ntemp < 1) ntemp = 1;
226 if (awidth >= std::numeric_limits<float>::max())
228 if (awidth <= 0)
goto LOK;
233 if (optionTime && awidth>=60) {
235 awidth /= 60; timemulti *=60;
239 awidth /= 60; timemulti *= 60;
243 awidth /= 24; timemulti *= 24;
246 if (awidth>=30.43685) {
247 awidth /= 30.43685; timemulti *= 30.43685;
251 awidth /= 12; timemulti *= 12;
261 if (jlog <-200 || jlog > 200) {
268 if (awidth <= 1 && (!optionTime || timemulti==1) ) jlog--;
279 if (sigfig <= 1) siground = 1;
280 else if (sigfig <= 1.5 && jlog==1) siground = 1.5;
281 else if (sigfig <= 2) siground = 2;
282 else if (sigfig <= 3 && jlog ==1) siground = 3;
283 else if (sigfig <= 5 && sigfig>3 && jlog ==0) siground = 5;
284 else if (jlog==0) {siground = 1; jlog++;}
290 if (sigfig <= 1 && jlog==0) siground = 1;
291 else if (sigfig <= 1.2 && jlog==1) siground = 1.2;
292 else if (sigfig <= 2 && jlog==0) siground = 2;
293 else if (sigfig <= 2.4 && jlog==1) siground = 2.4;
294 else if (sigfig <= 3) siground = 3;
295 else if (sigfig <= 6) siground = 6;
296 else if (jlog==0) siground = 12;
302 if (sigfig <= 1 && jlog==0) siground = 1;
303 else if (sigfig <= 1.4 && jlog==1) siground = 1.4;
304 else if (sigfig <= 3 && jlog ==1) siground = 3;
310 if (sigfig <= 1) siground = 1;
311 else if (sigfig <= 2) siground = 2;
312 else if (sigfig <= 5 && (!optionTime || jlog<1)) siground = 5;
313 else if (sigfig <= 6 && optionTime && jlog==1) siground = 6;
314 else {siground = 1; jlog++; }
319 if (optionTime) BinWidth *= timemulti;
328 if (nbins > 10*nold && nbins > 10000) nbins = nold;
334 alb = ah/BinWidth + 1.00001;
339 if (nold == -1)
goto LOK;
341 if (nold > 1 || nbins == 1)
goto LOK;
342 BinWidth = BinWidth*2;
346 if (2*nbins == nold && !optionTime) {ntemp++;
goto L20; }
351 Int_t oldnbins = nbins;
356 if (al-BinLow >= atest) { BinLow += BinWidth; nbins--; }
357 if (BinHigh-ah >= atest) { BinHigh -= BinWidth; nbins--; }
358 if (!optionTime && BinLow >= BinHigh) {
361 BinHigh = oldBinHigh;
364 else if (optionTime && BinLow>=BinHigh) {
366 BinHigh = oldBinHigh;
368 BinWidth = (oldBinHigh - oldBinLow)/nbins;
369 atest = BinWidth*0.0001;
370 if (al-BinLow >= atest) { BinLow += BinWidth; nbins--; }
371 if (BinHigh-ah >= atest) { BinHigh -= BinWidth; nbins--; }
383 Double_t binlow = 0,binhigh = 0,binwidth=0;
386 if (isInteger) dx = 5*(
xmax-
xmin)/nbins;
389 if (umin < 0 && xmin >= 0) umin = 0;
390 if (umax > 0 &&
xmax <= 0) umax = 0;
394 if (binwidth <= 0 || binwidth > 1.e+39) {
398 const auto delta = 0.01 * (
xmax -
xmin);
399 xmin = std::min(binlow,
xmin - delta);
400 xmax = std::max(binhigh,
xmax + delta);
416 if (
xmin +nbins*bw < umax) {nbins++;
xmax =
xmin +nbins*bw;}
virtual Int_t FindGoodLimitsXY(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Int_t newbinsx=0, Int_t newbinsy=0)
Compute the best axis limits for the X and Y axis if the corresponding newbins variable is set to 0,...
virtual Int_t FindGoodLimitsXYZ(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax, Int_t newbinsx=0, Int_t newbinsy=0, Int_t newbinsz=0)
Compute the best axis limits and bins for the X, Y and Z axis if the corresponding newbins variable i...
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.