00001 // -*- C++ -*- 00002 #include "Rivet/Rivet.hh" 00003 #include "Rivet/Projections/NeutralFinalState.hh" 00004 #include "Rivet/Tools/ParticleIdUtils.hh" 00005 #include "Rivet/Cmp.hh" 00006 #include <algorithm> 00007 00008 namespace Rivet { 00009 00010 00011 int NeutralFinalState::compare(const Projection& p) const { 00012 const NeutralFinalState& other = dynamic_cast<const NeutralFinalState&>(p); 00013 return mkNamedPCmp(other, "FS") || cmp(_Etmin, other._Etmin); 00014 } 00015 00016 00017 void NeutralFinalState::project(const Event& e) { 00018 const FinalState& fs = applyProjection<FinalState>(e, "FS"); 00019 _theParticles.clear(); 00020 foreach (const Particle& p, fs.particles()){ 00021 if ((PID::threeCharge(p.pdgId()) != 0) && (p.momentum().Et() > _Etmin)) { 00022 _theParticles.push_back(p); 00023 if (getLog().isActive(Log::TRACE)) { 00024 getLog() << Log::TRACE 00025 << "Selected: ID = " << p.pdgId() 00026 << ", Et = " << p.momentum().Et() 00027 << ", eta = " << p.momentum().eta() 00028 << ", charge = " << PID::threeCharge(p.pdgId())/3.0 << endl; 00029 } 00030 } 00031 } 00032 getLog() << Log::DEBUG << "Number of neutral final-state particles = " 00033 << _theParticles.size() << endl; 00034 } 00035 00036 00037 }