[Rivet-svn] rivet: 2 new changesets

Rivet Mercurial rivet at projects.hepforge.org
Tue Sep 27 19:30:02 BST 2016


details:   https://rivet.hepforge.org/hg/rivet/rev/6b69458fc1e5
branches:  release-2-5-x
changeset: 5530:6b69458fc1e5
user:      Holger Schulz <holger.schulz at durham.ac.uk>
date:      Tue Sep 27 19:14:51 2016 +0100
description:
Keywords machinery for analysis grouping: rivet -a @KEYWORD

details:   https://rivet.hepforge.org/hg/rivet/rev/8a5c1295de73
branches:  release-2-5-x
changeset: 5531:8a5c1295de73
user:      Holger Schulz <holger.schulz at durham.ac.uk>
date:      Tue Sep 27 19:23:15 2016 +0100
description:
Merge w Andy

diffs (truncated from 350 to 50 lines):

--- a/ChangeLog	Tue Sep 27 18:17:57 2016 +0100
+++ b/ChangeLog	Tue Sep 27 19:23:15 2016 +0100
@@ -1,3 +1,15 @@
+2016-09-27  Andy Buckley  <andy.buckley at cern.ch>
+
+       * Add vector and scalar pT (rather than Et) to MissingMomentum.
+
+2016-09-27  Holger Schulz  <holger.schulz at cern.ch>
+
+	* Analysis keyword machinery
+
+	* rivet -a @semileptonic
+
+	* rivet -a @semileptonic@^bdecays -a @semileptonic@^ddecays
+
 2016-09-22  Holger Schulz  <holger.schulz at cern.ch>
 
 	* Release version 2.5.2
--- a/bin/rivet	Tue Sep 27 18:17:57 2016 +0100
+++ b/bin/rivet	Tue Sep 27 19:23:15 2016 +0100
@@ -49,6 +49,8 @@
                     help="add an analysis (or comma-separated list of analyses) to the processing list.")
 anagroup.add_option("--list-analyses", "--list", dest="LIST_ANALYSES", action="store_true",
                     default=False, help="show the list of available analyses' names. With -v, it shows the descriptions, too")
+anagroup.add_option("--list-keywords", "--keywords", dest="LIST_KEYWORDS", action="store_true",
+                    default=False, help="show the list of available keywords.")
 anagroup.add_option("--list-used-analyses", action="store_true", dest="LIST_USED_ANALYSES",
                     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",
@@ -138,11 +140,40 @@
         logging.warning("Couldn't process logging string '%s'" % l)
 
 
+def getAnalysesByKeyword(alist, kstring):
+    add, veto, ret = [], [], []
+    bits = [i for i in kstring.replace("^@", "@^").split("@") if len(i)>0]
+    for b in bits:
+        if b.startswith("^"):
+            veto.append(b.strip("^"))
+        else:
+            add.append(b)
+
+    add=set(add)
+    veto=set(veto)
+
+    for a in alist:
+        kwds = set([i.lower() for i in rivet.AnalysisLoader.getAnalysis(a).keywords()])
+        if len(kwds.intersection(veto)) == 0 and len(kwds.intersection(add))==len(list(add)):
+            ret.append(a)
+    return ret


More information about the Rivet-svn mailing list