rivet is hosted by Hepforge, IPPP Durham
ChargedLeptons.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Projections/ChargedLeptons.hh"
00003 
00004 namespace Rivet {
00005 
00006 
00007   int ChargedLeptons::compare(const Projection& other) const {
00008     return mkNamedPCmp(other, "ChFS");
00009   }
00010 
00011 
00012   void ChargedLeptons::project(const Event& evt) {
00013     // Reset result
00014     _theParticles.clear();
00015 
00016     // Loop over charged particles and fill vector with leptons
00017     const FinalState& fs = applyProjection<FinalState>(evt, "ChFS");
00018     foreach (const Particle& p, fs.particles()) {
00019       if (PID::isLepton(p.pdgId())) {
00020         _theParticles += Particle(p);
00021       }
00022     }
00023     std::sort(_theParticles.begin(), _theParticles.end(), cmpMomByPt);
00024   }
00025 
00026 
00027 }