Skip to content

Commit

Permalink
makeplots: don't normalize 0 entry histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
goi42 committed May 21, 2019
1 parent 4bb90a0 commit 055c7ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/makeplots/makeplots_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,11 @@ def run(self):
if(norm):
if(verbose):
print "normalizing histogram {i}...".format(i=hi + 1),
h.Scale(1 / h.Integral())
if h.Integral() == 0:
if(verbose):
print "histogram {i} has no contents--not normalizing".format(i=hi + 1),
else:
h.Scale(1 / h.Integral())
if(verbose):
print "done"
if(verbose):
Expand Down

0 comments on commit 055c7ab

Please sign in to comment.