[Rivet-svn] r1777 - trunk/bin

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Aug 27 14:10:58 BST 2009


Author: fsiegert
Date: Thu Aug 27 14:10:58 2009
New Revision: 1777

Log:
compare-histos: Allow for *.plot files in the current working
directories as well (helps when working with plugin analyses). At the
same time allow for arbitrarily many --plot-info-dir's.

Modified:
   trunk/bin/compare-histos

Modified: trunk/bin/compare-histos
==============================================================================
--- trunk/bin/compare-histos	Thu Aug 27 13:28:10 2009	(r1776)
+++ trunk/bin/compare-histos	Thu Aug 27 14:10:58 2009	(r1777)
@@ -283,8 +283,8 @@
                       default=True, help="make plot file even if there is only one dataset to be plotted")
     parser.add_option("--refid", dest="REF_ID",
                       default="REF", help="ID of reference data set (file path for non-REF data)")
-    parser.add_option("--plot-info-dir", dest="PLOTINFODIR",
-                      default=rivet_data_dir, help="directory which may contain plot header information")
+    parser.add_option("--plot-info-dir", dest="PLOTINFODIR", action="append",
+                      default=["./", rivet_data_dir], help="directory which may contain plot header information")
     parser.add_option("-Q", "--quiet", help="Suppress normal messages", dest="LOGLEVEL",
                       action="store_const", default=logging.INFO, const=logging.WARNING)
     parser.add_option("-V", "--verbose", help="Add extra debug messages", dest="LOGLEVEL",
@@ -465,7 +465,12 @@
 
 
         ## Header
-        plotfile = os.path.join(opts.PLOTINFODIR, name.split("/")[1]+".plot") 
+        plotfilebase = name.split("/")[1]+".plot"
+        plotfile = plotfilebase
+        for pidir in opts.PLOTINFODIR:
+            if os.access(os.path.join(pidir, plotfilebase), os.R_OK):
+                plotfile = os.path.join(pidir, plotfilebase)
+                break
         headers = {}
         if os.access(plotfile, os.R_OK):
             f = open(plotfile)


More information about the Rivet-svn mailing list