2#ifndef RIVET_DecayedParticles_HH
3#define RIVET_DecayedParticles_HH
5#include "Rivet/Projections/ParticleFinder.hh"
22 declare(particles,
"PARTICLES");
29 using Projection::operator=;
52 const vector<unsigned int> &
nStable()
const {
return _nStable;}
57 const vector<map<PdgId,Particles> > &
decayProducts()
const {
return _products;}
62 bool modeMatches(
size_t imode,
unsigned int nstable, map<PdgId,unsigned int> prod)
const {
64 if (nstable!=_nStable[imode])
return false;
65 for (
const auto & kv : prod ) {
67 map<PdgId,Particles>::const_iterator iloc = _products[imode].find(kv.first);
69 if (iloc == _products[imode].end())
return false;
71 if(iloc->second.size()!=kv.second)
return false;
90 void findDecayProducts(
const Particle & mother,
unsigned int & nstable,
91 map<PdgId,Particles> & products);
108 vector<unsigned int> _nStable;
113 vector<map<PdgId,Particles> > _products;
Find the decay products of particles in the projection for subsquent analyses.
Definition DecayedParticles.hh:11
virtual CmpState compare(const Projection &p) const
Compare projections.
const vector< map< PdgId, Particles > > & decayProducts() const
Definition DecayedParticles.hh:57
const vector< unsigned int > & nStable() const
Definition DecayedParticles.hh:52
virtual void project(const Event &e)
Apply the projection to the event.
RIVET_DEFAULT_PROJ_CLONE(DecayedParticles)
Clone on the heap.
DecayedParticles()
Constructor.
Definition DecayedParticles.hh:18
DecayedParticles & addStable(PdgId pid)
Add a particle to be considered stable when finding the decay products.
Definition DecayedParticles.hh:39
bool modeMatches(size_t imode, unsigned int nstable, map< PdgId, unsigned int > prod) const
Definition DecayedParticles.hh:62
const Particles & decaying() const
Definition DecayedParticles.hh:47
virtual ~DecayedParticles()
Virtual destructor.
Definition DecayedParticles.hh:32
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Base class for projections which return subsets of an event's particles.
Definition ParticleFinder.hh:11
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:45
Specialised vector of Particle objects.
Definition Particle.hh:21
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:175
Base class for all Rivet projections.
Definition Projection.hh:29
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:148
int pid(const Particle &p)
Unbound function access to PID code.
Definition ParticleUtils.hh:23
Definition MC_CENT_PPB_Projections.hh:10