[Rivet-svn] r1980 - in trunk: . bin

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Nov 3 00:01:37 GMT 2009


Author: hoeth
Date: Tue Nov  3 00:01:36 2009
New Revision: 1980

Log:
make-plots: Fixing normalisation issue with stacked histograms

Modified:
   trunk/ChangeLog
   trunk/bin/make-plots

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Mon Nov  2 23:38:23 2009	(r1979)
+++ trunk/ChangeLog	Tue Nov  3 00:01:36 2009	(r1980)
@@ -1,3 +1,7 @@
+2009-11-02  Hendrik Hoeth <hendrik.hoeth at cern.ch>
+
+	* Fixing normalisation issue with stacked histograms in make-plots.
+
 2009-10-30  Hendrik Hoeth <hendrik.hoeth at cern.ch>
 
 	* CDF_2009_S8233977: Updating data and axes labels to match

Modified: trunk/bin/make-plots
==============================================================================
--- trunk/bin/make-plots	Mon Nov  2 23:38:23 2009	(r1979)
+++ trunk/bin/make-plots	Tue Nov  3 00:01:36 2009	(r1980)
@@ -94,20 +94,9 @@
             else:
                 self.description['RatioPlotSizeY'] = 3.
 
-        ## TODO: Also accept "true", "True", "TRUE", "yes", etc.
         self.description['LogX'] = self.description.has_key('LogX') and self.description['LogX']=='1'
         self.description['LogY'] = self.description.has_key('LogY') and self.description['LogY']=='1'
 
-        if self.description.has_key('Stack'):
-            foo=[]
-            for i in self.description['Stack'].strip().split():
-                if i in self.histos.keys():
-                    foo.append(i)
-            previous=''
-            for i in foo:
-                if previous!='':
-                    self.histos[i].add(self.histos[previous])
-                previous=i
         foo=[]
         if self.description.has_key('DrawOnly'):
             for i in self.description['DrawOnly'].strip().split():
@@ -185,6 +174,18 @@
         for i in inputdata.description['DrawOnly']:
             inputdata.histos[i].mangle_input()
 
+    def stack_histograms(self,inputdata):
+        if inputdata.description.has_key('Stack'):
+            foo=[]
+            for i in inputdata.description['Stack'].strip().split():
+                if i in inputdata.histos.keys():
+                    foo.append(i)
+            previous=''
+            for i in foo:
+                if previous!='':
+                    inputdata.histos[i].add(inputdata.histos[previous])
+                previous=i
+
     def set_borders(self,inputdata):
         self.set_xmax(inputdata)
         self.set_xmin(inputdata)
@@ -349,6 +350,7 @@
 class MainPlot(Plot):
     def __init__(self, inputdata):
         self.set_normalization(inputdata)
+        self.stack_histograms(inputdata)
         self.set_borders(inputdata)
         global coors
         coors = Coordinates(inputdata)


More information about the Rivet-svn mailing list