rivet is hosted by Hepforge, IPPP Durham
Rivet 3.1.6
IdentifiedFinalState.hh
1// -*- C++ -*-
2#ifndef RIVET_IdentifiedFinalState_HH
3#define RIVET_IdentifiedFinalState_HH
4
5#include "Rivet/Projections/FinalState.hh"
6
7namespace Rivet {
8
9
12 public:
13
15
16
18 IdentifiedFinalState(const FinalState& fsp, const vector<PdgId>& pids=vector<PdgId>());
19
22
24 IdentifiedFinalState(const Cut& c=Cuts::open(), const vector<PdgId>& pids=vector<PdgId>());
25
27 IdentifiedFinalState(const vector<PdgId>& pids, const Cut& c=Cuts::open());
28
30 IdentifiedFinalState(const Cut& c, PdgId pid);
31
33 IdentifiedFinalState(PdgId pid, const Cut& c=Cuts::open());
34
35
38
40
41
43 const set<PdgId>& acceptedIds() const {
44 return _pids;
45 }
46
49 _pids.insert(pid);
50 return *this;
51 }
52
54 IdentifiedFinalState& acceptIds(const vector<PdgId>& pids) {
55 for (const PdgId pid : pids) _pids.insert(pid);
56 return *this;
57 }
58
61 _pids.insert(pid);
62 _pids.insert(-pid);
63 return *this;
64 }
65
67 IdentifiedFinalState& acceptIdPairs(const vector<PdgId>& pids) {
68 for (const PdgId pid : pids) {
69 _pids.insert(pid);
70 _pids.insert(-pid);
71 }
72 return *this;
73 }
74
77 acceptIdPair(PID::NU_E);
78 acceptIdPair(PID::NU_MU);
79 acceptIdPair(PID::NU_TAU);
80 return *this;
81 }
82
85 acceptIdPair(PID::ELECTRON);
86 acceptIdPair(PID::MUON);
87 acceptIdPair(PID::TAU);
88 return *this;
89 }
90
92 void reset() {
93 _pids.clear();
94 }
95
96 // The remaining particles
97 virtual const Particles& remainingParticles() const {
98 return _remainingParticles;
99 }
100
101
103 void project(const Event& e);
104
106 CmpState compare(const Projection& p) const;
107
108
109 private:
110
112 set<PdgId> _pids;
113
114 // A vector of all other particles in the final state
115 Particles _remainingParticles;
116
117 };
118
119
120}
121
122
123#endif
Representation of a HepMC event, and enabler of Projection caching.
Definition: Event.hh:22
Project out all final-state particles in an event. Probably the most important projection in Rivet!
Definition: FinalState.hh:12
Produce a final state which only contains specified particle IDs.
Definition: IdentifiedFinalState.hh:11
IdentifiedFinalState & acceptIdPairs(const vector< PdgId > &pids)
Add a set of accepted particle IDs and their antiparticles.
Definition: IdentifiedFinalState.hh:67
CmpState compare(const Projection &p) const
Compare projections.
IdentifiedFinalState(const vector< PdgId > &pids, const Cut &c=Cuts::open())
Construction using list of PDG ID codes and an optional Cuts object.
IdentifiedFinalState(const FinalState &fsp, const vector< PdgId > &pids=vector< PdgId >())
Constructor with a FinalState and optional list of PDG ID codes.
IdentifiedFinalState & acceptIds(const vector< PdgId > &pids)
Add a set of accepted particle IDs.
Definition: IdentifiedFinalState.hh:54
IdentifiedFinalState(const FinalState &fsp, PdgId pid)
Constructor with a FinalState and a single PDG ID code.
void reset()
Reset the list of particle IDs to accept.
Definition: IdentifiedFinalState.hh:92
IdentifiedFinalState & acceptId(PdgId pid)
Add an accepted particle ID.
Definition: IdentifiedFinalState.hh:48
IdentifiedFinalState(const Cut &c, PdgId pid)
Construction using Cuts object and a single PDG ID code.
IdentifiedFinalState & acceptNeutrinos()
Accept all neutrinos (convenience method).
Definition: IdentifiedFinalState.hh:76
IdentifiedFinalState & acceptIdPair(PdgId pid)
Add an accepted particle ID and its antiparticle.
Definition: IdentifiedFinalState.hh:60
const set< PdgId > & acceptedIds() const
Get the list of particle IDs to accept.
Definition: IdentifiedFinalState.hh:43
void project(const Event &e)
Apply the projection on the supplied event.
IdentifiedFinalState(PdgId pid, const Cut &c=Cuts::open())
Construction using a single PDG ID code and an optional Cuts object.
IdentifiedFinalState & acceptChLeptons()
Accept all charged leptons (convenience method).
Definition: IdentifiedFinalState.hh:84
IdentifiedFinalState(const Cut &c=Cuts::open(), const vector< PdgId > &pids=vector< PdgId >())
Construction using optional Cuts object and optional list of PDG ID codes.
DEFAULT_RIVET_PROJ_CLONE(IdentifiedFinalState)
Clone on the heap.
Specialised vector of Particle objects.
Definition: Particle.hh:25
Base class for all Rivet projections.
Definition: Projection.hh:29
double p(const ParticleBase &p)
Unbound function access to p.
Definition: ParticleBaseUtils.hh:653
PdgIdPair pids(const ParticlePair &pp)
Definition: ParticleUtils.hh:749
int pid(const Particle &p)
Unbound function access to PID code.
Definition: ParticleUtils.hh:23
const Cut & open()
Fully open cut singleton, accepts everything.
Definition: MC_Cent_pPb.hh:10