2#ifndef RIVET_DecayedParticles_HH
3#define RIVET_DecayedParticles_HH
5#include "Rivet/Projections/ParticleFinder.hh"
21 declare(particles,
"PARTICLES");
28 using Projection::operator =;
50 const vector<unsigned int> &
nStable()
const {
return _nStable;}
55 const vector<map<PdgId,Particles> > &
decayProducts()
const {
return _products;}
60 bool modeMatches(
size_t imode,
unsigned int nstable, map<PdgId,unsigned int> prod)
const {
62 if(nstable!=_nStable[imode])
return false;
63 for (
const auto & kv : prod ) {
65 map<PdgId,Particles>::const_iterator iloc = _products[imode].find(kv.first);
67 if (iloc == _products[imode].end())
return false;
69 if(iloc->second.size()!=kv.second)
return false;
88 void findDecayProducts(
const Particle & mother,
unsigned int & nstable,
89 map<PdgId,Particles> & products);
106 vector<unsigned int> _nStable;
111 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:55
const vector< unsigned int > & nStable() const
Definition DecayedParticles.hh:50
virtual void project(const Event &e)
Apply the projection to the event.
DecayedParticles()
Constructor.
Definition DecayedParticles.hh:17
DecayedParticles & addStable(PdgId pid)
Add a particle to be considered stable when finding the decay products.
Definition DecayedParticles.hh:37
DEFAULT_RIVET_PROJ_CLONE(DecayedParticles)
Clone on the heap.
bool modeMatches(size_t imode, unsigned int nstable, map< PdgId, unsigned int > prod) const
Definition DecayedParticles.hh:60
const Particles & decaying() const
Definition DecayedParticles.hh:45
virtual ~DecayedParticles()
Virtual destructor.
Definition DecayedParticles.hh:31
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:53
Specialised vector of Particle objects.
Definition Particle.hh:25
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:170
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:142
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
int pid(const Particle &p)
Unbound function access to PID code.
Definition ParticleUtils.hh:23
Definition MC_Cent_pPb.hh:10