From c4a86ed15788020c28a412d0d99fc1d1776b1efa Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Wed, 30 Oct 2024 12:54:47 +0100 Subject: [PATCH] Build with entries and empty bin --- build/jsroot.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build/jsroot.js b/build/jsroot.js index ee9073767..fd0c0e7aa 100644 --- a/build/jsroot.js +++ b/build/jsroot.js @@ -77184,7 +77184,7 @@ let TH2Painter$2 = class TH2Painter extends THistPainter { res.wmax = 0; res.integral = stat_sum0; - if (histo.fEntries > 1) + if (histo.fEntries > 0) res.entries = histo.fEntries; res.eff_entries = stat_sumw2 ? stat_sum0*stat_sum0/stat_sumw2 : Math.abs(stat_sum0); @@ -81878,7 +81878,7 @@ let TH1Painter$2 = class TH1Painter extends THistPainter { else hsum += histo.getBinContent(0) + histo.getBinContent(this.nbinsx + 1); - this.stat_entries = (histo.fEntries > 1) ? histo.fEntries : hsum; + this.stat_entries = hsum; this.hmin = hmin; this.hmax = hmax; @@ -81997,7 +81997,8 @@ let TH1Painter$2 = class TH1Painter extends THistPainter { right = this.getSelectIndex('x', 'right'), fp = this.getFramePainter(), res = { name: histo.fName, meanx: 0, meany: 0, rmsx: 0, rmsy: 0, integral: 0, - entries: this.stat_entries, eff_entries: 0, xmax: 0, wmax: 0, skewx: 0, skewd: 0, kurtx: 0, kurtd: 0 }, + entries: (histo.fEntries > 0) ? histo.fEntries : this.stat_entries, + eff_entries: 0, xmax: 0, wmax: 0, skewx: 0, skewd: 0, kurtx: 0, kurtd: 0 }, has_counted_stat = !fp.isAxisZoomed('x') && (Math.abs(histo.fTsumw) > 1e-300); let stat_sumw = 0, stat_sumw2 = 0, stat_sumwx = 0, stat_sumwx2 = 0, stat_sumwy = 0, stat_sumwy2 = 0, i, xx = 0, w = 0, xmax = null, wmax = null; @@ -82345,6 +82346,7 @@ let TH1Painter$2 = class TH1Painter extends THistPainter { const draw_markers = show_errors || show_markers, draw_any_but_hist = draw_markers || show_text || show_line || show_curve, draw_hist = this.options.Hist && (!this.lineatt.empty() || !this.fillatt.empty()), + check_sumw2 = show_errors && histo.fSumw2?.length, // if there are too many points, exclude many vertical drawings at the same X position // instead define min and max value and made min-max drawing use_minmax = draw_any_but_hist || ((right - left) > 3*width); @@ -82375,7 +82377,8 @@ let TH1Painter$2 = class TH1Painter extends THistPainter { // just to get correct values for the specified bin const extract_bin = bin => { bincont = histo.getBinContent(bin+1); - if (exclude_zero && (bincont === 0)) return false; + if (exclude_zero && (bincont === 0) && (!check_sumw2 || !histo.fSumw2[bin+1])) + return false; mx1 = Math.round(funcs.grx(xaxis.GetBinLowEdge(bin+1))); mx2 = Math.round(funcs.grx(xaxis.GetBinLowEdge(bin+2))); midx = Math.round((mx1 + mx2) / 2); @@ -83561,7 +83564,7 @@ class TH3Painter extends THistPainter { res.integral = stat_sum0; - if (histo.fEntries > 1) + if (histo.fEntries > 0) res.entries = histo.fEntries; res.eff_entries = stat_sumw2 ? stat_sum0*stat_sum0/stat_sumw2 : Math.abs(stat_sum0); @@ -165257,9 +165260,6 @@ class RH3Painter extends RHistPainter { res.integral = stat_sum0; - if (histo.fEntries > 1) - res.entries = histo.fEntries; - return res; }