00001 // -*- C++ -*- 00002 #include "Rivet/Tools/Logging.hh" 00003 #include "Rivet/Tools/ParticleIdUtils.hh" 00004 #include "Rivet/Projections/Multiplicity.hh" 00005 #include "Rivet/Cmp.hh" 00006 00007 namespace Rivet { 00008 00009 00010 int Multiplicity::compare(const Projection& p) const { 00011 return mkNamedPCmp(p, "FS"); 00012 } 00013 00014 00015 void Multiplicity::project(const Event& e) { 00016 const FinalState& fs = applyProjection<FinalState>(e, "FS"); 00017 _totalMult = fs.particles().size(); 00018 _hadMult = 0; 00019 for (ParticleVector::const_iterator p = fs.particles().begin(); p != fs.particles().end(); ++p) { 00020 if (PID::isHadron(p->pdgId())) ++_hadMult; 00021 } 00022 } 00023 00024 }