[Rivet-svn] r3088 - trunk/pyext

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon May 9 14:29:18 BST 2011


Author: hoeth
Date: Mon May  9 14:29:18 2011
New Revision: 3088

Log:
cosmetic changes in lighthisto

Modified:
   trunk/pyext/lighthisto.py

Modified: trunk/pyext/lighthisto.py
==============================================================================
--- trunk/pyext/lighthisto.py	Mon May  9 11:02:49 2011	(r3087)
+++ trunk/pyext/lighthisto.py	Mon May  9 14:29:18 2011	(r3088)
@@ -124,7 +124,7 @@
             out += "## YLabel: %s\n" % self.ylabel
         out += "## Area: %s\n" % self.area()
         out += "## Num bins: %d\n" % self.numBins()
-        out += "## xval  \tval    \txlow    \txhigh    \tylow     \tyhigh\n"
+        out += "## xval  \tyval    \txlow    \txhigh    \tylow     \tyhigh\n"
         out += "\n".join([b.asGnuplot() for b in self.getBins()])
         out += "\n# END HISTOGRAM"
         return out
@@ -546,9 +546,18 @@
         if len(self.plotpaths) == 0:
             try:
                 import rivet
+                try:
                 self.plotpaths = rivet.getAnalysisPlotPaths()
-            except Exception:
-                raise ValueError("No plotpaths given and the rivet module could not be loaded!")
+                except AttributeError:
+                    self.plotpaths = rivet.getAnalysisRefPaths()
+                except AttributeError, e:
+                    logging.error("Failed to load Rivet analysis plot/reference paths: %s" % e)
+                    logging.error("Rivet version is too old.")
+                    raise ValueError("No plot paths given and rivet module is too old.")
+            except ImportError, e:
+                logging.error("Failed to import rivet module: %s" % e)
+                raise ValueError("No plot paths given and the rivet module could not be loaded!")
+
 
     def getSection(self, section, hpath):
         """Get a section for a histogram from a .plot file.


More information about the Rivet-svn mailing list