[Rivet-svn] r2895 - in trunk/include/Rivet: . Projections

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Jan 25 20:41:03 GMT 2011


Author: hoeth
Date: Tue Jan 25 20:41:03 2011
New Revision: 2895

Log:
allow explicit 3-momentum sorting of final state particles

Modified:
   trunk/include/Rivet/Particle.hh
   trunk/include/Rivet/Projections/FinalState.hh

Modified: trunk/include/Rivet/Particle.hh
==============================================================================
--- trunk/include/Rivet/Particle.hh	Tue Jan 25 19:52:04 2011	(r2894)
+++ trunk/include/Rivet/Particle.hh	Tue Jan 25 20:41:03 2011	(r2895)
@@ -137,6 +137,14 @@
   inline bool cmpParticleByAscPt(const Particle& a, const Particle& b) {
     return a.momentum().pT() < b.momentum().pT();
   }
+  /// Sort by descending transverse momentum, \f$ p \f$
+  inline bool cmpParticleByP(const Particle& a, const Particle& b) {
+    return a.momentum().vector3().mod() > b.momentum().vector3().mod();
+  }
+  /// Sort by ascending transverse momentum, \f$ p \f$
+  inline bool cmpParticleByAscP(const Particle& a, const Particle& b) {
+    return a.momentum().vector3().mod() < b.momentum().vector3().mod();
+  }
   /// Sort by descending transverse energy, \f$ E_\perp \f$
   inline bool cmpParticleByEt(const Particle& a, const Particle& b) {
     return a.momentum().Et() > b.momentum().Et();

Modified: trunk/include/Rivet/Projections/FinalState.hh
==============================================================================
--- trunk/include/Rivet/Projections/FinalState.hh	Tue Jan 25 19:52:04 2011	(r2894)
+++ trunk/include/Rivet/Projections/FinalState.hh	Tue Jan 25 20:41:03 2011	(r2895)
@@ -50,6 +50,11 @@
       return particles(cmpParticleByPt);
     }
 
+    /// Get the final-state particles, ordered by decreasing \f$ p \f$.
+    const ParticleVector& particlesByP() const {
+      return particles(cmpParticleByP);
+    }
+
     /// Get the final-state particles, ordered by decreasing \f$ E \f$.
     const ParticleVector& particlesByE() const {
       return particles(cmpParticleByE);


More information about the Rivet-svn mailing list