Rivet: /Users/chrisg/software/rivet/include/Rivet/Projections/DecayedParticles.hh Source File

| Rivet 3.1.9

DecayedParticles.hh
1// -*- C++ -*-
2#ifndef RIVET_DecayedParticles_HH
3#define RIVET_DecayedParticles_HH
4
5#include "Rivet/Projections/ParticleFinder.hh"
6
7namespace Rivet {
8
9
11 class DecayedParticles : public Projection {
12 public:
13
15
16
17 DecayedParticles() {}
18
19 DecayedParticles(const ParticleFinder & particles) {
20 setName("DecayedParticles");
21 declare(particles, "PARTICLES");
22 }
23
25 DEFAULT_RIVET_PROJ_CLONE(DecayedParticles);
26
28 using Projection::operator =;
29
31 virtual ~DecayedParticles() { }
33
34 public :
35
37 DecayedParticles & addStable(PdgId pid) {
38 _stable.insert(pid);
39 return *this;
40 }
41
45 const Particles & decaying() const {return _decaying;}
46
50 const vector<unsigned int> & nStable() const {return _nStable;}
51
55 const vector<map<PdgId,Particles> > & decayProducts() const {return _products;}
56
60 bool modeMatches(size_t imode,unsigned int nstable, map<PdgId,unsigned int> prod) const {
61 // same no of stable particles
62 if(nstable!=_nStable[imode]) return false;
63 for (const auto & kv : prod ) {
64 // check if same decay products
65 map<PdgId,Particles>::const_iterator iloc = _products[imode].find(kv.first);
66 // same type of product
67 if (iloc == _products[imode].end()) return false;
68 // and same number
69 if(iloc->second.size()!=kv.second) return false;
70 }
71 // pass all the tests
72 return true;
73 }
74
75 protected:
76
78 virtual void project(const Event& e);
79
81 virtual CmpState compare(const Projection& p) const;
82
83 private :
84
88 void findDecayProducts(const Particle & mother, unsigned int & nstable,
89 map<PdgId,Particles> & products);
90
91 private :
92
96 set<PdgId> _stable;
97
101 Particles _decaying;
102
106 vector<unsigned int> _nStable;
107
111 vector<map<PdgId,Particles> > _products;
112 };
113
114
115}
116
117#endif
Rivet::DecayedParticles
Find the decay products of particles in the projection for subsquent analyses.
Definition DecayedParticles.hh:11
Rivet::DecayedParticles::compare
virtual CmpState compare(const Projection &p) const
Compare projections.
Rivet::DecayedParticles::decayProducts
const vector< map< PdgId, Particles > > & decayProducts() const
Definition DecayedParticles.hh:55
Rivet::DecayedParticles::nStable
const vector< unsigned int > & nStable() const
Definition DecayedParticles.hh:50
Rivet::DecayedParticles::project
virtual void project(const Event &e)
Apply the projection to the event.
Rivet::DecayedParticles::DecayedParticles
DecayedParticles()
Constructor.
Definition DecayedParticles.hh:17
Rivet::DecayedParticles::addStable
DecayedParticles & addStable(PdgId pid)
Add a particle to be considered stable when finding the decay products.
Definition DecayedParticles.hh:37
Rivet::DecayedParticles::DEFAULT_RIVET_PROJ_CLONE
DEFAULT_RIVET_PROJ_CLONE(DecayedParticles)
Clone on the heap.
Rivet::DecayedParticles::modeMatches
bool modeMatches(size_t imode, unsigned int nstable, map< PdgId, unsigned int > prod) const
Definition DecayedParticles.hh:60
Rivet::DecayedParticles::decaying
const Particles & decaying() const
Definition DecayedParticles.hh:45
Rivet::DecayedParticles::~DecayedParticles
virtual ~DecayedParticles()
Virtual destructor.
Definition DecayedParticles.hh:31
Rivet::Event
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Rivet::ParticleFinder
Base class for projections which return subsets of an event's particles.
Definition ParticleFinder.hh:11
Rivet::Particle
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:53
Rivet::Particles
Specialised vector of Particle objects.
Definition Particle.hh:25
Rivet::ProjectionApplier::declare
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:170
Rivet::Projection
Base class for all Rivet projections.
Definition Projection.hh:29
Rivet::Projection::setName
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:142
Rivet::Kin::p
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
Rivet::pid
int pid(const Particle &p)
Unbound function access to PID code.
Definition ParticleUtils.hh:23
Rivet
Definition MC_Cent_pPb.hh:10