Skip to content

Commit

Permalink
Build with entries and empty bin
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed Oct 30, 2024
1 parent de37eb7 commit c4a86ed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions build/jsroot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -165257,9 +165260,6 @@ class RH3Painter extends RHistPainter {

res.integral = stat_sum0;

if (histo.fEntries > 1)
res.entries = histo.fEntries;

return res;
}

Expand Down

0 comments on commit c4a86ed

Please sign in to comment.