Browse Source

separates hist normalization from scaling and makes stats off by default

Caleb Fangmeier 7 years ago
parent
commit
0984d6bb23
2 changed files with 7 additions and 4 deletions
  1. 6 3
      python/filval/histogram_utils.py
  2. 1 1
      python/filval/plotter.py

+ 6 - 3
python/filval/histogram_utils.py

@@ -91,12 +91,15 @@ def hist_integral(hist, times_bin_width=True):
     else:
         return sum(values)
 
-
-def hist_normalize(hist, norm = 1):
+def hist_scale(hist, scale):
     values, errors, edges = hist
-    scale = norm/np.sum(values)
     return values*scale, errors*scale, edges
 
+def hist_normalize(hist, norm = 1):
+    scale = norm/np.sum(hist[0])
+    return hist_scale(hist, scale)
+
+
 
 def hist_mean(hist):
     xs = hist_bin_centers(hist)

+ 1 - 1
python/filval/plotter.py

@@ -234,7 +234,7 @@ def add_decorations(axes, luminosity, energy):
 
 def hist_plot(h, *args, norm=None, include_errors=False,
               log=False, xlim=None, ylim=None, fit=None,
-              grid=False, stats=True, **kwargs):
+              grid=False, stats=False, **kwargs):
     """ Plots a 1D ROOT histogram object using matplotlib """
     from inspect import signature
     if norm: