[Rivet-svn] r3579 - trunk/bin

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Feb 24 14:17:23 GMT 2012


Author: holsch
Date: Fri Feb 24 14:17:23 2012
New Revision: 3579

Log:
Prevent division by zero in case of emty histograms

Modified:
   trunk/bin/rivet-rescale

Modified: trunk/bin/rivet-rescale
==============================================================================
--- trunk/bin/rivet-rescale	Thu Feb 23 19:13:08 2012	(r3578)
+++ trunk/bin/rivet-rescale	Fri Feb 24 14:17:23 2012	(r3579)
@@ -316,7 +316,10 @@
             else:
                 newarea = tempref.getArea()
 
-            scalefactor = newarea/oldarea
+            if not oldarea == 0.0:
+                scalefactor = newarea/oldarea
+            else:
+                scalefactor= 0.0
             if scalefactor != 1.0:
                 oldarea = histos[name].getArea()
                 newarea = histos[name].getArea() * scalefactor


More information about the Rivet-svn mailing list