[yoda-svn] yoda: 5 new changesets

YODA Mercurial yoda at projects.hepforge.org
Fri Jun 1 17:45:01 BST 2018


details:   https://yoda.hepforge.org/hg/yoda/rev/b98ba8e660b7
branches:  release-1-7
changeset: 1460:b98ba8e660b7
user:      Louie Corpe <lcorpe at cern.ch>
date:      Wed May 30 13:09:57 2018 +0200
description:
multi-error points now working for the 1D test case (Point1D and Scatter1D)

details:   https://yoda.hepforge.org/hg/yoda/rev/f68b6eaa2b92
branches:  release-1-7
changeset: 1461:f68b6eaa2b92
user:      Louie Corpe <lcorpe at cern.ch>
date:      Fri Jun 01 16:08:03 2018 +0200
description:
2,3D Scatter/Point objects now also support multiple errors. Removed Variations annotation and replaced with a variations() method with just checks what error sources are stored in the points on the fly (aside from read in/out where the annotation is added to know how many columns are expected)

details:   https://yoda.hepforge.org/hg/yoda/rev/2835d275b18f
branches:  scatter-multierrs
changeset: 1462:2835d275b18f
user:      Louie Corpe <lcorpe at cern.ch>
date:      Fri Jun 01 18:08:59 2018 +0200
description:
mult-errors branch

details:   https://yoda.hepforge.org/hg/yoda/rev/dc538875351d
branches:  scatter-multierrs
changeset: 1463:dc538875351d
user:      Louie Corpe <lcorpe at cern.ch>
date:      Fri Jun 01 18:13:41 2018 +0200
description:
merged with 1461:9f91fa4b7b15

details:   https://yoda.hepforge.org/hg/yoda/rev/2b670bd576c0
branches:  release-1-7
changeset: 1464:2b670bd576c0
user:      Louie Corpe <lcorpe at cern.ch>
date:      Fri Jun 01 18:29:52 2018 +0200
description:
merged heads

diffs (truncated from 2298 to 50 lines):

--- a/ChangeLog	Wed May 02 17:12:32 2018 +0100
+++ b/ChangeLog	Fri Jun 01 18:29:52 2018 +0200
@@ -1,3 +1,10 @@
+2018-06-01  Louie Corpe  <lcorpe at cern.ch>
+
+	* Point1,2,3D now support multiple error sources for the highest dimension.
+	
+	* Scatter1,2,3D now read in/out with additional columns for the extra error
+	sources, with a variations() method to check with sources are available
+
 2018-05-02  Andy Buckley  <andy.buckley at cern.ch>
 
 	* StringUtils.h: Replace std::ptr_fun (removed in C++17) with a lambda function. Thanks to Stefan Richter.
--- a/bin/yodamerge	Wed May 02 17:12:32 2018 +0100
+++ b/bin/yodamerge	Fri Jun 01 18:29:52 2018 +0200
@@ -246,21 +246,32 @@
                 sys.stderr.write(msg + "\n")
                 npoints = len(ao_out.points)
                 for i in range(npoints):
-                    val_i = ep_i = em_i = scalesum = 0.0
+                    val_i = scalesum = 0.0
+                    ep_i = {} # will hold the values of the multiple error sources 
+                    em_i = {} # will hold the values of the multiple error sources 
                     for ao in aos:
                         scale = float(ao.annotation("yodamerge_scale"))
+                        variations=ao.variations()
                         scalesum += scale
                         val_i += scale * ao.points[i].val(dim)
-                        ep_i += (scale * ao.points[i].errs(dim)[0])**2
-                        em_i += (scale * ao.points[i].errs(dim)[1])**2
-                    ep_i = math.sqrt(ep_i)
-                    em_i = math.sqrt(em_i)
+                        for var in variations:
+                          if not var in ep_i.keys(): 
+                            ep_i[var]=0.
+                            em_i[var]=0.
+                          ep_i[var] += (scale * ao.points[i].errs(dim,var)[0])**2
+                          em_i[var] += (scale * ao.points[i].errs(dim,var)[1])**2
+                    for var in ep_i.keys(): 
+                      ep_i[var] = math.sqrt(ep_i[var])
+                      em_i[var] = math.sqrt(em_i[var])
                     if SND_MODE == "assume_mean":
                         val_i /= scalesum
-                        ep_i  /= scalesum
-                        em_i  /= scalesum
+                        for var in ep_i.keys(): 
+                          ep_i[var]  /= scalesum
+                          em_i[var]  /= scalesum
                     setattr(ao_out.points[i],'%s' % axis[dim], val_i)
-                    setattr(ao_out.points[i],'%sErrs' % axis[dim], (ep_i, em_i))


More information about the yoda-svn mailing list