[Rivet] [Rivet-svn] r2507 - trunk/bin

Frank Siegert frank.siegert at durham.ac.uk
Tue Jun 22 22:52:08 BST 2010


I have one comment/question about this commit. I left everything 
backward compatible, such that

  compare-histos foo.aida:'bar'

will work correctly to use 'bar' as Title.

This commit now allows for more flexible specification of all the 
HISTOGRAM options, like LineColor, LineStyle, ... and it would be 
possible and maybe more consistent to not treat Title as special first 
case but instead like everything else, e.g.

  compare-histos foo.aida:'LineColor=blue':'Title=bar'

(i.e. not treat the first string after the colon as the title)

I don't have a strong opinion either way. What do you think?

Cheers,
Frank

blackhole at projects.hepforge.org, Tuesday 22 June 2010:
> Author: fsiegert
> Date: Tue Jun 22 22:22:31 2010
> New Revision: 2507
> 
> Log:
> Allow for free form specification of line color, line style, ...
> (everything in HISTOGRAM section of .dat file) already on the
> compare-histos and rivet-mkhtml command lines. This allows for
> something like e.g. rivet-mkhtml -s Run.1.aida:'Run
> 1':LineColor=blue:LineStyle=dotted Run.2.aida:'Run
> 2':LineColor=green
> 
> Modified:
>    trunk/bin/compare-histos
>    trunk/bin/make-plots
> 
> Modified: trunk/bin/compare-histos
> =====================================================================
> ========= --- trunk/bin/compare-histos	Tue Jun 22 21:08:46
> 2010	(r2506) +++ trunk/bin/compare-histos	Tue Jun 22 22:22:31
> 2010	(r2507) @@ -154,6 +154,7 @@
>      ## Get file names and labels
>      FILES = []
>      FILELABELS = { }
> +    FILEOPTIONS = { }
>      if opts.RIVETREFS and rivet_data_dirs:
>          reffiles = []
>          for d in rivet_data_dirs:
> @@ -161,12 +162,15 @@
>              reffiles += glob.glob(os.path.join(d, "*.aida"))
>          args = reffiles + args
>      for a in args:
> -        path = a
> -        label = None
> -        if ":" in a:
> -            path, label = a.split(":", 1)
> +        asplit = a.split(":")
> +        path = asplit[0]
>          FILES.append(path)
> -        FILELABELS[path] = label
> +        if len(asplit)>1:
> +            FILELABELS[path] = asplit[1]
> +        if len(asplit)>2:
> +            FILEOPTIONS[path] = []
> +        for i in range(2, len(asplit)):
> +            FILEOPTIONS[path].append(asplit[i])
> 
> 
>      ## Check that the requested files are sensible
> @@ -236,7 +240,7 @@
>          for n, h in histos.iteritems():
>              if h.isdata and DATAFILES.has_key(n):
>                  DATAFILES[n] = f
> -            if FILELABELS[f] is not None:
> +            if f in FILELABELS:
>                  LABELS[f][n] = FILELABELS[f]
>              else:
>                  if h.isdata:
> @@ -401,6 +405,9 @@
>                      #if key == 'ErrorBars' and opts.MC_ERRS:
>                      #    continue
>                      histstr += "%s=%s\n" % (key, val)
> +                if hfile in FILEOPTIONS:
> +                    for option in FILEOPTIONS[hfile]:
> +                        histstr += '%s\n' % option
>                  i += 1
>              for bin in HISTOS[hfile][name].getBins():
>                  xmin, xmax = bin.getXRange()
> 
> Modified: trunk/bin/make-plots
> =====================================================================
> ========= --- trunk/bin/make-plots	Tue Jun 22 21:08:46 2010	(r2506)
> +++ trunk/bin/make-plots	Tue Jun 22 22:22:31 2010	(r2507)
> @@ -1809,7 +1809,7 @@
>      ## Check for no args
>      if len(args) == 0:
>          logging.error(parser.get_usage())
> -        exit(2)
> +        sys.exit(2)
> 
>  #     ## Test for latex and dvips
>  #     latex/dvips
> _______________________________________________
> Rivet-svn mailing list
> Rivet-svn at projects.hepforge.org
> http://www.hepforge.org/lists/listinfo/rivet-svn


More information about the Rivet mailing list