HadronicFinalState.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Rivet.hh"
00003 #include "Rivet/Tools/ParticleIdUtils.hh"
00004 #include "Rivet/Projections/HadronicFinalState.hh"
00005 #include "Rivet/Cmp.hh"
00006 #include <algorithm>
00007 
00008 namespace Rivet {
00009 
00010 
00011   int HadronicFinalState::compare(const Projection& p) const {
00012     return FinalState::compare(p);
00013   }
00014 
00015 
00016   bool hadronFilter(const Particle& p) {
00017     return ! PID::isHadron(p.pdgId());
00018   }
00019 
00020 
00021   void HadronicFinalState::project(const Event& e) {
00022     FinalState fsp = static_cast<FinalState>(*this);
00023     const FinalState& fs = applyProjection(e, fsp);
00024     _theParticles.clear();
00025     std::remove_copy_if(fs.particles().begin(), fs.particles().end(),
00026                         std::back_inserter(_theParticles), hadronFilter);
00027     getLog() << Log::DEBUG << "Number of hadronic final-state particles = "
00028              << _theParticles.size() << endl;
00029   }
00030 
00031 }