[Rivet-svn] rivet: Merge new BibTeX output feature from 2.4.x

Rivet Mercurial rivet at projects.hepforge.org
Wed Jun 15 14:30:01 BST 2016


details:   https://rivet.hepforge.org/hg/rivet/rev/34c3efca77bd
branches:  
changeset: 5264:34c3efca77bd
user:      Andy Buckley <andy at insectnation.org>
date:      Wed Jun 15 14:21:25 2016 +0100
description:
Merge new BibTeX output feature from 2.4.x

diffs (truncated from 74 to 50 lines):

--- a/ChangeLog	Wed Jun 15 12:15:33 2016 +0100
+++ b/ChangeLog	Wed Jun 15 14:21:25 2016 +0100
@@ -1,3 +1,8 @@
+2016-06-15  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Add a --show-bibtex option to the rivet script, for convenient
+	outputting of a BibTeX db for the used analyses.
+
 2016-06-14  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Add and rename 4-vector boost calculation methods: new methods
--- a/bin/rivet	Wed Jun 15 12:15:33 2016 +0100
+++ b/bin/rivet	Wed Jun 15 14:21:25 2016 +0100
@@ -53,6 +53,8 @@
                     default=False, help="list the analyses used by this command (after subtraction of inappropriate ones)")
 anagroup.add_option("--show-analysis", "--show-analyses", "--show", dest="SHOW_ANALYSES", action="append",
                     default=[], help="show the details of an analysis")
+anagroup.add_option("--show-bibtex", dest="SHOW_BIBTEX", action="store_true",
+                    default=False, help="show BibTeX entries for all used analyses")
 anagroup.add_option("--analysis-path", dest="ANALYSIS_PATH", metavar="PATH", default=None,
                     help="specify the analysis search path (cf. $RIVET_ANALYSIS_PATH).")
 # TODO: remove/deprecate the append?
@@ -428,6 +430,19 @@
     logging.debug("Adding analysis '%s'" % a)
     ah.addAnalysis(a)
 
+
+if opts.SHOW_BIBTEX:
+    bibs = []
+    for aname in sorted(ah.analysisNames()):
+        ana = rivet.AnalysisLoader.getAnalysis(aname)
+        bibs.append("% " + aname + "\n" + ana.bibTeX())
+    if bibs:
+        print "\nBibTeX for used Rivet analyses:\n"
+        print "% --------------------------\n"
+        print "\n\n".join(bibs) + "\n"
+        print "% --------------------------\n"
+
+
 ## Read and process events
 run = rivet.Run(ah)
 if opts.CROSS_SECTION is not None:
--- a/pyext/rivet/core.pyx	Wed Jun 15 12:15:33 2016 +0100
+++ b/pyext/rivet/core.pyx	Wed Jun 15 14:21:25 2016 +0100
@@ -24,6 +24,18 @@
         self._ptr.addAnalysis(name)
         return self
 
+    def analysisNames(self):
+        anames = self._ptr.analysisNames()


More information about the Rivet-svn mailing list