Skip to content

Commit 77b759c

Browse files
committed
Fix - show non-zero fEntries for TH1 #320
If not set - use from counted statistic
1 parent 33e4c74 commit 77b759c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/hist2d/TH1Painter.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class TH1Painter extends THistPainter {
9999
else
100100
hsum += histo.getBinContent(0) + histo.getBinContent(this.nbinsx + 1);
101101

102-
this.stat_entries = (histo.fEntries > 1) ? histo.fEntries : hsum;
102+
this.stat_entries = hsum;
103103

104104
this.hmin = hmin;
105105
this.hmax = hmax;
@@ -210,7 +210,8 @@ class TH1Painter extends THistPainter {
210210
right = this.getSelectIndex('x', 'right'),
211211
fp = this.getFramePainter(),
212212
res = { name: histo.fName, meanx: 0, meany: 0, rmsx: 0, rmsy: 0, integral: 0,
213-
entries: this.stat_entries, eff_entries: 0, xmax: 0, wmax: 0, skewx: 0, skewd: 0, kurtx: 0, kurtd: 0 },
213+
entries: (histo.fEntries > 0) ? histo.fEntries : this.stat_entries,
214+
eff_entries: 0, xmax: 0, wmax: 0, skewx: 0, skewd: 0, kurtx: 0, kurtd: 0 },
214215
has_counted_stat = !fp.isAxisZoomed('x') && (Math.abs(histo.fTsumw) > 1e-300);
215216
let stat_sumw = 0, stat_sumw2 = 0, stat_sumwx = 0, stat_sumwx2 = 0, stat_sumwy = 0, stat_sumwy2 = 0,
216217
i, xx = 0, w = 0, xmax = null, wmax = null;

0 commit comments

Comments
 (0)