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

| Rivet 3.1.9

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
11 class IdentifiedFinalState : public FinalState {
12 public:
13
15
16
18 IdentifiedFinalState(const FinalState& fsp, const vector<PdgId>& pids=vector<PdgId>());
19
21 IdentifiedFinalState(const FinalState& fsp, PdgId pid);
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
37 DEFAULT_RIVET_PROJ_CLONE(IdentifiedFinalState);
38
40
42 using Projection::operator =;
43
44
46 const set<PdgId>& acceptedIds() const {
47 return _pids;
48 }
49
51 IdentifiedFinalState& acceptId(PdgId pid) {
52 _pids.insert(pid);
53 return *this;
54 }
55
57 IdentifiedFinalState& acceptIds(const vector<PdgId>& pids) {
58 for (const PdgId pid : pids) _pids.insert(pid);
59 return *this;
60 }
61
63 IdentifiedFinalState& acceptIdPair(PdgId pid) {
64 _pids.insert(pid);
65 _pids.insert(-pid);
66 return *this;
67 }
68
70 IdentifiedFinalState& acceptIdPairs(const vector<PdgId>& pids) {
71 for (const PdgId pid : pids) {
72 _pids.insert(pid);
73 _pids.insert(-pid);
74 }
75 return *this;
76 }
77
79 IdentifiedFinalState& acceptNeutrinos() {
80 acceptIdPair(PID::NU_E);
81 acceptIdPair(PID::NU_MU);
82 acceptIdPair(PID::NU_TAU);
83 return *this;
84 }
85
87 IdentifiedFinalState& acceptChLeptons() {
88 acceptIdPair(PID::ELECTRON);
89 acceptIdPair(PID::MUON);
90 acceptIdPair(PID::TAU);
91 return *this;
92 }
93
95 void reset() {
96 _pids.clear();
97 }
98
99 // The remaining particles
100 virtual const Particles& remainingParticles() const {
101 return _remainingParticles;
102 }
103
104
106 void project(const Event& e);
107
109 CmpState compare(const Projection& p) const;
110
111
112 protected:
113
115 set<PdgId> _pids;
116
117 // A vector of all other particles in the final state
118 Particles _remainingParticles;
119
120 };
121
122
123}
124
125#endif
Rivet::Event
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Rivet::FinalState
Project out all final-state particles in an event. Probably the most important projection in Rivet!
Definition FinalState.hh:12
Rivet::IdentifiedFinalState
Produce a final state which only contains specified particle IDs.
Definition IdentifiedFinalState.hh:11
Rivet::IdentifiedFinalState::acceptIdPairs
IdentifiedFinalState & acceptIdPairs(const vector< PdgId > &pids)
Add a set of accepted particle IDs and their antiparticles.
Definition IdentifiedFinalState.hh:70
Rivet::IdentifiedFinalState::compare
CmpState compare(const Projection &p) const
Compare projections.
Rivet::IdentifiedFinalState::IdentifiedFinalState
IdentifiedFinalState(const vector< PdgId > &pids, const Cut &c=Cuts::open())
Construction using list of PDG ID codes and an optional Cuts object.
Rivet::IdentifiedFinalState::IdentifiedFinalState
IdentifiedFinalState(const FinalState &fsp, const vector< PdgId > &pids=vector< PdgId >())
Constructor with a FinalState and optional list of PDG ID codes.
Rivet::IdentifiedFinalState::acceptIds
IdentifiedFinalState & acceptIds(const vector< PdgId > &pids)
Add a set of accepted particle IDs.
Definition IdentifiedFinalState.hh:57
Rivet::IdentifiedFinalState::IdentifiedFinalState
IdentifiedFinalState(const FinalState &fsp, PdgId pid)
Constructor with a FinalState and a single PDG ID code.
Rivet::IdentifiedFinalState::reset
void reset()
Reset the list of particle IDs to accept.
Definition IdentifiedFinalState.hh:95
Rivet::IdentifiedFinalState::acceptId
IdentifiedFinalState & acceptId(PdgId pid)
Add an accepted particle ID.
Definition IdentifiedFinalState.hh:51
Rivet::IdentifiedFinalState::IdentifiedFinalState
IdentifiedFinalState(const Cut &c, PdgId pid)
Construction using Cuts object and a single PDG ID code.
Rivet::IdentifiedFinalState::acceptNeutrinos
IdentifiedFinalState & acceptNeutrinos()
Accept all neutrinos (convenience method).
Definition IdentifiedFinalState.hh:79
Rivet::IdentifiedFinalState::acceptIdPair
IdentifiedFinalState & acceptIdPair(PdgId pid)
Add an accepted particle ID and its antiparticle.
Definition IdentifiedFinalState.hh:63
Rivet::IdentifiedFinalState::acceptedIds
const set< PdgId > & acceptedIds() const
Get the list of particle IDs to accept.
Definition IdentifiedFinalState.hh:46
Rivet::IdentifiedFinalState::project
void project(const Event &e)
Apply the projection on the supplied event.
Rivet::IdentifiedFinalState::IdentifiedFinalState
IdentifiedFinalState(PdgId pid, const Cut &c=Cuts::open())
Construction using a single PDG ID code and an optional Cuts object.
Rivet::IdentifiedFinalState::acceptChLeptons
IdentifiedFinalState & acceptChLeptons()
Accept all charged leptons (convenience method).
Definition IdentifiedFinalState.hh:87
Rivet::IdentifiedFinalState::IdentifiedFinalState
IdentifiedFinalState(const Cut &c=Cuts::open(), const vector< PdgId > &pids=vector< PdgId >())
Construction using optional Cuts object and optional list of PDG ID codes.
Rivet::IdentifiedFinalState::DEFAULT_RIVET_PROJ_CLONE
DEFAULT_RIVET_PROJ_CLONE(IdentifiedFinalState)
Clone on the heap.
Rivet::Particles
Specialised vector of Particle objects.
Definition Particle.hh:25
Rivet::Projection
Base class for all Rivet projections.
Definition Projection.hh:29
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::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