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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Mar 18 19:03:06 GMT 2010


Author: buckley
Date: Thu Mar 18 19:03:06 2010
New Revision: 2343

Log:
Tidying of VisibleFinalState

Modified:
   trunk/include/Rivet/Projections/VisibleFinalState.hh
   trunk/src/Projections/VisibleFinalState.cc

Modified: trunk/include/Rivet/Projections/VisibleFinalState.hh
==============================================================================
--- trunk/include/Rivet/Projections/VisibleFinalState.hh	Thu Mar 18 19:02:52 2010	(r2342)
+++ trunk/include/Rivet/Projections/VisibleFinalState.hh	Thu Mar 18 19:03:06 2010	(r2343)
@@ -15,44 +15,28 @@
 
   /// Final state modifier which excludes any particles which are not experimentally visible
   class VisibleFinalState : public FinalState {
-
   public:
  
     /// @name Constructors
     //@{
+
     /// Default constructor.
-    VisibleFinalState() {
-      setName("VisibleFinalState");
-      VetoedFinalState vfs;
-      vfs.vetoNeutrinos();
-      addProjection(vfs, "VFS");
-    }
+    VisibleFinalState();
 
     /// Constructor with min and max pseudorapidity \f$ \eta \f$ and min \f$ p_T
     /// \f$ (in GeV).
     VisibleFinalState(double mineta = -MAXRAPIDITY,
                       double maxeta =  MAXRAPIDITY,
-                      double minpt  =  0.0*GeV) {
-      setName("VisibleFinalState");
-      VetoedFinalState vfs(FinalState(mineta, maxeta, minpt));
-      vfs.vetoNeutrinos();
-      addProjection(vfs, "VFS");
-    }
+                      double minpt  =  0.0*GeV);
 
     /// Constructor with specific FinalState.
-    VisibleFinalState(const FinalState& fsp)
-    {
-      setName("VisibleFinalState");
-      VetoedFinalState vfs(fsp);
-      vfs.vetoNeutrinos();
-      addProjection(vfs, "VFS");
-    }
-
+    VisibleFinalState(const FinalState& fsp);
 
     /// Clone on the heap.
     virtual const Projection* clone() const {
       return new VisibleFinalState(*this);
     }
+
     //@}
  
 

Modified: trunk/src/Projections/VisibleFinalState.cc
==============================================================================
--- trunk/src/Projections/VisibleFinalState.cc	Thu Mar 18 19:02:52 2010	(r2342)
+++ trunk/src/Projections/VisibleFinalState.cc	Thu Mar 18 19:03:06 2010	(r2343)
@@ -8,13 +8,47 @@
 namespace Rivet {
 
 
+  namespace {
+    void _setup_vfs(VetoedFinalState& vfs) {
+      vfs.vetoNeutrinos();
+      vfs.addVetoId(1000022); // lightest neutralino
+      vfs.addVetoId(1000039); // gravitino
+      /// @todo More?
+    }
+  }
+
+
+  VisibleFinalState::VisibleFinalState() {
+    setName("VisibleFinalState");
+    VetoedFinalState vfs;
+    _setup_vfs(vfs);
+    addProjection(vfs, "VetoedFS");
+  }
+
+
+  VisibleFinalState::VisibleFinalState(double mineta, double maxeta, double minpt) {
+    setName("VisibleFinalState");
+    VetoedFinalState vfs(FinalState(mineta, maxeta, minpt));
+    _setup_vfs(vfs);
+    addProjection(vfs, "VetoedFS");
+  }
+
+
+  VisibleFinalState::VisibleFinalState(const FinalState& fsp) {
+    setName("VisibleFinalState");
+    VetoedFinalState vfs(fsp);
+    _setup_vfs(vfs);
+    addProjection(vfs, "VetoedFS");
+  }
+
+
   int VisibleFinalState::compare(const Projection& p) const {
-    return mkNamedPCmp(p, "VFS");
+    return mkNamedPCmp(p, "VetoedFS");
   }
 
 
   void VisibleFinalState::project(const Event& e) {
-    const FinalState& vfs = applyProjection<FinalState>(e, "VFS");
+    const FinalState& vfs = applyProjection<FinalState>(e, "VetoedFS");
     _theParticles = vfs.particles();
   }
 


More information about the Rivet-svn mailing list