[Rivet-svn] rivet: Add rapidity scheme arg to DeltaR functor constructors.

Rivet Mercurial rivet at projects.hepforge.org
Fri Aug 26 00:45:02 BST 2016


details:   https://rivet.hepforge.org/hg/rivet/rev/87195becee2d
branches:  release-2-5-x
changeset: 5427:87195becee2d
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Aug 25 20:43:13 2016 +0100
description:
Add rapidity scheme arg to DeltaR functor constructors.

diffs (48 lines):

--- a/ChangeLog	Tue Aug 23 22:52:42 2016 +0100
+++ b/ChangeLog	Thu Aug 25 20:43:13 2016 +0100
@@ -1,3 +1,7 @@
+2016-08-25  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Add rapidity scheme arg to DeltaR functor constructors.
+
 2016-08-23  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Provide an Analysis::bookCounter(d,x,y, title) function, for
--- a/include/Rivet/Tools/ParticleBaseUtils.hh	Tue Aug 23 22:52:42 2016 +0100
+++ b/include/Rivet/Tools/ParticleBaseUtils.hh	Thu Aug 25 20:43:13 2016 +0100
@@ -102,19 +102,23 @@
 
   /// Delta R (with respect to another 4-momentum, @a vec) greater-than functor
   struct deltaRGtr : public BoolParticleBaseFunctor {
-    deltaRGtr(const FourMomentum& vec, double dr) : refvec(vec), drcut(dr) { }
-    bool operator()(const ParticleBase& p) const { return deltaR(p, refvec) > drcut; }
+    deltaRGtr(const FourMomentum& vec, double dr, RapScheme scheme=PSEUDORAPIDITY)
+      : refvec(vec), drcut(dr), rapscheme(scheme) { }
+    bool operator()(const ParticleBase& p) const { return deltaR(p, refvec, rapscheme) > drcut; }
     FourMomentum refvec;
     double drcut;
+    RapScheme rapscheme;
   };
   using DeltaRGtr = deltaRGtr;
 
   /// Delta R (with respect to another 4-momentum, @a vec) less-than functor
   struct deltaRLess : public BoolParticleBaseFunctor {
-    deltaRLess(const FourMomentum& vec, double dr) : refvec(vec), drcut(dr) { }
-    bool operator()(const ParticleBase& p) const { return deltaR(p, refvec) < drcut; }
+    deltaRLess(const FourMomentum& vec, double dr, RapScheme scheme=PSEUDORAPIDITY)
+      : refvec(vec), drcut(dr), rapscheme(scheme) { }
+    bool operator()(const ParticleBase& p) const { return deltaR(p, refvec, rapscheme) < drcut; }
     FourMomentum refvec;
     double drcut;
+    RapScheme rapscheme;
   };
   using DeltaRLess = deltaRLess;
 
@@ -140,6 +144,7 @@
     double operator()(const FourMomentum& p4) const { return deltaR(p, p4); }
     double operator()(const Vector3& p3) const { return deltaR(p, p3); }
     const Vector3 p;
+    RapScheme rapscheme;
   };
   using DeltaRWRT = deltaRWRT;
 


More information about the Rivet-svn mailing list