[yoda-svn] yoda: 3 new changesets

YODA Mercurial yoda at projects.hepforge.org
Thu Feb 23 13:30:02 GMT 2017


details:   https://yoda.hepforge.org/hg/yoda/rev/3bb66d2e3148
branches:  release-1-6
changeset: 1331:3bb66d2e3148
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Feb 23 13:15:06 2017 +0000
description:
Add necessary import

details:   https://yoda.hepforge.org/hg/yoda/rev/691f04184197
branches:  release-1-6
changeset: 1332:691f04184197
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Feb 23 13:15:44 2017 +0000
description:
Fix Histo2D and Profile2D total distribution reading from YODA format.

details:   https://yoda.hepforge.org/hg/yoda/rev/837782404dbf
branches:  release-1-6
changeset: 1333:837782404dbf
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Feb 23 13:16:38 2017 +0000
description:
Merge

diffs (truncated from 64 to 50 lines):

--- a/ChangeLog	Tue Dec 13 15:53:45 2016 +0000
+++ b/ChangeLog	Thu Feb 23 13:16:38 2017 +0000
@@ -1,3 +1,12 @@
+2017-02-23  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Fix Histo2D and Profile2D total distribution reading from YODA format.
+
+2017-02-19  Holger Schulz <holger.schulz at durham.ac.uk>
+	
+	* Convert TH1F to TH1D in root2flat. Much simpler than duplicating
+        the TH1D stuff in pyext.
+
 2016-12-13  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Version 1.6.6 release.
--- a/bin/root2yoda	Tue Dec 13 15:53:45 2016 +0000
+++ b/bin/root2yoda	Thu Feb 23 13:16:38 2017 +0000
@@ -24,7 +24,15 @@
 import ROOT
 for i, o in in_out:
     rf = ROOT.TFile(i)
-    rootobjects = [obj for (path, obj) in yoda.root.getall(rf)]
+    rootobjects_raw = [obj for (path, obj) in yoda.root.getall(rf)]
+    rootobjects     = [x for x in rootobjects_raw if not isinstance(x, ROOT.TH1F)]
+    th1f            = [x for x in rootobjects_raw if     isinstance(x, ROOT.TH1F)]
+    # Conversion of TH1F into TH1D
+    for ro in th1f:
+        temp = ROOT.TH1D()
+        ro.Copy(temp)
+        rootobjects.append(temp)
+
     analysisobjects = [yoda.root.to_yoda(ro) for ro in rootobjects]
     rf.Close()
 
--- a/pyext/yoda/__init__.py	Tue Dec 13 15:53:45 2016 +0000
+++ b/pyext/yoda/__init__.py	Thu Feb 23 13:16:38 2017 +0000
@@ -9,6 +9,7 @@
 
 
 ## Try to pull in plotting tools in a non-dependency-inducing way
+import yoda.plotting
 def plot(*args, **kwargs):
     from yoda.plotting import plot as p
     return p(*args, **kwargs)
--- a/src/ReaderYODA.cc	Tue Dec 13 15:53:45 2016 +0000
+++ b/src/ReaderYODA.cc	Thu Feb 23 13:16:38 2017 +0000
@@ -250,7 +250,7 @@
             /// @todo Improve/factor this "bin" string-or-float parsing... esp for mixed case of 2D overflows
             /// @todo When outflows are treated as "infinity bins" and don't require a distinct type, string replace under/over -> -+inf
             if (s.find("Total") != string::npos) {


More information about the yoda-svn mailing list