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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Jul 7 16:38:01 BST 2009


Author: buckley
Date: Tue Jul  7 16:38:00 2009
New Revision: 1663

Log:
Adding VisibleFinalState projection, and automatically using it for all implementations of the JetAlg projection interface. Internally it's currently just using the VetoedFinalState with the vetoNeutrinos() method called.

Added:
   trunk/include/Rivet/Projections/VisibleFinalState.hh   (contents, props changed)
      - copied, changed from r1659, trunk/include/Rivet/Projections/VetoedFinalState.hh
   trunk/src/Projections/JetAlg.cc
   trunk/src/Projections/VisibleFinalState.cc   (contents, props changed)
      - copied, changed from r1659, trunk/src/Projections/VetoedFinalState.cc
Modified:
   trunk/ChangeLog
   trunk/include/Rivet/Makefile.am
   trunk/include/Rivet/Projections/FastJets.hh
   trunk/include/Rivet/Projections/FoxWolframMoments.hh
   trunk/include/Rivet/Projections/JetAlg.hh
   trunk/src/Projections/FastJets.cc
   trunk/src/Projections/Makefile.am

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Tue Jul  7 14:21:01 2009	(r1662)
+++ trunk/ChangeLog	Tue Jul  7 16:38:00 2009	(r1663)
@@ -1,3 +1,11 @@
+2009-07-07  Andy Buckley  <andy at insectnation.org>
+
+	* Adding VisibleFinalState and automatically using it in JetAlg
+	projections.
+
+	* Adding YAML parser for new metadata (and eventually ref data)
+	files.
+
 2009-07-02  Andy Buckley  <andy at insectnation.org>
 
 	* Adding Jet::neutralEnergy() (and Jet::totalEnergy() for

Modified: trunk/include/Rivet/Makefile.am
==============================================================================
--- trunk/include/Rivet/Makefile.am	Tue Jul  7 14:21:01 2009	(r1662)
+++ trunk/include/Rivet/Makefile.am	Tue Jul  7 16:38:00 2009	(r1663)
@@ -124,6 +124,7 @@
   Projections/TotalVisibleMomentum.hh \
   Projections/UnstableFinalState.hh \
   Projections/VetoedFinalState.hh \
+  Projections/VisibleFinalState.hh \
   Projections/ZFinder.hh
 
 

Modified: trunk/include/Rivet/Projections/FastJets.hh
==============================================================================
--- trunk/include/Rivet/Projections/FastJets.hh	Tue Jul  7 14:21:01 2009	(r1662)
+++ trunk/include/Rivet/Projections/FastJets.hh	Tue Jul  7 16:38:00 2009	(r1663)
@@ -46,7 +46,7 @@
     /// jet alg choices (including some plugins). For the built-in algs,
     /// E-scheme recombination is used. For full control of
     /// FastJet built-in jet algs, use the native arg constructor.
-    FastJets(const FinalState& fsp, JetAlgName alg, 
+    FastJets(const FinalState& fsp, JetAlgName alg,
              double rparameter, double pTmin=0.0, double seed_threshold=1.0);
 
     /// Native argument constructor, using FastJet alg/scheme enums.
@@ -56,8 +56,8 @@
     /// Explicitly pass in an externally-constructed plugin
     FastJets(const FinalState& fsp, const fastjet::JetDefinition::Plugin& plugin);
 
-    /// Explicit copy constructor.
-    FastJets(const FastJets& other);
+    // /// Explicit copy constructor.
+    // FastJets(const FastJets& other);
 
     /// Clone on the heap.
     virtual const Projection* clone() const {

Modified: trunk/include/Rivet/Projections/FoxWolframMoments.hh
==============================================================================
--- trunk/include/Rivet/Projections/FoxWolframMoments.hh	Tue Jul  7 14:21:01 2009	(r1662)
+++ trunk/include/Rivet/Projections/FoxWolframMoments.hh	Tue Jul  7 16:38:00 2009	(r1663)
@@ -9,7 +9,6 @@
 #include "Rivet/Projections/FinalState.hh"
 #include "Rivet/Particle.hh"
 #include "Rivet/Event.hh"
-#include "Rivet/Projections/FastJets.hh"
 
 #include <gsl/gsl_sf_legendre.h>
 
@@ -38,8 +37,6 @@
         .addVetoPairId(NU_TAU)
         .addVetoDetail(MUON, 1.0*GeV, MAXDOUBLE);
         addProjection(vfs, "VFS");
-        
-        //addProjection(FastJets(vfs, FastJets::CDFJETCLU, 0.4), "JetsC4");
 
         // initialize moments vector
         for ( int i = 0; i < MAXMOMENT ; ++i) {

Modified: trunk/include/Rivet/Projections/JetAlg.hh
==============================================================================
--- trunk/include/Rivet/Projections/JetAlg.hh	Tue Jul  7 14:21:01 2009	(r1662)
+++ trunk/include/Rivet/Projections/JetAlg.hh	Tue Jul  7 16:38:00 2009	(r1663)
@@ -4,6 +4,7 @@
 
 #include "Rivet/Projection.hh"
 #include "Rivet/Projections/FinalState.hh"
+#include "Rivet/Projections/VisibleFinalState.hh"
 #include "Rivet/Particle.hh"
 #include "Rivet/Jet.hh"
 
@@ -59,6 +60,9 @@
     
   public:
 
+    /// Constructor
+    JetAlg(const FinalState& fs);
+
     /// Clone on the heap.
     virtual const Projection* clone() const = 0;
 
@@ -121,6 +125,7 @@
 
   };
 
+
 }
 
 #endif

Copied and modified: trunk/include/Rivet/Projections/VisibleFinalState.hh (from r1659, trunk/include/Rivet/Projections/VetoedFinalState.hh)
==============================================================================
--- trunk/include/Rivet/Projections/VetoedFinalState.hh	Mon Jul  6 23:47:38 2009	(r1659, copy source)
+++ trunk/include/Rivet/Projections/VisibleFinalState.hh	Tue Jul  7 16:38:00 2009	(r1663)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
-#ifndef RIVET_VetoedFinalState_HH
-#define RIVET_VetoedFinalState_HH
+#ifndef RIVET_VisibleFinalState_HH
+#define RIVET_VisibleFinalState_HH
 
 #include "Rivet/Tools/Logging.hh"
 #include "Rivet/Rivet.hh"
@@ -8,156 +8,54 @@
 #include "Rivet/Event.hh"
 #include "Rivet/Projection.hh"
 #include "Rivet/Projections/FinalState.hh"
+#include "Rivet/Projections/VetoedFinalState.hh"
 
 namespace Rivet {
 
 
-  /// Specify that classes of particles are to be excluded from the final state.
-  class VetoedFinalState : public FinalState {
+  /// Final state modifier which excludes any particles which are not experimentally visible
+  class VisibleFinalState : public FinalState {
 
   public:
-
-    /// Typedef for a pair of back-to-back cuts.    
-    typedef pair<double, double> BinaryCut;
-
-    /// Typedef for a vetoing entry.
-    typedef map<long, BinaryCut> VetoDetails;
-
-    /// Typedef for a veto on a composite particle mass.
-    typedef multimap<int, BinaryCut>  CompositeVeto;
-
     
     /// @name Constructors
     //@{
     /// Default constructor.
-    VetoedFinalState() {
-      setName("VetoedFinalState");
-      addProjection(FinalState(), "FS");
+    VisibleFinalState() {
+      setName("VisibleFinalState");
+      VetoedFinalState vfs;
+      vfs.vetoNeutrinos();
+      addProjection(vfs, "VFS");
+    }
+
+    /// 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");
     }
 
     /// Constructor with specific FinalState.
-    VetoedFinalState(const FinalState& fsp)
+    VisibleFinalState(const FinalState& fsp)
     {
-      setName("VetoedFinalState");
-      addProjection(fsp, "FS");
-    }
-
-    /// You can add a map of ID plus a pair containing \f$ p_{Tmin} \f$ and
-    /// \f$ p_{Tmax} \f$ - these define the range of particles to be vetoed.
-    VetoedFinalState(const VetoDetails& vetocodes)
-      : _vetoCodes(vetocodes)
-    {
-      setName("VetoedFinalState");
-      addProjection(FinalState(), "FS");
-    }
-
-    /// You can add a map of ID plus a pair containing \f$ p_{Tmin} \f$ and
-    /// \f$ p_{Tmax} \f$ - these define the range of particles to be vetoed.
-    /// This version also supplies a specifi FinalState to be used.
-    VetoedFinalState(const FinalState& fsp, const VetoDetails& vetocodes)
-      : _vetoCodes(vetocodes)
-    {
-      setName("VetoedFinalState");
-      addProjection(fsp, "FS");
+      setName("VisibleFinalState");
+      VetoedFinalState vfs(fsp);
+      vfs.vetoNeutrinos();
+      addProjection(vfs, "VFS");
     }
 
 
     /// Clone on the heap.
     virtual const Projection* clone() const {
-      return new VetoedFinalState(*this);
+      return new VisibleFinalState(*this);
     }
     //@}
     
 
-  public:
-
-    /// Get the list of particle IDs and \f$ p_T \f$ ranges to veto.
-    const VetoDetails& vetoDetails() const {
-      return _vetoCodes;
-    }
-  
-    /// Add a particle ID and \f$ p_T \f$ range to veto. Particles with \f$ p_T \f$ 
-    /// IN the given range will be rejected.
-    VetoedFinalState& addVetoDetail(const long id, const double ptmin, const double ptmax) {
-      BinaryCut ptrange(ptmin, ptmax);
-      _vetoCodes.insert(make_pair(id, ptrange));
-      return *this;
-    }
-
-    /// Add a particle/antiparticle pair to veto in a given \f$ p_T \f$ range. Given a single ID, both
-    /// the particle and its conjugate antiparticle will be rejected if their \f$ p_T \f$ is IN the given range.
-    VetoedFinalState& addVetoPairDetail(const long id, const double ptmin, const double ptmax) {
-      addVetoDetail(id,  ptmin, ptmax);
-      addVetoDetail(-id, ptmin, ptmax);
-      return *this;
-    }
-
-    /// Add a particle/antiparticle pair to veto. Given a single ID, both the particle and its corresponding 
-    /// antiparticle (for all \f$ p_T \f$ values) will be vetoed.
-    VetoedFinalState& addVetoPairId(const long id) {
-      addVetoId(id);
-      addVetoId(-id);
-      return *this;
-    }
-
-    /// Add a particle ID to veto (all \f$ p_T \f$ range will be vetoed).
-    VetoedFinalState& addVetoId(const long id) {
-      BinaryCut ptrange(0.0, numeric_limits<double>::max());
-      _vetoCodes.insert(make_pair(id, ptrange));
-      return *this;
-    }
-
-    /// Veto all neutrinos (convenience method)
-    VetoedFinalState& vetoNeutrinos() {
-      addVetoPairId(NU_E);
-      addVetoPairId(NU_MU);
-      addVetoPairId(NU_TAU);
-      return *this;
-    }
-
-    /// Add a veto on composite masses within a given width.
-    /// The composite mass is composed of nProducts decay products
-    /// @ todo might we want to specify a range of pdg ids for the decay products?
-    VetoedFinalState& addCompositeMassVeto(const double &mass, const double &width, int nProducts=2){
-      double halfWidth = 0.5*width;
-      BinaryCut massRange(mass - halfWidth, mass + halfWidth);
-      _compositeVetoes.insert(make_pair(nProducts, massRange));
-      _nCompositeDecays.insert(nProducts);
-      return *this;
-    }
-    
-    /// Veto the decay products of particle with pdg id
-    /// @todo Need HepMC to sort themselves out and keep vector bosons from 
-    /// the hard vtx in the event record before this will work reliably for all pdg ids
-    VetoedFinalState& addDecayProductsVeto(const long id){
-      _parentVetoes.insert(id);
-      return *this;
-    }
-    
-    /// Set the list of particle IDs and \f$ p_T \f$ ranges to veto.
-    VetoedFinalState& setVetoDetails(const VetoDetails& ids) {
-      _vetoCodes = ids;
-      return *this;
-    }
-
-    /// Clear the list of particle IDs and ranges to veto.
-    VetoedFinalState& reset() {
-      _vetoCodes.clear();
-      return *this;
-    }
-    
-
-    /// Veto particles from a supplied final state.
-    VetoedFinalState& addVetoOnThisFinalState(FinalState& fs) {
-      stringstream st_name;
-      st_name << "FS_" << _vetofsnames.size();
-      string name = st_name.str();
-      addProjection(fs, name);
-      _vetofsnames.insert(name);
-      return *this;
-    }
-
-
   protected:
     
     /// Apply the projection on the supplied event.
@@ -166,24 +64,6 @@
     /// Compare projections.
     int compare(const Projection& p) const;
 
-
-  private:
-
-    /// The final-state particles.
-    VetoDetails _vetoCodes;
-    
-    /// Composite particle masses to veto
-    CompositeVeto _compositeVetoes;
-    set<int> _nCompositeDecays;
-    
-    typedef set<long> ParentVetos;
-
-    /// Set of decaying particle IDs to veto
-    ParentVetos _parentVetoes;
-
-    /// Set of finalstate to be vetoed
-    set<string> _vetofsnames;
-
   };
 
   

Modified: trunk/src/Projections/FastJets.cc
==============================================================================
--- trunk/src/Projections/FastJets.cc	Tue Jul  7 14:21:01 2009	(r1662)
+++ trunk/src/Projections/FastJets.cc	Tue Jul  7 16:38:00 2009	(r1663)
@@ -16,12 +16,14 @@
 namespace Rivet {
 
 
-  FastJets::FastJets(const FinalState& fsp, JetAlgName alg, double rparameter, double pTmin, double seed_threshold) {
-    getLog() << Log::DEBUG << "rparameter = " << rparameter << endl;
-    getLog() << Log::DEBUG << "pTmin = " << pTmin << endl;
-    getLog() << Log::DEBUG << "seed_threshold = " << seed_threshold << endl;
+  FastJets::FastJets(const FinalState& fsp, JetAlgName alg, double rparameter, double pTmin, double seed_threshold) 
+    : JetAlg(fsp)
+  {
     setName("FastJets");
-    addProjection(fsp, "FS");
+    getLog() << Log::DEBUG << "R parameter = " << rparameter << endl;
+    getLog() << Log::DEBUG << "pT_min = " << pTmin << endl;
+    getLog() << Log::DEBUG << "Seed threshold = " << seed_threshold << endl;
+    //addProjection(fsp, "FS");
     if (alg == KT) {
       _jdef = fastjet::JetDefinition(fastjet::kt_algorithm, rparameter, fastjet::E_scheme);
     } else if (alg == CAM) {
@@ -60,32 +62,37 @@
 
 
   FastJets::FastJets(const FinalState& fsp, fastjet::JetAlgorithm type,
-                     fastjet::RecombinationScheme recom, double rparameter) {
+                     fastjet::RecombinationScheme recom, double rparameter)
+    : JetAlg(fsp)
+  {
     setName("FastJets");
-    addProjection(fsp, "FS");
+    //addProjection(fsp, "FS");
     _jdef = fastjet::JetDefinition(type, rparameter, recom);
   }
 
 
-  FastJets::FastJets(const FinalState& fsp, const fastjet::JetDefinition::Plugin& plugin) {
+  FastJets::FastJets(const FinalState& fsp, const fastjet::JetDefinition::Plugin& plugin)
+    : JetAlg(fsp)
+  {
     setName("FastJets");
-    addProjection(fsp, "FS");
+    //addProjection(fsp, "FS");
     /// @todo Need to copy the plugin to make a shared_ptr?
     //_plugin = &plugin;
     _jdef = fastjet::JetDefinition(_plugin.get());
   }
 
 
-  FastJets::FastJets(const FastJets& other) 
-    : //_cseq(other._cseq),
-    _jdef(other._jdef),
-    _plugin(other._plugin),
-    _yscales(other._yscales)
-  {  
-    setName("FastJets");
-  }
-
-
+//   FastJets::FastJets(const FastJets& other) 
+//     : JetAlg
+// //_cseq(other._cseq),
+//     _jdef(other._jdef),
+//     _plugin(other._plugin),
+//     _yscales(other._yscales)
+//   {  
+//     setName("FastJets");
+//   }
+  
+  
   int FastJets::compare(const Projection& p) const {
     const FastJets& other = dynamic_cast<const FastJets&>(p);
     return \

Added: trunk/src/Projections/JetAlg.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/src/Projections/JetAlg.cc	Tue Jul  7 16:38:00 2009	(r1663)
@@ -0,0 +1,17 @@
+// -*- C++ -*-
+#include "Rivet/Rivet.hh"
+#include "Rivet/Tools/Logging.hh"
+#include "Rivet/Projections/JetAlg.hh"
+
+namespace Rivet {
+
+
+  JetAlg::JetAlg(const FinalState& fs) {
+    setName("JetAlg");
+    VisibleFinalState vfs(fs);
+    getLog() << Log::DEBUG << "Making visible final state from provided FS" << endl;
+    addProjection(vfs, "FS");
+  }
+  
+  
+}

Modified: trunk/src/Projections/Makefile.am
==============================================================================
--- trunk/src/Projections/Makefile.am	Tue Jul  7 14:21:01 2009	(r1662)
+++ trunk/src/Projections/Makefile.am	Tue Jul  7 16:38:00 2009	(r1663)
@@ -16,6 +16,7 @@
   IdentifiedFinalState.cc \
   InitialQuarks.cc \
   InvMassFinalState.cc \
+  JetAlg.cc \
   JetShape.cc \
   LeadingParticlesFinalState.cc \
   LossyFinalState.cc \
@@ -28,4 +29,5 @@
   TotalVisibleMomentum.cc \
   UnstableFinalState.cc \
   VetoedFinalState.cc \
+  VisibleFinalState.cc \
   ZFinder.cc

Copied and modified: trunk/src/Projections/VisibleFinalState.cc (from r1659, trunk/src/Projections/VetoedFinalState.cc)
==============================================================================
--- trunk/src/Projections/VetoedFinalState.cc	Mon Jul  6 23:47:38 2009	(r1659, copy source)
+++ trunk/src/Projections/VisibleFinalState.cc	Tue Jul  7 16:38:00 2009	(r1663)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 #include "Rivet/Rivet.hh"
-#include "Rivet/Projections/VetoedFinalState.hh"
+#include "Rivet/Projections/VisibleFinalState.hh"
 #include "Rivet/Cmp.hh"
 #include "Rivet/Tools/Utils.hh"
 #include <algorithm>
@@ -8,157 +8,14 @@
 namespace Rivet {
 
 
-  int VetoedFinalState::compare(const Projection& p) const {
-    const PCmp fscmp = mkNamedPCmp(p, "FS");
-    if (fscmp != PCmp::EQUIVALENT) return fscmp;
-    const VetoedFinalState& other = dynamic_cast<const VetoedFinalState&>(p);
-    int vfssize = cmp(_vetofsnames.size(), other._vetofsnames.size());
-    if (vfssize != PCmp::EQUIVALENT) return vfssize;
-    //if the size is the same retrieve the FS projections, store them in two ordered set,
-    //compare the sets element by element
-    set<const Projection*> vfs;
-    set<const Projection*> other_vfs;
-    foreach (const string& ifs, _vetofsnames) {
-      vfs.insert(&(getProjection(ifs)));
-      other_vfs.insert(&(other.getProjection(ifs)));
-    }
-    int isetcmp = cmp(vfs, other_vfs);
-    if (isetcmp != PCmp::EQUIVALENT) return isetcmp;
-    return \
-      cmp(_vetoCodes, other._vetoCodes) ||
-      cmp(_compositeVetoes, other._compositeVetoes) ||
-      cmp(_parentVetoes, other._parentVetoes);
+  int VisibleFinalState::compare(const Projection& p) const {
+    return mkNamedPCmp(p, "VFS");
   }
 
 
-  void VetoedFinalState::project(const Event& e) {
-    const FinalState& fs = applyProjection<FinalState>(e, "FS");
-    _theParticles.clear();
-    _theParticles.reserve(fs.particles().size());
-    foreach (const Particle& p, fs.particles()) {
-      if (getLog().isActive(Log::DEBUG)) {
-        vector<long> codes; 
-        for (VetoDetails::const_iterator code = _vetoCodes.begin(); code != _vetoCodes.end(); ++code) {
-          codes.push_back(code->first);
-        }
-        const string codestr = "{ " + join(codes) + " }";
-        getLog() << Log::DEBUG << p.pdgId() << " vs. veto codes = " 
-                 << codestr << " (" << codes.size() << ")" << endl;
-      }
-      const long pdgid = p.pdgId();
-      const double pt = p.momentum().pT();
-      VetoDetails::iterator iter = _vetoCodes.find(pdgid);
-      if (iter == _vetoCodes.end()) {
-        getLog() << Log::DEBUG << "Storing with PDG code = " << pdgid << ", pT = " << pt << endl;
-        _theParticles.push_back(p);
-      } else {
-        // This particle code is listed as a possible veto... check pT.
-        // Make sure that the pT range is sensible:
-        BinaryCut ptrange = iter->second;
-        assert(ptrange.first <= ptrange.second);
-        stringstream rangess;
-        if (ptrange.first < numeric_limits<double>::max()) rangess << ptrange.second;
-        rangess << " - ";
-        if (ptrange.second < numeric_limits<double>::max()) rangess << ptrange.second;
-        getLog() << Log::DEBUG << "ID = " << pdgid << ", pT range = " << rangess.str();
-        stringstream debugline;
-        debugline << "with PDG code = " << pdgid << " pT = " << p.momentum().pT();
-        if (pt < ptrange.first || pt > ptrange.second) { 
-          getLog() << Log::DEBUG << "Storing " << debugline.str() << endl;
-          _theParticles.push_back(p);
-        } else {
-          getLog() << Log::DEBUG << "Vetoing " << debugline.str() << endl;
-        }
-      }
-    }
-  
-    set<ParticleVector::iterator> toErase;
-    for (set<int>::iterator nIt = _nCompositeDecays.begin();
-         nIt != _nCompositeDecays.end() && !_theParticles.empty(); ++nIt) {
-      map<set<ParticleVector::iterator>, FourMomentum> oldMasses;
-      map<set<ParticleVector::iterator>, FourMomentum> newMasses;
-      set<ParticleVector::iterator> start;
-      start.insert(_theParticles.begin());
-      oldMasses.insert(pair<set<ParticleVector::iterator>, FourMomentum>
-                       (start, _theParticles.begin()->momentum()));
-      
-      for (int nParts = 1; nParts != *nIt; ++nParts) {
-        for (map<set<ParticleVector::iterator>, FourMomentum>::iterator mIt = oldMasses.begin();
-             mIt != oldMasses.end(); ++mIt) {
-          ParticleVector::iterator pStart = *(mIt->first.rbegin());
-          for (ParticleVector::iterator pIt = pStart + 1; pIt != _theParticles.end(); ++pIt) { 
-            FourMomentum cMom = mIt->second + pIt->momentum();
-            set<ParticleVector::iterator> pList(mIt->first);
-            pList.insert(pIt);   
-            newMasses[pList] = cMom;
-          }
-        }
-        oldMasses = newMasses;
-        newMasses.clear();
-      }
-      for (map<set<ParticleVector::iterator>, FourMomentum>::iterator mIt = oldMasses.begin();
-           mIt != oldMasses.end(); ++mIt) {
-        double mass2 = mIt->second.mass2();
-        if (mass2 >= 0.0) {
-          double mass = sqrt(mass2);
-          for (CompositeVeto::iterator cIt = _compositeVetoes.lower_bound(*nIt);
-               cIt != _compositeVetoes.upper_bound(*nIt); ++cIt) {
-            BinaryCut massRange = cIt->second;
-            if (mass < massRange.second && mass > massRange.first) {
-              for (set<ParticleVector::iterator>::iterator lIt = mIt->first.begin();
-                   lIt != mIt->first.end(); ++lIt) {
-                toErase.insert(*lIt);                
-              }
-            }
-          }
-        }
-      }
-    }
-    
-    for (set<ParticleVector::iterator>::reverse_iterator p = toErase.rbegin(); p != toErase.rend(); ++p) {
-      _theParticles.erase(*p);
-    }    
-    
-    for (ParentVetos::const_iterator vIt = _parentVetoes.begin(); vIt != _parentVetoes.end(); ++vIt) {
-      for (ParticleVector::iterator p = _theParticles.begin(); p != _theParticles.end(); ++p) {
-        GenVertex *startVtx=((*p).genParticle()).production_vertex();
-        bool veto = false;
-        GenParticle HepMCP = (*p).genParticle();
-        if (startVtx!=0) {
-          for (GenVertex::particle_iterator pIt = startVtx->particles_begin(HepMC::ancestors);
-               pIt != startVtx->particles_end(HepMC::ancestors) && !veto; ++pIt) {
-            
-            if (*vIt == (*pIt)->pdg_id()) {
-              veto = true;
-              p = _theParticles.erase(p);
-              --p;
-            }
-          }
-        }
-      }
-    }
-
-    // Now veto on the FS
-    foreach (const string& ifs, _vetofsnames) {
-      const FinalState& vfs = applyProjection<FinalState>(e, ifs);
-      const ParticleVector& vfsp = vfs.particles();
-      for (ParticleVector::iterator icheck = _theParticles.begin(); icheck != _theParticles.end(); ++icheck){
-        if (!icheck->hasGenParticle()) continue;
-        bool found = false;
-        for (ParticleVector::const_iterator ipart = vfsp.begin(); ipart != vfsp.end(); ++ipart){
-          if (!ipart->hasGenParticle()) continue;
-          getLog() << Log::DEBUG << "Comparing barcode " << icheck->genParticle().barcode() << " with veto particle " << ipart->genParticle().barcode() << endl; 
-          if (ipart->genParticle().barcode() == icheck->genParticle().barcode()){
-            found = true;
-            break;
-          }
-        }
-        if (found) {
-          _theParticles.erase(icheck);
-          --icheck;
-        }	
-      }	
-    }
+  void VisibleFinalState::project(const Event& e) {
+    const FinalState& vfs = applyProjection<FinalState>(e, "VFS");
+    _theParticles = vfs.particles();
   }
   
 


More information about the Rivet-svn mailing list