[Rivet-svn] rivet: 3 new changesets

Rivet Mercurial rivet at projects.hepforge.org
Wed Jun 28 21:15:02 BST 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/96674dbe7091
branches:  
changeset: 5931:96674dbe7091
user:      Andy Buckley <andy at insectnation.org>
date:      Wed Jun 28 20:11:39 2017 +0100
description:
Tweaks and typos

details:   https://rivet.hepforge.org/hg/rivet/rev/556a8f98c89c
branches:  
changeset: 5932:556a8f98c89c
user:      Andy Buckley <andy at insectnation.org>
date:      Wed Jun 28 21:10:40 2017 +0100
description:
Extend Cutflow and Cutflows to allow weighted calls to fill() without giving a cutresult bool argument

details:   https://rivet.hepforge.org/hg/rivet/rev/ccddc32e3a67
branches:  
changeset: 5933:ccddc32e3a67
user:      Andy Buckley <andy at insectnation.org>
date:      Wed Jun 28 21:11:00 2017 +0100
description:
Fix first cut-flow index (explicit fill)

diffs (truncated from 114 to 50 lines):

--- a/analyses/pluginATLAS/ATLAS_2016_CONF_2016_078.cc	Wed Jun 28 13:34:40 2017 +0100
+++ b/analyses/pluginATLAS/ATLAS_2016_CONF_2016_078.cc	Wed Jun 28 21:11:00 2017 +0100
@@ -130,7 +130,7 @@
       if (!muons.empty()) vetoEvent;
 
       // Passed presel & MET
-      _flows.fill(0, true);
+      _flows.fill(1);
 
       // Get jets and their pTs
       const Jets jets20 = jets;
--- a/include/Rivet/Tools/Cutflow.hh	Wed Jun 28 13:34:40 2017 +0100
+++ b/include/Rivet/Tools/Cutflow.hh	Wed Jun 28 21:11:00 2017 +0100
@@ -32,6 +32,16 @@
       return cutresult;
     }
 
+    /// @brief Fill the @a {icut}'th post-cut counter, starting at icut=1 for first cut (cutvalue=true overload)
+    ///
+    /// This version exists to allow calling fill(i, weight) without the weight
+    /// getting cast to a bool, or having to explicitly add a 'true' middle arg.
+    ///
+    /// @note Returns the cut result to allow 'side-effect' cut-flow filling in an if-statement
+    bool fill(size_t icut, double weight) {
+      return fill(icut, true, weight);
+    }
+
     /// @brief Fill all cut-state counters from an Ncut-element results vector
     ///
     /// This function is to be used to fill all of an event's pre- and post-cut
@@ -167,12 +177,22 @@
       for (Cutflow& cf : cfs) cf.fillinit(weight);
     }
 
-    /// @brief Fill the @a {icut}'th post-cut counter with the same result for all {Cutflow}s
-    bool fill(size_t icut, bool cutresult, double weight=1.) {
+    /// @brief Fill the @a {icut}'th post-cut counter, starting at icut=1 for first cut, with the same result for all {Cutflow}s
+    bool fill(size_t icut, bool cutresult=true, double weight=1.) {
       for (Cutflow& cf : cfs) cf.fill(icut, cutresult, weight);
       return cutresult;
     }
 
+    /// @brief Fill the @a {icut}'th post-cut counter, starting at icut=1 for first cut, with the same result for all {Cutflow}s (cutresult=true overload)
+    ///
+    /// This version exists to allow calling fill(i, weight) without the weight
+    /// getting cast to a bool, or having to explicitly add a 'true' middle arg.
+    ///
+    /// @note Returns the cut result to allow 'side-effect' cut-flow filling in an if-statement
+    bool fill(size_t icut, double weight) {
+      return fill(icut, true, weight);


More information about the Rivet-svn mailing list