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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Sep 22 07:55:31 BST 2011


Author: richardn
Date: Thu Sep 22 07:55:30 2011
New Revision: 3377

Log:
add NonHadronicFinalState projection for use in BSM analyses

Added:
   trunk/include/Rivet/Projections/NonHadronicFinalState.hh
      - copied, changed from r3375, trunk/include/Rivet/Projections/HadronicFinalState.hh
   trunk/src/Projections/NonHadronicFinalState.cc
      - copied, changed from r3375, trunk/src/Projections/HadronicFinalState.cc
Modified:
   trunk/src/Projections/Makefile.am

Copied and modified: trunk/include/Rivet/Projections/NonHadronicFinalState.hh (from r3375, trunk/include/Rivet/Projections/HadronicFinalState.hh)
==============================================================================
--- trunk/include/Rivet/Projections/HadronicFinalState.hh	Mon Sep 19 16:28:16 2011	(r3375, copy source)
+++ trunk/include/Rivet/Projections/NonHadronicFinalState.hh	Thu Sep 22 07:55:30 2011	(r3377)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
-#ifndef RIVET_HadronicFinalState_HH
-#define RIVET_HadronicFinalState_HH
+#ifndef RIVET_NonHadronicFinalState_HH
+#define RIVET_NonHadronicFinalState_HH
 
 #include "Rivet/Tools/Logging.hh"
 #include "Rivet/Rivet.hh"
@@ -13,30 +13,28 @@
 namespace Rivet {
 
   /// @brief Project only hadronic final state particles.
-  class HadronicFinalState : public FinalState {
+  class NonHadronicFinalState : public FinalState {
 
   public:
 
     /// Constructor: the supplied FinalState projection is assumed to live through the run.
-    HadronicFinalState(FinalState& fsp)
-      : FinalState(fsp)
+    NonHadronicFinalState(FinalState& fsp)
     {
-      setName("HadronicFinalState");
+      setName("NonHadronicFinalState");
       addProjection(fsp, "FS");
     }
 
-    HadronicFinalState(double mineta = -MAXRAPIDITY,
-                       double maxeta = MAXRAPIDITY,
-                       double minpt = 0.0*GeV)
-      : FinalState(mineta, maxeta, minpt)
+    NonHadronicFinalState(double mineta = -MAXRAPIDITY,
+			  double maxeta = MAXRAPIDITY,
+			  double minpt = 0.0*GeV)
     {
-      setName("HadronicFinalState");
+      setName("NonHadronicFinalState");
       addProjection(FinalState(mineta, maxeta, minpt), "FS");
     }
 
     /// Clone on the heap.
     virtual const Projection* clone() const {
-      return new HadronicFinalState(*this);
+      return new NonHadronicFinalState(*this);
     }
 
   protected:

Modified: trunk/src/Projections/Makefile.am
==============================================================================
--- trunk/src/Projections/Makefile.am	Thu Sep 22 07:53:52 2011	(r3376)
+++ trunk/src/Projections/Makefile.am	Thu Sep 22 07:55:30 2011	(r3377)
@@ -14,6 +14,7 @@
   FoxWolframMoments.cc \
   FParameter.cc \
   HadronicFinalState.cc \
+  NonHadronicFinalState.cc \
   Hemispheres.cc \
   IdentifiedFinalState.cc \
   InitialQuarks.cc \

Copied and modified: trunk/src/Projections/NonHadronicFinalState.cc (from r3375, trunk/src/Projections/HadronicFinalState.cc)
==============================================================================
--- trunk/src/Projections/HadronicFinalState.cc	Mon Sep 19 16:28:16 2011	(r3375, copy source)
+++ trunk/src/Projections/NonHadronicFinalState.cc	Thu Sep 22 07:55:30 2011	(r3377)
@@ -1,29 +1,27 @@
 // -*- C++ -*-
 #include "Rivet/Rivet.hh"
 #include "Rivet/Tools/ParticleIdUtils.hh"
-#include "Rivet/Projections/HadronicFinalState.hh"
+#include "Rivet/Projections/NonHadronicFinalState.hh"
 #include "Rivet/Cmp.hh"
 #include <algorithm>
 
 namespace Rivet {
 
 
-  int HadronicFinalState::compare(const Projection& p) const {
+  int NonHadronicFinalState::compare(const Projection& p) const {
     return FinalState::compare(p);
   }
 
 
-  bool hadronFilter(const Particle& p) {
-    return ! PID::isHadron(p.pdgId());
+  bool nonHadronFilter(const Particle& p) {
+    return PID::isHadron(p.pdgId());
   }
 
-
-  void HadronicFinalState::project(const Event& e) {
-    FinalState fsp = static_cast<FinalState>(*this);
-    const FinalState& fs = applyProjection(e, fsp);
+  void NonHadronicFinalState::project(const Event& e) {
+    const FinalState& fs = applyProjection<FinalState>(e, "FS");
     _theParticles.clear();
     std::remove_copy_if(fs.particles().begin(), fs.particles().end(),
-                        std::back_inserter(_theParticles), hadronFilter);
+                        std::back_inserter(_theParticles), nonHadronFilter);
     MSG_DEBUG("Number of hadronic final-state particles = "
              << _theParticles.size());
   }


More information about the Rivet-svn mailing list