Rivet API documentation

Rivet 4.1.3
PrimaryParticles.hh
1// -*- C++ -*-
2#ifndef RIVET_PrimaryParticles_HH
3#define RIVET_PrimaryParticles_HH
4
5#include "Rivet/Projections/ParticleFinder.hh"
6#include "Rivet/Tools/Cuts.hh"
7
8namespace Rivet {
9
10
19 public:
20
21 using ParticleFinder::operator=;
22
27 PrimaryParticles(std::initializer_list<int> pids, const Cut& c = Cuts::open())
28 : ParticleFinder(c), _pdgIds(pids) {
29 setName("PrimaryParticles");
30 }
31
32 // Clone on the heap.
33 RIVET_DEFAULT_PROJ_CLONE(PrimaryParticles);
34
36 using Projection::operator=;
37
38
41 : ParticleFinder(other), _pdgIds(other._pdgIds) { }
42
49 virtual CmpState compare(const Projection& p) const {
50 const PrimaryParticles* other = dynamic_cast<const PrimaryParticles*>(&p);
51 if (!other) return CmpState::NEQ;
52 if (_cuts != other->_cuts || _pdgIds != other->_pdgIds) return CmpState::NEQ;
53 return CmpState::EQ;
54 }
55
56
57 protected:
58
62 virtual void project(const Event& e);
63
72 virtual bool isPrimary(ConstGenParticlePtr p) const;
73
75 virtual bool isIgnored(ConstGenParticlePtr p) const;
76
82 virtual bool isPrimaryPID(ConstGenParticlePtr p) const;
83
90 virtual bool hasDecayed(ConstGenParticlePtr p) const;
91
97 virtual bool isBeam(ConstGenParticlePtr p) const;
98
104 ConstGenParticlePtr ancestor(ConstGenParticlePtr p) const;
105
112 ConstGenParticlePtr ancestor(ConstGenParticlePtr p, bool) const;
113
115 vector<int> _pdgIds;
116 };
117
118
119}
120
121#endif
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
ParticleFinder(const Cut &c=Cuts::OPEN)
Construction using Cuts object.
Definition ParticleFinder.hh:20
Project out primary particles according to definition.
Definition PrimaryParticles.hh:18
ConstGenParticlePtr ancestor(ConstGenParticlePtr p, bool) const
virtual bool isIgnored(ConstGenParticlePtr p) const
Check if the particle should be ignored, via its status code.
virtual bool isBeam(ConstGenParticlePtr p) const
virtual bool isPrimaryPID(ConstGenParticlePtr p) const
PrimaryParticles(std::initializer_list< int > pids, const Cut &c=Cuts::open())
Definition PrimaryParticles.hh:27
virtual bool hasDecayed(ConstGenParticlePtr p) const
PrimaryParticles(const PrimaryParticles &other)
Copy constructor.
Definition PrimaryParticles.hh:40
ConstGenParticlePtr ancestor(ConstGenParticlePtr p) const
virtual void project(const Event &e)
virtual CmpState compare(const Projection &p) const
Definition PrimaryParticles.hh:49
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:146
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
PdgIdPair pids(const ParticlePair &pp)
Get the PDG ID codes of a ParticlePair.
Definition ParticleUtils.hh:804
const Cut & open()
Fully open cut singleton, accepts everything.
Definition LHCbCommon.hh:9