[Rivet-svn] r2821 - in trunk: bin data doc

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Sun Dec 5 16:28:23 GMT 2010


Author: buckley
Date: Sun Dec  5 16:28:23 2010
New Revision: 2821

Log:
Another completion tweak. Thanks, Hendrik ;)

Modified:
   trunk/bin/make-plots
   trunk/data/rivet-completion
   trunk/doc/bend.eps
   trunk/doc/cone.eps
   trunk/doc/thinker.eps
   trunk/doc/warning.eps

Modified: trunk/bin/make-plots
==============================================================================
--- trunk/bin/make-plots	Fri Dec  3 18:00:46 2010	(r2820)
+++ trunk/bin/make-plots	Sun Dec  5 16:28:23 2010	(r2821)
@@ -317,7 +317,7 @@
             foo=[]
             for i in inputdata.description['DrawOnly']:
                 foo.append(inputdata.histos[i].getZMin(self.xmin, self.xmax, self.ymin, self.ymax))
-            self.zmin=min(foo)
+            self.zmin = min(foo) if foo else 0
 
     def set_zmax(self,inputdata):
         if inputdata.description.has_key('ZMax'):
@@ -326,7 +326,8 @@
             foo=[]
             for i in inputdata.description['DrawOnly']:
                 foo.append(inputdata.histos[i].getZMax(self.xmin, self.xmax, self.ymin, self.ymax))
-            self.zmax=min(foo)
+            self.zmax = max(foo) if foo else 0
+
 
     def draw(self):
         pass
@@ -959,34 +960,37 @@
                         self.description[prop] = value
         if not iscode:
             print '++++++++++ ERROR: No code in function'
+        else:
+            foo = compile(self.code, '<string>', 'exec')
+            exec(foo)
+            self.plotfunction = plotfunction
+
 
     def draw(self,coors):
         out = ""
         out += self.startclip()
         out += self.startpsset()
-        if self.description.has_key('XMin') and self.description['XMin']!='':
-            min=float(self.description['XMin'])
-        else:
-            min=coors.xmin()
-        if self.description.has_key('XMax') and self.description['XMax']!='':
-            max=float(self.description['XMax'])
-        else:
-            max=coors.xmax()
-        dx=(max-min)/500.
-        x=min-dx
-        out += ('\\pscurve')
-        while x<(max+2*dx):
-            foo=compile(self.code, '<string>', 'exec')
-            exec(foo)
-            y=plotfunction(x)
+        xmin = coors.xmin()
+        if self.description.has_key('XMin') and self.description['XMin']:
+            xmin = float(self.description['XMin'])
+        xmax=coors.xmax()
+        if self.description.has_key('XMax') and self.description['XMax']:
+            xmax=float(self.description['XMax'])
+        # TODO: Space sample points logarithmically if LogX=1
+        dx = (xmax-xmin)/500.
+        x = xmin-dx
+        out += '\\pscurve'
+        while x < (xmax+2*dx):
+            y = self.plotfunction(x)
             out += ('(%s,%s)\n' % (coors.strphys2frameX(x), coors.strphys2frameY(y)))
-            x+=dx
+            x += dx
         out += self.stoppsset()
         out += self.stopclip()
         return out
 
 
 
+
 class Histogram(DrawableObject):
     def __init__(self, f, settings):
         self.description = settings

Modified: trunk/data/rivet-completion
==============================================================================
--- trunk/data/rivet-completion	Fri Dec  3 18:00:46 2010	(r2820)
+++ trunk/data/rivet-completion	Sun Dec  5 16:28:23 2010	(r2821)
@@ -30,12 +30,9 @@
 
     if test -x "$(which rivet 2> /dev/null)"; then
         anas=$(rivet --list-analyses)
-        if [[ ${prev} == "-a" || ${prev} == "--analysis" || ${prev} == "--show-analysis" ]]; then
+        if $(echo ${prev} | egrep -- "-a|--analysis|--show-analysis|--list-analyses" &> /dev/null); then
             COMPREPLY=( $(compgen -W "$anas" -- ${cur}) )
             return 0
-        elif [[ ${cur} == "--analysis=" || ${cur} == "--show-analysis=" ]] ; then
-            COMPREPLY=( $(compgen -W "$anas" --) )
-            return 0
         fi
     fi
 
@@ -44,12 +41,12 @@
         return 0
     fi
 
-    if [[ ${prev} == "--histo-file" || ${prev} == "-H" ]] ; then
+    if $(echo ${prev} | egrep -- "--histo-file|-H" &> /dev/null); then
         _filedir aida
         return 0
     fi
 
-    if [[ ${prev} == "--analysis-path" || ${prev} == "--analysis-path-append" ]] ; then
+    if $(echo ${prev} | egrep -- "--analysis-path|--analysis-path-append" &> /dev/null); then
         _filedir -d
         return 0
     fi

Modified: trunk/doc/bend.eps
==============================================================================
--- trunk/doc/bend.eps	Fri Dec  3 18:00:46 2010	(r2820)
+++ trunk/doc/bend.eps	Sun Dec  5 16:28:23 2010	(r2821)
@@ -1,7 +1,7 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%Creator: (ImageMagick)
 %%Title: (bend.eps)
-%%CreationDate: (2010-09-28T18:24:44+01:00)
+%%CreationDate: (2010-12-03T17:35:38+00:00)
 %%BoundingBox: -0 -0 60 83
 %%HiResBoundingBox: 0 0 60 83
 %%DocumentData: Clean7Bit

Modified: trunk/doc/cone.eps
==============================================================================
--- trunk/doc/cone.eps	Fri Dec  3 18:00:46 2010	(r2820)
+++ trunk/doc/cone.eps	Sun Dec  5 16:28:23 2010	(r2821)
@@ -1,7 +1,7 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%Creator: (ImageMagick)
 %%Title: (cone.eps)
-%%CreationDate: (2010-09-28T18:24:44+01:00)
+%%CreationDate: (2010-12-03T17:35:38+00:00)
 %%BoundingBox: -0 -0 157 211
 %%HiResBoundingBox: 0 0 156.978 211
 %%DocumentData: Clean7Bit

Modified: trunk/doc/thinker.eps
==============================================================================
--- trunk/doc/thinker.eps	Fri Dec  3 18:00:46 2010	(r2820)
+++ trunk/doc/thinker.eps	Sun Dec  5 16:28:23 2010	(r2821)
@@ -1,7 +1,7 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%Creator: (ImageMagick)
 %%Title: (thinker.eps)
-%%CreationDate: (2010-09-28T18:24:44+01:00)
+%%CreationDate: (2010-12-03T17:35:38+00:00)
 %%BoundingBox: -0 -0 103 144
 %%HiResBoundingBox: 0 0 102.96 144
 %%DocumentData: Clean7Bit

Modified: trunk/doc/warning.eps
==============================================================================
--- trunk/doc/warning.eps	Fri Dec  3 18:00:46 2010	(r2820)
+++ trunk/doc/warning.eps	Sun Dec  5 16:28:23 2010	(r2821)
@@ -1,7 +1,7 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%Creator: (ImageMagick)
 %%Title: (warning.eps)
-%%CreationDate: (2010-09-28T18:24:44+01:00)
+%%CreationDate: (2010-12-03T17:35:38+00:00)
 %%BoundingBox: -0 -0 116 116
 %%HiResBoundingBox: 0 0 116 116
 %%DocumentData: Clean7Bit


More information about the Rivet-svn mailing list