[yoda-svn] yoda: Add a --add option to yodamerge, for simple histo stacking...

YODA Mercurial yoda at projects.hepforge.org
Tue Feb 16 22:30:01 GMT 2016


details:   https://yoda.hepforge.org/hg/yoda/rev/6ae5b1901b68
branches:  release-1-5
changeset: 1216:6ae5b1901b68
user:      Andy Buckley <andy at insectnation.org>
date:      Tue Feb 16 22:21:51 2016 +0000
description:
Add a --add option to yodamerge, for simple histo stacking. Thanks to Chris Gutschow for the patch, although my spidey sense is tingling...

diffs (33 lines):

--- a/ChangeLog	Fri Feb 05 16:16:13 2016 +0000
+++ b/ChangeLog	Tue Feb 16 22:21:51 2016 +0000
@@ -1,3 +1,9 @@
+2016-02-16  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Add a --add option to yodamerge, for simple histo
+	stacking. Thanks to Chris Gutschow for the patch, although my
+	spidey sense is tingling...
+
 2015-12-21  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Version 1.5.8!
--- a/bin/yodamerge	Fri Feb 05 16:16:13 2016 +0000
+++ b/bin/yodamerge	Tue Feb 16 22:21:51 2016 +0000
@@ -111,6 +111,7 @@
                   help="choose strategy for combining Scatter3D objects: one of 'first', 'combine', 'assume_mean'")
 parser.add_option('--no-veto-empty', action="store_false", default=True, dest='VETO_EMPTY',
                   help="disable the removal of empty (sumW=0) data objects _before_ applying merge heuristics. You probably want the default!")
+parser.add_option('--add', action="store_true", default=False, dest='STACK', help="force simple stacking")
 parser.add_option('--assume-normalized', action="store_true", default=False, dest='ASSUME_NORMALIZED',
                   help="DEPRECATED, AND DOES NOTHING. This option _used_ to bypass the detection heuristic for unnormalized histograms")
 opts, fileargs = parser.parse_args()
@@ -165,7 +166,9 @@
 
         ## Identify a target rescaling factor from the 1/scalefactor-weighted norms of each run
         rescale = None
-        if all("ScaledBy" in ao.annotations for ao in aos):
+        if len(aos) > 1 and opts.STACK:
+            pass # we're in dumb stacking mode
+        elif all("ScaledBy" in ao.annotations for ao in aos):
             rescale = 1.0 / sum(float(ao.annotation("yodamerge_scale"))/float(ao.annotation("ScaledBy")) for ao in aos)
         elif all("ScaledBy" not in ao.annotations for ao in aos):
             pass


More information about the yoda-svn mailing list