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

| Rivet 3.1.9

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 class PrimaryParticles : public ParticleFinder {
20 public:
21
26 PrimaryParticles(std::initializer_list<int> pids,
27 const Cut& c=Cuts::open()) :
28 ParticleFinder(c), _pdgIds(pids) {
29 setName("PrimaryParticles");
30 }
31
32 // Clone on the heap.
33 DEFAULT_RIVET_PROJ_CLONE(PrimaryParticles);
34
36 using Projection::operator =;
37
38
40 PrimaryParticles(const PrimaryParticles& other) :
41 ParticleFinder(other), _pdgIds(other._pdgIds) {
42 }
43
50 virtual CmpState compare(const Projection& p) const
51 {
52 const PrimaryParticles* other = dynamic_cast<const PrimaryParticles*>(&p);
53 if (!other) return CmpState::NEQ;
54 if (_cuts != other->_cuts || _pdgIds != other->_pdgIds) return CmpState::NEQ;
55 return CmpState::EQ;
56 }
57
58
59 protected:
60
64 virtual void project(const Event& e);
65
74 virtual bool isPrimary(ConstGenParticlePtr p) const;
75
77 virtual bool isIgnored(ConstGenParticlePtr p) const;
78
84 virtual bool isPrimaryPID(ConstGenParticlePtr p) const;
85
92 virtual bool hasDecayed(ConstGenParticlePtr p) const;
93
99 virtual bool isBeam(ConstGenParticlePtr p) const;
100
106 ConstGenParticlePtr ancestor(ConstGenParticlePtr p) const;
107
114 ConstGenParticlePtr ancestor(ConstGenParticlePtr p, bool) const;
115
117 std::vector<int> _pdgIds;
118
119 };
120
121
122}
123
124#endif
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::PrimaryParticles
Project out primary particles according to definition.
Definition PrimaryParticles.hh:19
Rivet::PrimaryParticles::ancestor
ConstGenParticlePtr ancestor(ConstGenParticlePtr p, bool) const
Rivet::PrimaryParticles::isIgnored
virtual bool isIgnored(ConstGenParticlePtr p) const
Check if the particle should be ignored, via its status code.
Rivet::PrimaryParticles::isBeam
virtual bool isBeam(ConstGenParticlePtr p) const
Rivet::PrimaryParticles::isPrimaryPID
virtual bool isPrimaryPID(ConstGenParticlePtr p) const
Rivet::PrimaryParticles::PrimaryParticles
PrimaryParticles(std::initializer_list< int > pids, const Cut &c=Cuts::open())
Definition PrimaryParticles.hh:26
Rivet::PrimaryParticles::hasDecayed
virtual bool hasDecayed(ConstGenParticlePtr p) const
Rivet::PrimaryParticles::PrimaryParticles
PrimaryParticles(const PrimaryParticles &other)
Copy constructor.
Definition PrimaryParticles.hh:40
Rivet::PrimaryParticles::ancestor
ConstGenParticlePtr ancestor(ConstGenParticlePtr p) const
Rivet::PrimaryParticles::project
virtual void project(const Event &e)
Rivet::PrimaryParticles::compare
virtual CmpState compare(const Projection &p) const
Definition PrimaryParticles.hh:50
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::pids
PdgIdPair pids(const ParticlePair &pp)
Definition ParticleUtils.hh:749
Rivet::Cuts::open
const Cut & open()
Fully open cut singleton, accepts everything.
Rivet
Definition MC_Cent_pPb.hh:10