|
[Rivet-svn] rivet: 2 new changesetsRivet Mercurial rivet at projects.hepforge.orgWed Jun 15 14:15:02 BST 2016
details: https://rivet.hepforge.org/hg/rivet/rev/ab2261d4beb1 branches: release-2-4-x changeset: 5262:ab2261d4beb1 user: Andy Buckley <andy at insectnation.org> date: Wed Jun 15 14:03:37 2016 +0100 description: Add mapping of the AnalysisHandler::analysisNames() method into Python details: https://rivet.hepforge.org/hg/rivet/rev/bf8dff538522 branches: release-2-4-x changeset: 5263:bf8dff538522 user: Andy Buckley <andy at insectnation.org> date: Wed Jun 15 14:03:43 2016 +0100 description: Add a --show-bibtex option to the rivet script, for convenient outputting of a BibTeX db for the used analyses. diffs (truncated from 82 to 50 lines): --- a/ChangeLog Mon Jun 13 13:44:07 2016 +0100 +++ b/ChangeLog Wed Jun 15 14:03:43 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-10 Andy Buckley <andy.buckley at cern.ch> * Adding ATLAS_2015_I1397635 Wt at 8 TeV analysis. --- a/bin/rivet Mon Jun 13 13:44:07 2016 +0100 +++ b/bin/rivet Wed Jun 15 14:03:43 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? @@ -427,6 +429,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 Mon Jun 13 13:44:07 2016 +0100 +++ b/pyext/rivet/core.pyx Wed Jun 15 14:03:43 2016 +0100 @@ -18,6 +18,18 @@ self._ptr.addAnalysis(name) return self + def analysisNames(self): + anames = self._ptr.analysisNames()
More information about the Rivet-svn mailing list |