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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Sun Mar 21 22:33:03 GMT 2010


Author: buckley
Date: Sun Mar 21 22:33:03 2010
New Revision: 2348

Log:
Adding MissingMomentum projection as a replacement for all uses of the now-deprecated TotalVisibleMomentum projection.

Added:
   trunk/include/Rivet/Projections/MissingMomentum.hh
      - copied, changed from r2346, trunk/include/Rivet/Projections/TotalVisibleMomentum.hh
   trunk/src/Projections/MissingMomentum.cc
      - copied, changed from r2346, trunk/src/Projections/TotalVisibleMomentum.cc
Modified:
   trunk/ChangeLog
   trunk/include/Rivet/Makefile.am
   trunk/include/Rivet/Projections/TotalVisibleMomentum.hh
   trunk/src/Projections/Makefile.am
   trunk/src/Projections/TotalVisibleMomentum.cc

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Sat Mar 20 21:10:16 2010	(r2347)
+++ trunk/ChangeLog	Sun Mar 21 22:33:03 2010	(r2348)
@@ -1,3 +1,14 @@
+2010-03-21  Andy Buckley  <andy at insectnation.org>
+
+	* Adding MissingMomentum projection, as replacement for ~all uses
+	of now-deprecated TotalVisibleMomentum projection.
+
+	* Fixing bug with TotalVisibleMomentum projection usage in MC_SUSY
+	analysis.
+
+	* Frank Siegert fixed major bug in pTmin param passing to FastJets
+	projection. D'oh: requires patch release.
+
 2010-03-02  Andy Buckley  <andy at insectnation.org>
 
 	* Tagging for 1.2.0 release... at last!

Modified: trunk/include/Rivet/Makefile.am
==============================================================================
--- trunk/include/Rivet/Makefile.am	Sat Mar 20 21:10:16 2010	(r2347)
+++ trunk/include/Rivet/Makefile.am	Sun Mar 21 22:33:03 2010	(r2348)
@@ -62,6 +62,7 @@
   Projections/LeadingParticlesFinalState.hh \
   Projections/LossyFinalState.hh \
   Projections/MergedFinalState.hh \
+  Projections/MissingMomentum.hh \
   Projections/Multiplicity.hh   \
   Projections/NeutralFinalState.hh \
   Projections/ParisiTensor.hh   \

Copied and modified: trunk/include/Rivet/Projections/MissingMomentum.hh (from r2346, trunk/include/Rivet/Projections/TotalVisibleMomentum.hh)
==============================================================================
--- trunk/include/Rivet/Projections/TotalVisibleMomentum.hh	Sat Mar 20 20:09:49 2010	(r2346, copy source)
+++ trunk/include/Rivet/Projections/MissingMomentum.hh	Sun Mar 21 22:33:03 2010	(r2348)
@@ -1,36 +1,50 @@
 // -*- C++ -*-
-#ifndef RIVET_TotalVisibleMomentum_HH
-#define RIVET_TotalVisibleMomentum_HH
+#ifndef RIVET_MissingMomentum_HH
+#define RIVET_MissingMomentum_HH
 
 #include "Rivet/Rivet.hh"
 #include "Rivet/Projection.hh"
-#include "Rivet/Projections/VetoedFinalState.hh"
+#include "Rivet/Projections/VisibleFinalState.hh"
 #include "Rivet/Particle.hh"
 #include "Rivet/Event.hh"
 
 namespace Rivet {
 
 
+  /// @brief Calculate missing \f$ E \f$, \f$ E_\perp \f$ etc.
   /// Project out the total visible energy vector, allowing missing
-  /// \f$ E_T \f$ etc. to be calculated.
-  class TotalVisibleMomentum : public Projection {
- 
+  /// \f E \f$, \f$ E_\perp \f$ etc. to be calculated. Final state 
+  /// visibility restrictions are automatic.
+  class MissingMomentum : public Projection { 
   public:
+
+    /// Default constructor with uncritical FS.
+    MissingMomentum()
+    {
+      setName("MissingMomentum");
+      FinalState fs;
+      addProjection(fs, "FS");
+      addProjection(VisibleFinalState(fs), "VisibleFS");
+    }
+
  
-    /// Constructor. Make sure you supply an appropriately vetoed FS!
-    TotalVisibleMomentum(const FinalState& fsp)
+    /// Constructor.
+    MissingMomentum(const FinalState& fs)
     {
-      setName("TotalVisibleMomentum");
-      addProjection(fsp, "FS");
+      setName("MissingMomentum");
+      addProjection(fs, "FS");
+      addProjection(VisibleFinalState(fs), "VisibleFS");
     }
 
+
     /// Clone on the heap.
     virtual const Projection* clone() const {
-      return new TotalVisibleMomentum(*this);
+      return new MissingMomentum(*this);
     }
 
  
   public:
+
     /// The projected four-momentum vector
     FourMomentum& momentum() { return _momentum; }
 
@@ -42,6 +56,9 @@
  
 
   protected:
+
+    /// Clear the projection results.
+    void clear();
  
     /// Apply the projection to the event.
     void project(const Event& e);
@@ -49,6 +66,7 @@
     /// Compare projections.
     int compare(const Projection& p) const;
      
+
   private:
  
     /// The total visible momentum

Modified: trunk/include/Rivet/Projections/TotalVisibleMomentum.hh
==============================================================================
--- trunk/include/Rivet/Projections/TotalVisibleMomentum.hh	Sat Mar 20 21:10:16 2010	(r2347)
+++ trunk/include/Rivet/Projections/TotalVisibleMomentum.hh	Sun Mar 21 22:33:03 2010	(r2348)
@@ -4,15 +4,16 @@
 
 #include "Rivet/Rivet.hh"
 #include "Rivet/Projection.hh"
-#include "Rivet/Projections/VetoedFinalState.hh"
+#include "Rivet/Projections/FinalState.hh"
 #include "Rivet/Particle.hh"
 #include "Rivet/Event.hh"
 
 namespace Rivet {
 
 
-  /// Project out the total visible energy vector, allowing missing
+  /// Project out the total energy vector, allowing missing
   /// \f$ E_T \f$ etc. to be calculated.
+  /// @deprecated This is confusing because the visibility is not automatic. Use MissingMomentum instead.
   class TotalVisibleMomentum : public Projection {
  
   public:

Modified: trunk/src/Projections/Makefile.am
==============================================================================
--- trunk/src/Projections/Makefile.am	Sat Mar 20 21:10:16 2010	(r2347)
+++ trunk/src/Projections/Makefile.am	Sun Mar 21 22:33:03 2010	(r2348)
@@ -21,6 +21,7 @@
   LeadingParticlesFinalState.cc \
   LossyFinalState.cc \
   MergedFinalState.cc \
+  MissingMomentum.cc \
   Multiplicity.cc \
   NeutralFinalState.cc \
   ParisiTensor.cc \

Copied and modified: trunk/src/Projections/MissingMomentum.cc (from r2346, trunk/src/Projections/TotalVisibleMomentum.cc)
==============================================================================
--- trunk/src/Projections/TotalVisibleMomentum.cc	Sat Mar 20 20:09:49 2010	(r2346, copy source)
+++ trunk/src/Projections/MissingMomentum.cc	Sun Mar 21 22:33:03 2010	(r2348)
@@ -1,25 +1,28 @@
 // -*- C++ -*-
 #include "Rivet/Tools/Logging.hh"
-#include "Rivet/Projections/TotalVisibleMomentum.hh"
+#include "Rivet/Projections/MissingMomentum.hh"
 #include "Rivet/Cmp.hh"
 
 namespace Rivet {
 
 
-  int TotalVisibleMomentum::compare(const Projection& p) const {
-    return mkNamedPCmp(p, "FS");
+  int MissingMomentum::compare(const Projection& p) const {
+    return mkNamedPCmp(p, "VisibleFS");
   }
 
 
-  void TotalVisibleMomentum::project(const Event& e) {
+  void MissingMomentum::clear() {
     _momentum = FourMomentum();
     _set = 0.0;
+  }
 
-    // Project into final state
-    const FinalState& fs = applyProjection<FinalState>(e, "FS");
 
-    // Get hadron and charge info for each particle, and fill counters appropriately
-    foreach (const Particle& p, fs.particles()) {
+  void MissingMomentum::project(const Event& e) {
+    clear();
+    
+    // Project into final state
+    const FinalState& vfs = applyProjection<FinalState>(e, "VisibleFS");
+    foreach (const Particle& p, vfs.particles()) {
       const FourMomentum& mom = p.momentum();
       _momentum += mom;
       _set += mom.Et();

Modified: trunk/src/Projections/TotalVisibleMomentum.cc
==============================================================================
--- trunk/src/Projections/TotalVisibleMomentum.cc	Sat Mar 20 21:10:16 2010	(r2347)
+++ trunk/src/Projections/TotalVisibleMomentum.cc	Sun Mar 21 22:33:03 2010	(r2348)
@@ -17,8 +17,6 @@
 
     // Project into final state
     const FinalState& fs = applyProjection<FinalState>(e, "FS");
-
-    // Get hadron and charge info for each particle, and fill counters appropriately
     foreach (const Particle& p, fs.particles()) {
       const FourMomentum& mom = p.momentum();
       _momentum += mom;


More information about the Rivet-svn mailing list