File indexing completed on 2025-05-12 09:05:02
0001
0002 #ifndef RIVET_DecayedParticles_HH
0003 #define RIVET_DecayedParticles_HH
0004
0005 #include "Rivet/Projections/ParticleFinder.hh"
0006
0007 namespace Rivet {
0008
0009
0010
0011 class DecayedParticles : public Projection {
0012 public:
0013
0014
0015
0016
0017
0018 DecayedParticles() {}
0019
0020 DecayedParticles(const ParticleFinder & particles) {
0021 setName("DecayedParticles");
0022 declare(particles, "PARTICLES");
0023 }
0024
0025
0026 RIVET_DEFAULT_PROJ_CLONE(DecayedParticles);
0027
0028
0029 using Projection::operator=;
0030
0031
0032 virtual ~DecayedParticles() { }
0033
0034
0035
0036 public :
0037
0038
0039 DecayedParticles & addStable(PdgId pid) {
0040 _stable.insert(pid);
0041 return *this;
0042 }
0043
0044
0045
0046
0047 const Particles & decaying() const {return _decaying;}
0048
0049
0050
0051
0052 const vector<unsigned int> & nStable() const {return _nStable;}
0053
0054
0055
0056
0057 const vector<map<PdgId,Particles> > & decayProducts() const {return _products;}
0058
0059
0060
0061
0062 bool modeMatches(size_t imode,unsigned int nstable, map<PdgId,unsigned int> prod) const {
0063
0064 if (nstable!=_nStable[imode]) return false;
0065 for (const auto & kv : prod ) {
0066
0067 map<PdgId,Particles>::const_iterator iloc = _products[imode].find(kv.first);
0068
0069 if (iloc == _products[imode].end()) return false;
0070
0071 if(iloc->second.size()!=kv.second) return false;
0072 }
0073
0074 return true;
0075 }
0076
0077 protected:
0078
0079
0080 virtual void project(const Event& e);
0081
0082
0083 virtual CmpState compare(const Projection& p) const;
0084
0085 private :
0086
0087
0088
0089
0090 void findDecayProducts(const Particle & mother, unsigned int & nstable,
0091 map<PdgId,Particles> & products);
0092
0093 private :
0094
0095
0096
0097
0098 set<PdgId> _stable;
0099
0100
0101
0102
0103 Particles _decaying;
0104
0105
0106
0107
0108 vector<unsigned int> _nStable;
0109
0110
0111
0112
0113 vector<map<PdgId,Particles> > _products;
0114 };
0115
0116
0117 }
0118
0119 #endif